summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/script_loader.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/script_loader.py b/test/script_loader.py
index 53de779..f527d9e 100644
--- a/test/script_loader.py
+++ b/test/script_loader.py
@@ -59,13 +59,16 @@ def load_script(path, code_to_add=None):
a dependency to be substituted by a mocked value.
"""
path = make_relative_path(path)
- key = f'{str(path)}:{code_to_add}' if code_to_add is not None else str(path)
+ key = (str(path), code_to_add)
if key in script_cache:
return script_cache[key]
+ append_flags = () if code_to_add is None else ('-A', ':'.join(key))
+
awk = subprocess.run(['awk', '-f', str(awk_script), '--', '-D', 'MOZILLA',
'-D', 'MV2', '-D', 'TEST', '-D', 'UNIT_TEST',
- '-D', 'DEBUG', '--output=amalgamate-js:' + key],
+ '-D', 'DEBUG', *append_flags,
+ '--output=amalgamate-js:' + str(path)],
stdout=subprocess.PIPE, cwd=script_root, check=True)
script = awk.stdout.decode()
script_cache[key] = script