ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/test/run_tests.py
(Generate patch)

Comparing ray/test/run_tests.py (file contents):
Revision 1.3 by schorsch, Mon Mar 28 17:48:43 2016 UTC vs.
Revision 1.5 by schorsch, Sat Apr 2 15:57:24 2016 UTC

# Line 16 | Line 16 | import argparse
16   import unittest
17  
18   SHORTPROGN = os.path.splitext(os.path.basename(sys.argv[0]))[0]
19 < TESTCATS = ('cal','cv','gen','hd','meta','ot','px', 'rt','util',)
19 > TESTCATS = ('pyrad','cal','cv','gen','hd','meta','ot','px', 'rt','util',)
20  
21   class Error(Exception): pass
22  
# Line 26 | Line 26 | class RadianceTests():
26          This class will create a virtual module "testsupport" with constants
27          and functions for use in individual test cases.
28  
29 <        testsupport.bindir   - list of paths added to PATH
30 <        testsupport.path     - complete list of paths currently in PATH
31 <        testsupport.radlib   - list of paths added to RAYPATH
32 <        testsupport.raypath  - complete list of paths currently in RAYPATH
33 <        testsupport.pyradlib - absolute path of python support library directory
34 <        testsupport.datadir  - absolute path of test data directory
35 <        testsupport.datafile([sub, [sub,]] fn) - return absolute file path in
29 >          bindir   - list of paths added to PATH
30 >          path     - complete list of paths currently in PATH
31 >          radlib   - list of paths added to RAYPATH
32 >          raypath  - complete list of paths currently in RAYPATH
33 >          pyradlib - absolute path of python support library directory
34 >          datadir  - absolute path of test data directory
35 >          datafile([sub, [sub,]] fn) - return absolute file path in
36                  data directory or in a subdirectory
37          '''
38          def __init__(self, **args):
# Line 67 | Line 67 | class RadianceTests():
67                          oldraypath = old_osenv.get('RAYPATH', '')
68                          raypathlist = oldraypath.split(os.pathsep)
69                          if self.radlib:
70 <                                for rlib in self.radlib:
70 >                                for rlib in self.radlib + ['.']:
71                                          if rlib not in raypathlist:
72                                                  raypathlist.insert(0, rlib)
73                                  os.environ['RAYPATH'] = os.pathsep.join(raypathlist)
# Line 75 | Line 75 | class RadianceTests():
75                          pyradlib = None
76                          for rp in raypathlist:
77                                  prd = os.path.join(rp, 'pyradlib')
78                                #print(prd)
78                                  if os.path.isdir(prd) or os.path.islink(prd):
80                                        #print('--- found !!!')
79                                          if rp not in sys.path:
80                                                  sys.path.insert(0, rp)
81                                          pyradlib = prd
# Line 117 | Line 115 | class RadianceTests():
115                          fulldir = os.path.join(self.testdir, dir)
116                          if not os.path.isdir(fulldir):
117                                  raise Error('No such directory: "%s"' % fulldir)
118 <                        suite = loader.discover(fulldir, 'test*.py',
118 >                        suite = loader.discover(fulldir, 'test_*.py',
119                                          top_level_dir=self.thisdir)
120                          count = suite.countTestCases()
121                          if count:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines