/[ascend]/trunk/test.py
ViewVC logotype

Diff of /trunk/test.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/pygtk/test.py revision 1022 by johnpye, Wed Jan 3 08:37:14 2007 UTC trunk/test.py revision 1118 by johnpye, Thu Jan 11 12:08:12 2007 UTC
# Line 1  Line 1 
1  #!/usr/bin/env python  #!/usr/bin/env python
2    #   ASCEND modelling environment
3    #   Copyright (C) 2006 Carnegie Mellon University
4    #
5    #   This program is free software; you can redistribute it and/or modify
6    #   it under the terms of the GNU General Public License as published by
7    #   the Free Software Foundation; either version 2, or (at your option)
8    #   any later version.
9    #
10    #   This program is distributed in the hope that it will be useful,
11    #   but WITHOUT ANY WARRANTY; without even the implied warranty of
12    #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    #   GNU General Public License for more details.
14    #
15    #   You should have received a copy of the GNU General Public License
16    #   along with this program; if not, write to the Free Software
17    #   Foundation, Inc., 59 Temple Place - Suite 330,
18    #   Boston, MA 02111-1307, USA.
19    
20    # This script gives a test suite for the high-level interface of ASCEND via
21    # Python. It is also planned to be a wrapper for the CUnit test suite, although
22    # this is still experimental.
23    
24  import unittest  import unittest
25  import ascpy  import os, sys
26  import math  import math
 import os, subprocess, sys  
27  import atexit  import atexit
28  import cunit  
29    import platform
30    if platform.system() != "Windows":
31        import dl
32        sys.setdlopenflags(dl.RTLD_GLOBAL|dl.RTLD_NOW)
33    
34  class Ascend(unittest.TestCase):  class Ascend(unittest.TestCase):
35    
# Line 16  class Ascend(unittest.TestCase): Line 41  class Ascend(unittest.TestCase):
41          self.L.clear()          self.L.clear()
42          del self.L          del self.L
43    
44    class AscendSelfTester(Ascend):
45    
46        def _run(self,modelname,solvername="QRSlv",filename=None):
47            if filename==None:
48                filename = 'johnpye/%s.a4c' % modelname
49            self.L.load(filename)
50            T = self.L.findType(modelname)
51            M = T.getSimulation('sim')
52            M.build()
53            M.solve(ascpy.Solver(solvername),ascpy.SolverReporter())    
54            M.run(T.getMethod('self_test'))
55            return M
56    
57  class TestCompiler(Ascend):  class TestCompiler(Ascend):
58    
59      def testloading(self):      def testloading(self):
# Line 27  class TestCompiler(Ascend): Line 65  class TestCompiler(Ascend):
65      def testatomsa4l(self):      def testatomsa4l(self):
66          self.L.load('atoms.a4l')          self.L.load('atoms.a4l')
67    
68  class TestSolver(Ascend):  class TestSolver(AscendSelfTester):
69            
     def _run(self,modelname,solvername="QRSlv",filename=None):  
         if filename==None:  
             filename = 'johnpye/%s.a4c' % modelname  
         self.L.load(filename)  
         T = self.L.findType(modelname)  
         M = T.getSimulation('sim')  
         M.build()  
         M.solve(ascpy.Solver(solvername),ascpy.SolverReporter())      
         M.run(T.getMethod('self_test'))  
   
70      def testlog10(self):      def testlog10(self):
71          self._run('testlog10')          self._run('testlog10')
72    
# Line 66  class TestSolver(Ascend): Line 94  class TestSolver(Ascend):
94      def testsunpos6(self):      def testsunpos6(self):
95          self._run('example_1_8_1',"QRSlv","johnpye/sunpos.a4c")          self._run('example_1_8_1',"QRSlv","johnpye/sunpos.a4c")
96    
97        def testinstanceas(self):
98            M = self._run('example_1_6_1',"QRSlv","johnpye/sunpos.a4c")
99            self.assertAlmostEqual( float(M.t_solar), M.t_solar.as("s"))
100            self.assertAlmostEqual( float(M.t_solar)/3600, M.t_solar.as("h"))
101    
102  class TestIntegrator(Ascend):  class TestIntegrator(Ascend):
103    
104      def testListIntegrators(self):      def testListIntegrators(self):
# Line 209  class TestLSODE(Ascend): Line 242  class TestLSODE(Ascend):
242          assert abs(M.F - 21.36) < 0.1          assert abs(M.F - 21.36) < 0.1
243    
244  #-------------------------------------------------------------------------------  #-------------------------------------------------------------------------------
245  # Testing of a simple external function  # Testing of a external blackbox functions
246    
247    class TestBlackBox(AscendSelfTester):
248        def testparsefail0(self):
249            try:
250                self.L.load('test/blackbox/parsefail0.a4c')
251                self.fail("parsefail0 should not have loaded without errors")
252            except:
253                pass
254    
255        def testparsefail1(self):
256            try:
257                self.L.load('test/blackbox/parsefail1.a4c')
258                self.fail("parsefail1 should not have loaded without errors")
259            except:
260                pass
261    
262        def testparsefail2(self):
263            try:
264                self.L.load('test/blackbox/parsefail2.a4c')
265                self.fail("parsefail2 should not have loaded without errors")
266            except:
267                pass
268    
269        def testparsefail3(self):
270            try:
271                self.L.load('test/blackbox/parsefail3.a4c')
272                self.fail("parsefail3 should not have loaded without errors")
273            except:
274                pass
275    
276        def testparsefail4(self):
277            try:
278                self.L.load('test/blackbox/parsefail4.a4c')
279                self.fail("parsefail4 should not have loaded")
280            except:
281                pass
282    
283        def testfail1(self):
284            """Mismatched arg counts check-- tests bbox, not ascend."""
285            self.L.load('test/blackbox/fail1.a4c')
286            try:
287                M = self.L.findType('fail1').getSimulation('sim')
288                self.fail("expected exception was not raised")
289            except RuntimeError,e:
290                print "Caught exception '%s', assumed ok" % e
291    
292        def testfail2(self):
293            """Incorrect data arg check -- tests bbox, not ascend"""
294            self.L.load('test/blackbox/fail2.a4c')
295            try:
296                M = self.L.findType('fail2').getSimulation('sim')
297                self.fail("expected exception was not raised")
298            except RuntimeError,e:
299                print "Caught exception '%s', assumed ok (should mention errors during instantiation)" % e
300    
301        def testpass1(self):
302            """simple single bbox forward solve"""
303            M = self._run('pass1',filename='test/blackbox/pass.a4c')
304    
305        def testpass2(self):
306            """simple single bbox reverse solve"""
307            M = self._run('pass2',filename='test/blackbox/pass.a4c')
308    
309        def testpass3(self):
310            """simple double bbox solve"""
311            M = self._run('pass3',filename='test/blackbox/pass3.a4c')
312    
313        def testpass4(self):
314            """simple double bbox reverse solve"""
315            M = self._run('pass4',filename='test/blackbox/pass3.a4c')
316    
317        def testpass5(self):
318            M = self._run('pass5',filename='test/blackbox/pass5.a4c')
319    
320        def testpass6(self):
321            M = self._run('pass6',filename='test/blackbox/pass5.a4c')
322    
323        def testpass7(self):
324            M = self._run('pass7',filename='test/blackbox/passmerge.a4c')
325    
326        def testpass8(self):
327            M = self._run('pass8',filename='test/blackbox/passmerge.a4c')
328    
329        def testpass9(self):
330            M = self._run('pass9',filename='test/blackbox/passmerge.a4c')
331    
332        def testpass10(self):
333            M = self._run('pass10',filename='test/blackbox/passmerge.a4c')
334    
335        def testpass11(self):
336            M = self._run('pass11',filename='test/blackbox/passmerge.a4c')
337    
338        def testpass12(self):
339            M = self._run('pass12',filename='test/blackbox/passmerge.a4c')
340    
341    # this test doesn't work: 'system is inconsistent' -- and structurally singular
342    #   def testpass13(self):
343    #       """cross-merged input/output solve"""
344    #       M = self._run('pass13',filename='test/blackbox/passmerge.a4c')
345    
346        def testpass14(self):
347            """cross-merged input/output reverse solve"""
348            M = self._run('pass14',filename='test/blackbox/passmerge.a4c')
349    
350        def testpass20(self):
351            M = self._run('pass20',filename='test/blackbox/passarray.a4c')
352    
353        def testparsefail21(self):
354            """dense array of black boxes wrong syntax"""
355            try:
356                self.L.load('test/blackbox/parsefail21.a4c')
357                self.fail("parsefail21 should not have loaded without errors")
358            except:
359                pass
360    
361        def testpass22(self):
362            M = self._run('pass22',filename='test/blackbox/passarray.a4c')
363    
364        def testpass23(self):
365            M = self._run('pass23',filename='test/blackbox/passarray.a4c')
366    
367        def testpass61(self):
368            M = self._run('pass61',filename='test/blackbox/reinstantiate.a4c')
369    
370        def testpass62(self):
371            M = self._run('pass62',filename='test/blackbox/reinstantiate.a4c')
372    
373        def testpass64(self):
374            M = self._run('pass64',filename='test/blackbox/reinstantiate.a4c')
375    
376        def testpass65(self):
377            M = self._run('pass65',filename='test/blackbox/reinstantiate.a4c')
378    
379  class TestExtFn(Ascend):      def testpass66(self):
380            M = self._run('pass66',filename='test/blackbox/reinstantiate.a4c')
381    
382        def testpass67(self):
383            M = self._run('pass67',filename='test/blackbox/reinstantiate.a4c')
384    
385    class TestExtFn(AscendSelfTester):
386      def testextfntest(self):      def testextfntest(self):
387          self.L.load('johnpye/extfn/extfntest.a4c')          M = self._run('extfntest',filename='johnpye/extfn/extfntest.a4c')
388          M = self.L.findType('extfntest').getSimulation('sim')          self.assertAlmostEqual(M.y, 2);
389          M.build()          self.assertAlmostEqual(M.x, 1);
         M.solve(ascpy.Solver('QRSlv'),ascpy.SolverReporter())  
         print "y = %f" % M.y  
         print "x = %f" % M.x  
         self.assertAlmostEqual(M.y, 1);  
         self.assertAlmostEqual(M.x, 0);  
390          self.assertAlmostEqual(M.y, M.x + 1);          self.assertAlmostEqual(M.y, M.x + 1);
391    
392        def testextrelfor(self):
393            M = self._run('extrelfor',filename='johnpye/extfn/extrelfor.a4c')
394    
395    ## @TODO fix bug with badly-named bbox rel in a loop (Ben, maybe)
396    #   def testextrelforbadnaming(self):
397    #       self.L.load('johnpye/extfn/extrelforbadnaming.a4c')
398    #       T = self.L.findType('extrelfor')
399    #       M = T.getSimulation('sim')
400    #       M.solve(ascpy.Solver('QRSlv'),ascpy.SolverReporter())
401    #       print "x[1] = %f" % M.x[1]
402    #       print "x[2] = %f" % M.x[2]
403    #       print "x[3] = %f" % M.x[3]
404    #       print "x[4] = %f" % M.x[4]
405    #       print "x[5] = %f" % M.x[5]
406    #       M.run(T.getMethod('self_test'))
407    
408        def testextrelrepeat(self):
409            M = self._run('extrelrepeat',filename='johnpye/extfn/extrelrepeat.a4c')
410    
411    #-------------------------------------------------------------------------------
412    # Testing of a ExtPy - external python methods
413    
414    class TestExtPy(AscendSelfTester):
415        def test1(self):
416            self.L.load('johnpye/extpy/extpytest.a4c')
417            T = self.L.findType('extpytest')
418            M = T.getSimulation('sim')
419            M.run(T.getMethod('self_test'))
420            
421        def test2(self):
422            self.L.load('johnpye/extpy/extpytest.a4c')
423            T = self.L.findType('extpytest')
424            M = T.getSimulation('sim')
425            M.run(T.getMethod('pythonthing'))
426            M.run(T.getMethod('pythonthing'))
427            M.run(T.getMethod('pythonthing'))
428            M.run(T.getMethod('pythonthing'))
429            # causes crash!
430    
431    #-------------------------------------------------------------------------------
432    # Testing of saturated steam properties library (iapwssatprops.a4c)
433    
434    class TestSteam(AscendSelfTester):
435        def testiapwssatprops1(self):
436            M = self._run('testiapwssatprops1',filename='steam/iapwssatprops.a4c')
437        def testiapwssatprops2(self):
438            M = self._run('testiapwssatprops2',filename='steam/iapwssatprops.a4c')
439        def testiapwssatprops3(self):
440            M = self._run('testiapwssatprops3',filename='steam/iapwssatprops.a4c')
441        def testsatsteamstream(self):
442            M = self._run('satsteamstream',filename='steam/satsteamstream.a4c')
443    
444        def testsatsteamstream(self):
445            M = self._run('satsteamstream',filename='steam/satsteamstream.a4c')
446    
447    ## @TODO fix error capture from bounds checking during initialisation
448    #   def testiapwssat1(self):
449    #       M = self._run('testiapwssat1',filename='steam/iapwssat.a4c')
450    
451    # @TODO fix bug with unpivoted node[i].hg_expr eqns.
452        def testdsgsat(self):
453            self.L.load('steam/dsgsat2.a4c')
454            T = self.L.findType('dsgsat2')
455            M = T.getSimulation('sim',False)
456            try:
457                M.run(T.getMethod('on_load'))
458            except:
459                pass
460            M.solve(ascpy.Solver('QRSlv'),ascpy.SolverReporter())
461            M.run(T.getMethod('fixed_states'))
462            I = ascpy.Integrator(M)
463            I.setEngine('LSODE')
464            I.setReporter(ascpy.IntegratorReporterConsole(I))
465            I.setReporter(ascpy.IntegratorReporterConsole(I))
466            I.setLinearTimesteps(ascpy.Units("s"), 0, 5, 100)
467            I.setMinSubStep(0.01)
468            I.setMaxSubStep(0.02)
469            I.setInitialSubStep(0.1)
470            I.analyse()
471            I.solve()
472            I.solve()
473            #M.checkStructuralSingularity() causes crash!
474            
475  #-------------------------------------------------------------------------------  #-------------------------------------------------------------------------------
476  # Testing of freesteam external steam properties functions  # Testing of freesteam external steam properties functions
477    
478    with_freesteam = True
479  try:  try:
480        # we assume that if the freesteam python module is installed, the ASCEND
481        # external library will also be.
482      import freesteam      import freesteam
483      have_freesteam = True      have_freesteam = True
484  except ImportError,e:  except ImportError,e:
485      have_freesteam = False      have_freesteam = False
486    
487  if have_freesteam:  if with_freesteam and have_freesteam:
488      class TestFreesteam(Ascend):      class TestFreesteam(AscendSelfTester):
489            def testfreesteamtest(self):
490                """run the self-test cases bundled with freesteam"""
491                self._run('testfreesteam',filename='testfreesteam.a4c')
492    
493          def testload(self):          def testload(self):
494                """check that we can load 'thermalequilibrium2' (IMPORT "freesteam", etc)"""
495              self.L.load('johnpye/thermalequilibrium2.a4c')              self.L.load('johnpye/thermalequilibrium2.a4c')
496    
497          def testinstantiate(self):          def testinstantiate(self):
498                """load an instantiate 'thermalequilibrium2'"""
499              self.testload()              self.testload()
500              M = self.L.findType('thermalequilibrium2').getSimulation('sim')              M = self.L.findType('thermalequilibrium2').getSimulation('sim')
501                return M
502    
503          def testsolve(self):          def testintegrate(self):
504              self.testinstantiate()              """integrate transfer of heat from one mass of water/steam to another
505                according to Newton's law of cooling"""
506                M = self.testinstantiate()
507              M.setSolver(ascpy.Solver("QRSlv"))              M.setSolver(ascpy.Solver("QRSlv"))
508              #I = ascpy.Integrator(M)              I = ascpy.Integrator(M)
509              #I.setEngine('LSODE')              I.setEngine('LSODE')
510              #I.setReporter(ascpy.IntegratorReporterConsole(I))              I.setReporter(ascpy.IntegratorReporterConsole(I))
511              #I.setLinearTimesteps(ascpy.Units("s"), 0, 3000, 30)              I.setLinearTimesteps(ascpy.Units("s"), 0, 3000, 30)
512              #I.setMinSubStep(0.01)              I.setMinSubStep(0.01)
513              #I.setInitialSubStep(0.1)              I.setInitialSubStep(1)
514              #I.analyse()              I.analyse()
515              #print "Number of vars = %d" % I.getNumVars()              print "Number of vars = %d" % I.getNumVars()
516              #assert I.getNumVars()==2              assert I.getNumVars()==2
517              #I.solve()              I.solve()
518              #assert I.getNumObservedVars() == 3;              assert I.getNumObservedVars() == 3;
519              #assert abs(M.R - 832) < 1.0              print "S[1].T = %f K" % M.S[1].T
520              #assert abs(M.F - 21.36) < 0.1              print "S[2].T = %f K" % M.S[2].T
521                print "Q = %f W" % M.Q      
522                self.assertAlmostEqual(float(M.S[1].T),506.77225109,5);
523                self.assertAlmostEqual(float(M.S[2].T),511.605173967,5);
524                self.assertAlmostEqual(float(M.Q),-48.32922877329,3);
525                self.assertAlmostEqual(float(M.t),3000);
526                print "Note that the above values have not been verified analytically"
527    
528  #-------------------------------------------------------------------------------  #-------------------------------------------------------------------------------
529  # Testing of IDA models using DENSE linear solver  # Testing of IDA models using DENSE linear solver
# Line 288  class TestIDADENSE(Ascend): Line 554  class TestIDADENSE(Ascend):
554          print "v = %f" % M.v          print "v = %f" % M.v
555          M.run(T.getMethod('self_test'))          M.run(T.getMethod('self_test'))
556    
557      def testlotkaDENSE(self):      def testlotka(self):
558          self.L.load('johnpye/lotka.a4c')          self.L.load('johnpye/lotka.a4c')
559          M = self.L.findType('lotka').getSimulation('sim')          M = self.L.findType('lotka').getSimulation('sim')
560          M.setSolver(ascpy.Solver("QRSlv"))          M.setSolver(ascpy.Solver("QRSlv"))
# Line 307  class TestIDADENSE(Ascend): Line 573  class TestIDADENSE(Ascend):
573          assert abs(M.F - 21.36) < 0.1          assert abs(M.F - 21.36) < 0.1
574                    
575      def testdenx(self):      def testdenx(self):
576            print "-----------------------------====="
577          self.L.load('johnpye/idadenx.a4c')          self.L.load('johnpye/idadenx.a4c')
578          M = self.L.findType('idadenx').getSimulation('sim')          M = self.L.findType('idadenx').getSimulation('sim')
579          M.setSolver(ascpy.Solver("QRSlv"))          M.setSolver(ascpy.Solver("QRSlv"))
580          I = ascpy.Integrator(M)          I = ascpy.Integrator(M)
581          I.setEngine('IDA')          I.setEngine('IDA')
582          I.setParameter('calcic','NONE')          I.setParameter('calcic','YA_YPD')
583          I.setParameter('linsolver','DENSE')          I.setParameter('linsolver','DENSE')
584          I.setReporter(ascpy.IntegratorReporterConsole(I))          I.setReporter(ascpy.IntegratorReporterConsole(I))
585          I.setLogTimesteps(ascpy.Units("s"), 0.4, 4e10, 11)          I.setLogTimesteps(ascpy.Units("s"), 0.4, 4e10, 11)
# Line 326  class TestIDADENSE(Ascend): Line 593  class TestIDADENSE(Ascend):
593          assert abs(float(M.y2) - 2.0437e-13) < 2e-14          assert abs(float(M.y2) - 2.0437e-13) < 2e-14
594          assert abs(float(M.y3) - 1.0) < 1e-5          assert abs(float(M.y3) - 1.0) < 1e-5
595    
596      def testkryxDENSE(self):  ## @TODO fails during IDACalcIC (model too big?)
597          self.L.load('johnpye/idakryx.a4c')  #   def testkryx(self):
598          M = self.L.findType('idakryx').getSimulation('sim')  #       self.L.load('johnpye/idakryx.a4c')
599          M.setSolver(ascpy.Solver('QRSlv'))  #       ascpy.getCompiler().setUseRelationSharing(False)
600          M.build()  #       M = self.L.findType('idakryx').getSimulation('sim')
601          I = ascpy.Integrator(M)  #       M.setSolver(ascpy.Solver('QRSlv'))
602          I.setEngine('IDA')  #       M.build()
603          I.setReporter(ascpy.IntegratorReporterConsole(I))  #       I = ascpy.Integrator(M)
604          I.setParameter('linsolver','DENSE')  #       I.setEngine('IDA')
605          I.setParameter('maxl',8)  #       I.setReporter(ascpy.IntegratorReporterConsole(I))
606          I.setParameter('gsmodified',False)  #       I.setParameter('linsolver','DENSE')
607          I.setParameter('autodiff',True)  #       I.setParameter('maxl',8)
608          I.setParameter('rtol',0)  #       I.setParameter('gsmodified',False)
609          I.setParameter('atol',1e-3);  #       I.setParameter('autodiff',True)
610          I.setParameter('atolvect',False)  #       I.setParameter('rtol',0)
611          I.setParameter('calcic','YA_YDP')  #       I.setParameter('atol',1e-3);
612          I.analyse()  #       I.setParameter('atolvect',False)
613          I.setLogTimesteps(ascpy.Units("s"), 0.01, 10.24, 11)  #       I.setParameter('calcic','YA_YDP')
614          I.solve()  #       I.analyse()
615          assert abs(M.u[2][2].getValue()) < 1e-5  #       I.setLogTimesteps(ascpy.Units("s"), 0.01, 10.24, 11)
616    #       I.solve()
617    #       assert abs(M.u[2][2].getValue()) < 1e-5
618            
619  #-------------------------------------------------------------------------------  #-------------------------------------------------------------------------------
620  # Testing of IDA models using SPGMR linear solver (Krylov)  # Testing of IDA models using SPGMR linear solver (Krylov)
# Line 437  class NotToBeTested: Line 706  class NotToBeTested:
706          pass          pass
707    
708  if __name__=='__main__':  if __name__=='__main__':
709        # a whole bag of tricks to make sure we get the necessary dirs in our ascend, python and ld path vars
710        restart = 0
711    
712        if platform.system()=="Windows":
713            LD_LIBRARY_PATTH="PATH"
714            SEP = ";"
715        else:
716            LD_LIBRARY_PATH="LD_LIBRARY_PATH"
717            SEP = ":"
718    
719        modelsdir = os.path.normpath(os.path.join(sys.path[0],"models"))
720        if not os.environ.get('ASCENDLIBRARY'):
721            os.environ['ASCENDLIBRARY'] = modelsdir
722            restart = 1
723        else:
724            envmodelsdir = [os.path.abspath(i) for i in os.environ['ASCENDLIBRARY'].split(SEP)]
725            if modelsdir not in envmodelsdir:
726                envmodelsdir.insert(0,modelsdir)
727                os.environ['ASCENDLIBRARY']=SEP.join(envmodelsdir)
728                restart = 1    
729    
730        libdirs = ["pygtk","."]
731        libdirs = [os.path.normpath(os.path.join(sys.path[0],l)) for l in libdirs]
732        if not os.environ.get(LD_LIBRARY_PATH):
733            os.environ[LD_LIBRARY_PATH]=SEP.join(libdirs)
734            restart = 1
735        else:
736            envlibdirs = [os.path.normpath(i) for i in os.environ[LD_LIBRARY_PATH].split(SEP)]
737            for l in libdirs:
738                if l in envlibdirs[len(libdirs):]:
739                    envlibdirs.remove(l)
740                    restart = 1
741            for l in libdirs:
742                if l not in envlibdirs:
743                    envlibdirs.insert(0,l)
744                    restart = 1    
745            os.environ[LD_LIBRARY_PATH] = SEP.join(envlibdirs)
746    
747        pypath = os.path.normpath(os.path.join(sys.path[0],"pygtk"))
748        if not os.environ.get('PYTHONPATH'):
749            os.environ['PYTHONPATH']=pypath
750        else:
751            envpypath = os.environ['PYTHONPATH'].split(SEP)
752            if pypath not in envpypath:
753                envpypath.insert(0,pypath)
754                os.environ['PYTHONPATH']=envpypath
755                restart = 1
756    
757        if restart:
758            script = os.path.join(sys.path[0],"test.py")
759            print "Restarting"
760            print "LD_LIBRARY_PATH = %s" % os.environ.get(LD_LIBRARY_PATH)
761            print "PYTHONPATH = %s" % os.environ.get('PYTHONPATH')
762            print "ASCENDLIBRARY = %s" % os.environ.get('ASCENDLIBRARY')
763            os.execvp("python",[script] + sys.argv)
764    
765        import ascpy
766    
767        try:
768            import cunit
769        except:
770            pass
771    
772      atexit.register(ascpy.shutdown)      atexit.register(ascpy.shutdown)
773      #suite = unittest.TestSuite()      #suite = unittest.TestSuite()
774      #suite = unittest.defaultTestLoader.loadTestsFromName('__main__')      #suite = unittest.defaultTestLoader.loadTestsFromName('__main__')

Legend:
Removed from v.1022  
changed lines
  Added in v.1118

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22