diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/format/dependencies.py | 18 | ||||
-rw-r--r-- | tests/format/dependencies2/merge-separate-lists.bst | 8 | ||||
-rw-r--r-- | tests/format/dependencies2/merge-single-list.bst | 8 |
3 files changed, 34 insertions, 0 deletions
diff --git a/tests/format/dependencies.py b/tests/format/dependencies.py index 393f806ad..7f5de8684 100644 --- a/tests/format/dependencies.py +++ b/tests/format/dependencies.py @@ -232,3 +232,21 @@ def test_no_recurse(cli, datafiles): "dep-two.bst", "target.bst", ] + + +@pytest.mark.datafiles(DATA_DIR) +@pytest.mark.parametrize( + "target", ["merge-separate-lists.bst", "merge-single-list.bst",], ids=["separate-lists", "single-list"], +) +def test_merge(cli, datafiles, target): + project = os.path.join(str(datafiles), "dependencies2") + + # Test both build and run scopes, showing that the two dependencies + # have been merged and the run-build.bst is both a runtime and build + # time dependency, and is not loaded twice into the build graph. + # + element_list = cli.get_pipeline(project, [target], scope="build") + assert element_list == ["run-build.bst"] + + element_list = cli.get_pipeline(project, [target], scope="run") + assert element_list == ["run-build.bst", target] diff --git a/tests/format/dependencies2/merge-separate-lists.bst b/tests/format/dependencies2/merge-separate-lists.bst new file mode 100644 index 000000000..5be04d7a1 --- /dev/null +++ b/tests/format/dependencies2/merge-separate-lists.bst @@ -0,0 +1,8 @@ +kind: autotools +description: Depend on the same element twice, as a build and as a runtime dependency + +build-depends: +- run-build.bst + +runtime-depends: +- run-build.bst diff --git a/tests/format/dependencies2/merge-single-list.bst b/tests/format/dependencies2/merge-single-list.bst new file mode 100644 index 000000000..4fd46e695 --- /dev/null +++ b/tests/format/dependencies2/merge-single-list.bst @@ -0,0 +1,8 @@ +kind: autotools +description: Depend on the same element twice, as a build and as a runtime dependency + +depends: +- filename: run-build.bst + type: runtime +- filename: run-build.bst + type: build |