diff options
Diffstat (limited to 'tests/cli/testllvmpush.py')
-rw-r--r-- | tests/cli/testllvmpush.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/cli/testllvmpush.py b/tests/cli/testllvmpush.py index 1d9b8ab..a704185 100644 --- a/tests/cli/testllvmpush.py +++ b/tests/cli/testllvmpush.py @@ -87,6 +87,15 @@ class Testllvmpush(LLVMTestCase): with cd(repopath): cls.run_quietly(["git", "worktree", "prune"]) + def test_source_dir_ir_compulsory(self): + """Test that we get an error if we don't pass the source dir.""" + with self.assertRaises(subprocess.CalledProcessError) as context: + output = self.run_with_output(self.llvm_push()) + + self.assertRegex( + str(context.exception.output), + "(.*\n)*the following arguments are required: --source-dir(.*\n)*") + def test_push(self): with cd(self.llvm_src): self.create_dummy_commit("Test llvm push") @@ -101,7 +110,8 @@ class Testllvmpush(LLVMTestCase): with cd(worktreePath): self.create_dummy_commit("Test {} push".format(subproj)) - pushed = self.run_with_output(self.llvm_push()) + pushed = self.run_with_output( + self.llvm_push("--source-dir", self.llvm_src)) remote_branch = "linaro-local/{}/{}".format(self.user, self.branch) self.assertRegex( @@ -147,7 +157,8 @@ class Testllvmpush(LLVMTestCase): self.create_dummy_commit("Test {} push".format(subproj)) with self.assertRaises(subprocess.CalledProcessError) as context: - output = self.run_with_output(self.llvm_push()) + output = self.run_with_output( + self.llvm_push("--source-dir", self.llvm_src)) # Check that we error out because lld is on a different branch self.assertRegex(str(context.exception.output), |