build-and-test: Make it possible to customize test suite run
Allow the user to pass flags to LNT when running the test-suite.
Change-Id: Idb66ac25934281613f6392750b38d5c53f99761a
diff --git a/scripts/llvm.py b/scripts/llvm.py
index bdeae85..8d9a4c1 100644
--- a/scripts/llvm.py
+++ b/scripts/llvm.py
@@ -206,6 +206,7 @@
enableTestSuite = args.enableTestSuite
sandboxDir = args.sandbox
+ testSuiteFlags = args.testSuiteFlags
if dryRun:
consumer = CommandPrinter()
@@ -266,7 +267,7 @@
lit = os.path.join(testedBuildDir, "bin", "llvm-lit")
clang = os.path.join(testedBuildDir, "bin", "clang")
run_test_suite(consumer, sandboxDir, testSuiteDir, lit,
- ["--cc={}".format(clang)])
+ ["--cc={}".format(clang)] + testSuiteFlags)
except RuntimeError as exc:
die("Failed because:\n{}".format(str(exc)))
@@ -567,6 +568,15 @@
"--sandbox",
help="Path to the sandbox where the test-suite should be setup.")
buildAndTest.add_argument(
+ '--lnt-flag',
+ dest='testSuiteFlags',
+ metavar='FLAG',
+ default=[],
+ action='append',
+ help="Additional flags to be passed to LNT when running the test-suite."
+ "May be passed several times. If your flag starts with a '-', use "
+ "'--lnt-flag=-FLAG' to pass it.")
+buildAndTest.add_argument(
'-n', '--dry-run',
dest='dry',
action='store_true',