Fix handling of some global variables and clear them properly

- move make_timeout to global and add it to clear_lists()
- add _modified_files and building_base to clear_lists()

This is needed to run tests that include prepare().
This commit is contained in:
Ralph Lange
2022-07-22 10:14:35 +02:00
parent d36800b2e0
commit 22b2e3f796
2 changed files with 4 additions and 3 deletions

View File

@@ -702,7 +702,6 @@ class TestAppveyorDetectContext(unittest.TestCase):
class TestSetupForBuild(unittest.TestCase):
args = Namespace(paths=[])
cue.building_base = True
if ci_os == 'windows':
choco_installs = ['make']
if ci_service != 'appveyor':
@@ -710,6 +709,7 @@ class TestSetupForBuild(unittest.TestCase):
sp.check_call(['choco', 'install', '-ry'] + choco_installs)
def setUp(self):
cue.building_base = True
if ci_service == 'appveyor':
os.environ['CONFIGURATION'] = 'default'
cue.detect_context()

5
cue.py
View File

@@ -163,6 +163,7 @@ modules_to_compile = []
setup = {}
places = {}
extra_makeargs = []
make_timeout = 0.
is_base314 = False
is_make3 = False
@@ -185,6 +186,8 @@ def clear_lists():
has_test_results = False
silent_dep_builds = True
do_recompile = False
building_base = False
_modified_files = set()
ci['service'] = '<none>'
ci['os'] = '<unknown>'
ci['platform'] = '<unknown>'
@@ -205,8 +208,6 @@ clear_lists()
if 'BASE' in os.environ and os.environ['BASE'] == 'SELF':
building_base = True
places['EPICS_BASE'] = curdir
else:
building_base = False
# Setup ANSI Colors
ANSI_RED = "\033[31;1m"