Add skip_dep_builds flag to suppress dependency builds

To allow unit tests suppressing the build of
dependencies when using the prepare() function.
This commit is contained in:
Ralph Lange
2022-07-22 10:29:22 +02:00
parent 22b2e3f796
commit af1ecbabae
2 changed files with 5 additions and 1 deletions

View File

@@ -67,6 +67,8 @@ import cue
# we're working with tags (detached heads) a lot: suppress advice # we're working with tags (detached heads) a lot: suppress advice
cue.call_git(['config', '--global', 'advice.detachedHead', 'false']) cue.call_git(['config', '--global', 'advice.detachedHead', 'false'])
# Don't build dependencies when running unit tests
cue.skip_dep_builds = True
class TestSourceSet(unittest.TestCase): class TestSourceSet(unittest.TestCase):

4
cue.py
View File

@@ -169,6 +169,7 @@ is_base314 = False
is_make3 = False is_make3 = False
has_test_results = False has_test_results = False
silent_dep_builds = True silent_dep_builds = True
skip_dep_builds = False
do_recompile = False do_recompile = False
installed_7z = False installed_7z = False
@@ -207,6 +208,7 @@ clear_lists()
if 'BASE' in os.environ and os.environ['BASE'] == 'SELF': if 'BASE' in os.environ and os.environ['BASE'] == 'SELF':
building_base = True building_base = True
skip_dep_builds = True
places['EPICS_BASE'] = curdir places['EPICS_BASE'] = curdir
# Setup ANSI Colors # Setup ANSI Colors
@@ -1245,7 +1247,7 @@ PERL = C:/Strawberry/perl/bin/perl -CSD'''
if logging.getLogger().isEnabledFor(logging.DEBUG): if logging.getLogger().isEnabledFor(logging.DEBUG):
log_modified() log_modified()
if not building_base: if not skip_dep_builds:
fold_start('build.dependencies', 'Build missing/outdated dependencies') fold_start('build.dependencies', 'Build missing/outdated dependencies')
for mod in modules_to_compile: for mod in modules_to_compile:
place = places[setup[mod + "_VARNAME"]] place = places[setup[mod + "_VARNAME"]]