From a991708beac9db42b2b3037648cdb192792c87b3 Mon Sep 17 00:00:00 2001 From: Douglas Winship Date: Mon, 3 Aug 2020 21:10:23 +0100 Subject: regression-test for ".bst" artifact checkout bug --- tests/frontend/buildcheckout.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/frontend/buildcheckout.py b/tests/frontend/buildcheckout.py index e613b4194..7c1f910b6 100644 --- a/tests/frontend/buildcheckout.py +++ b/tests/frontend/buildcheckout.py @@ -68,6 +68,30 @@ def test_build_checkout(datafiles, cli, strict, hardlinks): assert os.path.exists(filename) +@pytest.mark.datafiles(DATA_DIR) +def test_include_dot_bst_in_checkout_dirname(datafiles, cli): + # put '.bst' on the end of the checkout directory + # this is a regression test for a bug. The bug would + # remove '.bst' if it appeared at the end of of the + # "--directory" argument. + project = str(datafiles) + checkout = os.path.join(cli.directory, "checkout.bst") + + # build the artifact + result = cli.run(project=project, args=["--no-strict", "build", "target.bst"]) + result.assert_success() + + # checkout + result = cli.run(project=project, args=["artifact", "checkout", "target.bst", "--directory", checkout]) + result.assert_success() + + # check that the executable hello file is found in the checkout (ie + # confirm files were checked out to directory called "checkout.bst" + # (as expected) and not to a directory calld "checkout") + filename = os.path.join(checkout, "usr", "bin", "hello") + assert os.path.exists(filename) + + @pytest.mark.datafiles(DATA_DIR) def test_non_strict_build_strict_checkout(datafiles, cli): project = str(datafiles) -- cgit v1.2.1