mirror of
https://github.com/Cantera/cantera.git
synced 2026-08-04 18:33:33 -05:00
[SCons] Add option to pass flags to GTest
This commit is contained in:
@@ -590,6 +590,11 @@ config_options = [
|
||||
'VERBOSE',
|
||||
"""Create verbose output about what SCons is doing.""",
|
||||
False),
|
||||
(
|
||||
'gtest_flags',
|
||||
"""Additional options passed to each GTest test suite, e.g.
|
||||
'--gtest_filter=*pattern*'. Separate multiple options with spaces.""",
|
||||
''),
|
||||
BoolVariable(
|
||||
'renamed_shared_libraries',
|
||||
"""If this option is turned on, the shared libraries that are created
|
||||
|
||||
@@ -487,6 +487,12 @@ Options List
|
||||
|
||||
- default: ``'no'``
|
||||
|
||||
.. _gtest-flags:
|
||||
|
||||
* ``gtest_flags``: [ ``string`` ]
|
||||
Additional options passed to each GTest test suite, e.g.
|
||||
`--gtest_filter=*pattern*`. Separate multiple options with spaces.
|
||||
|
||||
.. _renamed-shared-libraries:
|
||||
|
||||
* ``renamed_shared_libraries``: [ ``yes`` | ``no`` ]
|
||||
|
||||
@@ -146,6 +146,7 @@ Less Common Options
|
||||
* :ref:`env_vars <env-vars>`
|
||||
* :ref:`layout <layout>`
|
||||
* :ref:`VERBOSE <VERBOSE>`
|
||||
* :ref:`gtest_flags <gtest-flags>`
|
||||
|
||||
.. _sec-build-commands:
|
||||
|
||||
|
||||
+3
-2
@@ -50,8 +50,9 @@ def addTestProgram(subdir, progName, env_vars={}):
|
||||
|
||||
if not os.path.isdir(workDir):
|
||||
os.mkdir(workDir)
|
||||
code = subprocess.call([program.abspath, '--gtest_output=xml:'+resultsFile],
|
||||
env=env['ENV'], cwd=workDir)
|
||||
cmd = [program.abspath, '--gtest_output=xml:'+resultsFile]
|
||||
cmd.extend(env['gtest_flags'].split())
|
||||
code = subprocess.call(cmd, env=env['ENV'], cwd=workDir)
|
||||
|
||||
if code:
|
||||
print "FAILED: Test '{0}' exited with code {1}".format(progName, code)
|
||||
|
||||
Reference in New Issue
Block a user