scripts: unit-test: Constrain test setups to current project
self.package now reflects the top-level meson project name. Using this,
prevent incorrect propagation of configuration into subprojects using
the usual meson scope syntax.
Further, now that we're using the scope syntax, meson outputs a
different error message:
```
$ meson test --setup=stdplus:__likely_not_a_setup__ -C build __likely_not_a_test__
Unknown test setup 'stdplus:__likely_not_a_setup__'.
```
Adjust the regex that performs the setup error test.
Change-Id: Ia15c0406323f025fff318cb1c1e4a92605d19c96
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
diff --git a/scripts/unit-test.py b/scripts/unit-test.py
index 461e49a..e678a8c 100755
--- a/scripts/unit-test.py
+++ b/scripts/unit-test.py
@@ -991,7 +991,7 @@
"-C",
"build",
"--setup",
- setup,
+ "{}:{}".format(self.package, setup),
"__likely_not_a_test__",
],
stderr=subprocess.STDOUT,
@@ -999,7 +999,7 @@
except CalledProcessError as e:
output = e.output
output = output.decode("utf-8")
- return not re.search("Test setup .* not found from project", output)
+ return not re.search("Unknown test setup '[^']+'[.]", output)
def _maybe_valgrind(self):
"""
@@ -1021,7 +1021,7 @@
"build",
"--print-errorlogs",
"--setup",
- "valgrind",
+ "{}:valgrind".format(self.package),
)
else:
check_call_cmd(