[SCons] Fix test summary when tests are run in parallel
This commit is contained in:
parent
be24e9daf1
commit
c446686c85
3 changed files with 7 additions and 8 deletions
|
|
@ -1636,6 +1636,7 @@ if 'msi' in COMMAND_LINE_TARGETS:
|
|||
### Tests ###
|
||||
if any(target.startswith('test') for target in COMMAND_LINE_TARGETS):
|
||||
env['testNames'] = []
|
||||
env['test_results'] = env.Command('test_results', [], testResults.printReport)
|
||||
|
||||
# Tests written using the gtest framework, the Python unittest module,
|
||||
# or the Matlab xunit package.
|
||||
|
|
@ -1651,6 +1652,8 @@ if any(target.startswith('test') for target in COMMAND_LINE_TARGETS):
|
|||
print 'test-%s' % name
|
||||
sys.exit(0)
|
||||
|
||||
Alias('test', env['test_results'])
|
||||
|
||||
### Dump (debugging SCons)
|
||||
if 'dump' in COMMAND_LINE_TARGETS:
|
||||
import pprint
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ def addTestProgram(subdir, progName, env_vars={}):
|
|||
testResults.tests[passedFile.name] = program
|
||||
run_program = testenv.Command(passedFile, program, gtestRunner)
|
||||
env.Depends(run_program, testenv.get('cantera_shlib', ()))
|
||||
Alias('test', run_program)
|
||||
env.Depends(env['test_results'], run_program)
|
||||
Alias('test-%s' % progName, run_program)
|
||||
env['testNames'].append(progName)
|
||||
if os.path.exists(passedFile.abspath):
|
||||
|
|
@ -145,7 +145,7 @@ def addPythonTest(testname, subdir, script, interpreter, outfile,
|
|||
dep = File(pjoin(subdir, dep))
|
||||
testenv.Depends(run_program, dep)
|
||||
if not optional:
|
||||
Alias('test', run_program)
|
||||
testenv.Depends(env['test_results'], run_program)
|
||||
testResults.tests[passedFile.name] = True
|
||||
if os.path.exists(passedFile.abspath):
|
||||
Alias('test-reset', testenv.Command('reset-%s%s' % (subdir, testname),
|
||||
|
|
@ -198,7 +198,7 @@ def addMatlabTest(script, testName, dependencies=None, env_vars=()):
|
|||
dep = File(pjoin('matlab', dep))
|
||||
testenv.Depends(run_program, dep)
|
||||
|
||||
Alias('test', run_program)
|
||||
testenv.Depends(testenv['test_results'], run_program)
|
||||
if os.path.exists(passedFile.abspath):
|
||||
Alias('test-reset', testenv.Command('reset-%s%s' % ('matlab', script),
|
||||
[], [Delete(passedFile.abspath)]))
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ class Test(object):
|
|||
|
||||
testResults.tests[self.testName] = self
|
||||
run = self.run(localenv)
|
||||
localenv.Alias('test-run', run)
|
||||
localenv.Depends(env['test_results'], run)
|
||||
localenv.Alias('test-clean', self.clean(localenv))
|
||||
localenv.Alias('test-%s' % self.testName, run)
|
||||
env['testNames'].append(self.testName)
|
||||
|
|
@ -281,10 +281,6 @@ CompileAndTest('VCS-LiSi', 'VCSnonideal/LatticeSolid_LiSi',
|
|||
artifacts=['vcs_equilibrate_res.csv'])
|
||||
CompileAndTest('VPsilane_test', 'VPsilane_test', 'VPsilane_test', 'output_blessed.txt')
|
||||
|
||||
finish_tests = localenv.Command('finish_tests', [], testResults.printReport)
|
||||
localenv.Depends(finish_tests, 'test-run')
|
||||
Alias('test', finish_tests)
|
||||
|
||||
# Force explicitly-named tests to run even if SCons thinks they're up to date
|
||||
for command in COMMAND_LINE_TARGETS:
|
||||
if command.startswith('test-'):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue