Skip to content

Commit 9b6a823

Browse files
TallJimboroceb
authored andcommitted
Add --no-tests option to skip building and running all tests.
1 parent 3bdf4f4 commit 9b6a823

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

python/lsst/sconsUtils/scripts.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import warnings
1010
from stat import ST_MODE
1111

12-
from SCons.Script import BUILD_TARGETS, Dir, File, Glob, SConscript
12+
from SCons.Script import BUILD_TARGETS, Dir, File, GetOption, Glob, SConscript
1313

1414
from . import dependencies, state, tests, utils
1515

@@ -613,6 +613,8 @@ def tests(
613613
result : ???
614614
???
615615
"""
616+
if GetOption("no_tests"):
617+
return []
616618
if noBuildList is None:
617619
noBuildList = []
618620
if pySingles is None:

python/lsst/sconsUtils/state.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,16 @@ def _initOptions():
119119
default=False,
120120
help="Do not use EUPS for configuration",
121121
)
122+
SCons.Script.AddOption(
123+
"--no-tests",
124+
dest="no_tests",
125+
action="store_true",
126+
default=False,
127+
help=(
128+
"Do not build or run tests (by clearing the 'tests' target). "
129+
"Library targets in the test directory may still be built."
130+
),
131+
)
122132

123133

124134
def _initLog():

0 commit comments

Comments
 (0)