diff options
author | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2019-08-08 10:26:25 +0100 |
---|---|---|
committer | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2019-08-08 15:04:53 +0100 |
commit | 40f32dd667475c933d00e04a18e620e4b327be77 (patch) | |
tree | 1ca126a32a9dd1f8d3dc9a9db79dc38d95db80f0 | |
parent | 04362376ceb648ee6dd53057bb26952cd32a2bd9 (diff) | |
download | buildstream-danielsilverstone-ct/load-reject-duplicates.tar.gz |
tests: Add test for DUPLICATE_DEPENDENCY verificationdanielsilverstone-ct/load-reject-duplicates
Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
-rw-r--r-- | tests/format/dependencies.py | 23 | ||||
-rw-r--r-- | tests/format/dependencies3/all-all.bst | 11 | ||||
-rw-r--r-- | tests/format/dependencies3/build-all.bst | 11 | ||||
-rw-r--r-- | tests/format/dependencies3/build-build.bst | 11 | ||||
-rw-r--r-- | tests/format/dependencies3/build-runtime.bst | 11 | ||||
-rw-r--r-- | tests/format/dependencies3/dep.bst | 4 | ||||
-rw-r--r-- | tests/format/dependencies3/project.conf | 1 | ||||
-rw-r--r-- | tests/format/dependencies3/runtime-all.bst | 11 | ||||
-rw-r--r-- | tests/format/dependencies3/runtime-runtime.bst | 11 |
9 files changed, 94 insertions, 0 deletions
diff --git a/tests/format/dependencies.py b/tests/format/dependencies.py index 15b6e1f4a..e8c50d3bc 100644 --- a/tests/format/dependencies.py +++ b/tests/format/dependencies.py @@ -218,3 +218,26 @@ def test_no_recurse(cli, datafiles): 'dep-two.bst', 'target.bst', ] + + +@pytest.mark.datafiles(DATA_DIR) +@pytest.mark.parametrize(("element", "asserts"), [ + ('build-runtime', False), + ('build-build', True), + ('build-all', True), + ('runtime-runtime', True), + ('runtime-all', True), + ('all-all', True), +]) +def test_duplicate_deps(cli, datafiles, element, asserts): + project = os.path.join(str(datafiles), 'dependencies3') + + result = cli.run(project=project, args=['show', '{}.bst'.format(element)]) + + if asserts: + result.assert_main_error(ErrorDomain.LOAD, + LoadErrorReason.DUPLICATE_DEPENDENCY) + assert '[line 10 column 2]' in result.stderr + assert '[line 8 column 2]' in result.stderr + else: + result.assert_success() diff --git a/tests/format/dependencies3/all-all.bst b/tests/format/dependencies3/all-all.bst new file mode 100644 index 000000000..98122472d --- /dev/null +++ b/tests/format/dependencies3/all-all.bst @@ -0,0 +1,11 @@ +kind: import + +sources: +- kind: local + path: all-all.bst + +depends: +- filename: dep.bst + type: all +- filename: dep.bst + type: all diff --git a/tests/format/dependencies3/build-all.bst b/tests/format/dependencies3/build-all.bst new file mode 100644 index 000000000..4c66524e7 --- /dev/null +++ b/tests/format/dependencies3/build-all.bst @@ -0,0 +1,11 @@ +kind: import + +sources: +- kind: local + path: all-all.bst + +depends: +- filename: dep.bst + type: build +- filename: dep.bst + type: all diff --git a/tests/format/dependencies3/build-build.bst b/tests/format/dependencies3/build-build.bst new file mode 100644 index 000000000..2a813b3ab --- /dev/null +++ b/tests/format/dependencies3/build-build.bst @@ -0,0 +1,11 @@ +kind: import + +sources: +- kind: local + path: all-all.bst + +depends: +- filename: dep.bst + type: build +- filename: dep.bst + type: build diff --git a/tests/format/dependencies3/build-runtime.bst b/tests/format/dependencies3/build-runtime.bst new file mode 100644 index 000000000..f740736d8 --- /dev/null +++ b/tests/format/dependencies3/build-runtime.bst @@ -0,0 +1,11 @@ +kind: import + +sources: +- kind: local + path: all-all.bst + +depends: +- filename: dep.bst + type: build +- filename: dep.bst + type: runtime diff --git a/tests/format/dependencies3/dep.bst b/tests/format/dependencies3/dep.bst new file mode 100644 index 000000000..f4f9f6862 --- /dev/null +++ b/tests/format/dependencies3/dep.bst @@ -0,0 +1,4 @@ +kind: import +sources: +- kind: local + path: project.conf diff --git a/tests/format/dependencies3/project.conf b/tests/format/dependencies3/project.conf new file mode 100644 index 000000000..d9f7e08cb --- /dev/null +++ b/tests/format/dependencies3/project.conf @@ -0,0 +1 @@ +name: dup-dup-checker diff --git a/tests/format/dependencies3/runtime-all.bst b/tests/format/dependencies3/runtime-all.bst new file mode 100644 index 000000000..c08594623 --- /dev/null +++ b/tests/format/dependencies3/runtime-all.bst @@ -0,0 +1,11 @@ +kind: import + +sources: +- kind: local + path: all-all.bst + +depends: +- filename: dep.bst + type: runtime +- filename: dep.bst + type: all diff --git a/tests/format/dependencies3/runtime-runtime.bst b/tests/format/dependencies3/runtime-runtime.bst new file mode 100644 index 000000000..d01181f9b --- /dev/null +++ b/tests/format/dependencies3/runtime-runtime.bst @@ -0,0 +1,11 @@ +kind: import + +sources: +- kind: local + path: all-all.bst + +depends: +- filename: dep.bst + type: runtime +- filename: dep.bst + type: runtime |