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.6 by schorsch, Mon Jan 8 13:38:37 2018 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines