aboutsummaryrefslogtreecommitdiff
path: root/tests/cli/testbuildandtest.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cli/testbuildandtest.py')
-rw-r--r--tests/cli/testbuildandtest.py50
1 files changed, 49 insertions, 1 deletions
diff --git a/tests/cli/testbuildandtest.py b/tests/cli/testbuildandtest.py
index f7996ad..86e2203 100644
--- a/tests/cli/testbuildandtest.py
+++ b/tests/cli/testbuildandtest.py
@@ -76,7 +76,7 @@ class Testllvmbuildandtest(LLVMTestCase):
"{build}\$ ninja -j8 check-all".format(build=buildDir))
- def test_stage1_and_testsuite(self):
+ def test_stage1_and_default_testsuite(self):
"""
Test that we dump the correct commands for a single stage build of LLVM
and a run of the test-suite with the resulting compiler.
@@ -123,6 +123,54 @@ class Testllvmbuildandtest(LLVMTestCase):
"--use-lit={build}/bin/llvm-lit --cc={build}/bin/clang".format(
sandbox=sandboxDir, testsuite=testSuiteDir, build=buildDir))
+ def test_stage1_and_custom_testsuite(self):
+ """Test that we can add custom flags to our test-suite run."""
+ reposDir = "path-to-repos"
+ sourceDir = "path-to-sources"
+ buildDir = "path-to-stage1"
+ sandboxDir = "path-to-sandbox"
+
+ testSuiteDir = os.path.join(reposDir, "test-suite")
+ lntDir = os.path.join(reposDir, "lnt")
+
+ output = self.run_with_output(
+ self.llvm_build_and_test(
+ "--dry-run",
+ "--repos-dir", reposDir,
+ "--source-dir", sourceDir,
+ "--stage1-build-dir", buildDir,
+ "--enable-test-suite",
+ "--sandbox", sandboxDir,
+ "--lnt-flag=--threads=4",
+ "--lnt-flag=--cppflags",
+ "--lnt-flag", "'-mcpu=cortex-a15 -marm'"))
+
+ commands = output.splitlines()
+
+ self.assertRegex(commands[0],
+ "{build}\$ cmake -G Ninja .* {sources}".format(
+ build=buildDir, sources=sourceDir))
+
+ self.assertRegex(commands[1],
+ "{build}\$ ninja".format(build=buildDir))
+
+ self.assertRegex(
+ commands[2], ".*\$ virtualenv {sandbox}".format(sandbox=sandboxDir))
+
+ self.assertRegex(
+ commands[3],
+ ".*\$ {sandbox}/bin/python {lnt}/setup.py develop".format(
+ sandbox=sandboxDir,
+ lnt=lntDir))
+
+ self.assertRegex(
+ commands[4],
+ ".*\$ {sandbox}/bin/python {sandbox}/bin/lnt runtest test-suite "
+ "--sandbox={sandbox} --test-suite={testsuite} "
+ "--use-lit={build}/bin/llvm-lit --cc={build}/bin/clang "
+ "--threads=4 --cppflags '-mcpu=cortex-a15 -marm'".format(
+ sandbox=sandboxDir, testsuite=testSuiteDir, build=buildDir))
+
def test_default_stage2(self):
"""
Test that we dump the correct commands for a 2-stage build of LLVM.