From dca84562d882b72fd0389c4095328162a9909954 Mon Sep 17 00:00:00 2001 From: Tristan Van Berkom Date: Fri, 11 Jan 2019 16:03:12 -0500 Subject: tests: Migrate junctions test to tests/format/junctions.py This is the directory for all things related to loading. --- tests/format/junctions.py | 310 +++++++++++++++++++++ tests/format/junctions/bar/app.bst | 7 + tests/format/junctions/bar/bar.txt | 1 + tests/format/junctions/bar/base.bst | 4 + tests/format/junctions/bar/project.conf | 1 + tests/format/junctions/bar/target.bst | 5 + tests/format/junctions/base/base.txt | 1 + tests/format/junctions/base/project.conf | 1 + tests/format/junctions/base/target.bst | 4 + tests/format/junctions/conflict/bar.bst | 4 + tests/format/junctions/conflict/foo.bst | 4 + tests/format/junctions/conflict/project.conf | 1 + tests/format/junctions/conflict/target.bst | 6 + tests/format/junctions/foo/app.bst | 7 + tests/format/junctions/foo/base.bst | 4 + tests/format/junctions/foo/foo.txt | 1 + tests/format/junctions/foo/project.conf | 1 + tests/format/junctions/foo/target.bst | 5 + .../inconsistent-names/elements/junction-A.bst | 4 + .../elements/junction-B-diff-name.bst | 4 + .../inconsistent-names/elements/target.bst | 9 + .../format/junctions/inconsistent-names/files/foo | 0 .../inconsistent-names/junctionA/elements/app.bst | 6 + .../junctionA/elements/junction-B.bst | 4 + .../inconsistent-names/junctionA/elements/lib.bst | 7 + .../inconsistent-names/junctionA/files/app | 0 .../inconsistent-names/junctionA/files/lib | 0 .../junctionA/junctionB/base/baseimg | 0 .../junctionA/junctionB/elements/base.bst | 4 + .../junctionA/junctionB/elements/lib2.bst | 6 + .../junctionA/junctionB/files/lib2 | 0 .../junctionA/junctionB/project.conf | 5 + .../inconsistent-names/junctionA/project.conf | 5 + .../junctions/inconsistent-names/project.conf | 5 + tests/format/junctions/invalid/app.bst | 4 + tests/format/junctions/invalid/base-with-deps.bst | 6 + tests/format/junctions/invalid/base.bst | 4 + tests/format/junctions/invalid/foo.txt | 1 + tests/format/junctions/invalid/junction-dep.bst | 3 + .../junctions/invalid/junction-with-deps.bst | 4 + tests/format/junctions/invalid/missing-element.bst | 9 + tests/format/junctions/invalid/missing.bst | 4 + tests/format/junctions/invalid/project.conf | 1 + tests/format/junctions/nested/foo.bst | 4 + tests/format/junctions/nested/project.conf | 1 + tests/format/junctions/nested/target.bst | 4 + tests/format/junctions/options-base/horsy.txt | 1 + tests/format/junctions/options-base/pony.txt | 1 + tests/format/junctions/options-base/project.conf | 9 + tests/format/junctions/options-base/target.bst | 8 + tests/format/junctions/options-default/base.bst | 4 + .../format/junctions/options-default/project.conf | 1 + tests/format/junctions/options-default/target.bst | 4 + tests/format/junctions/options-inherit/base.bst | 7 + .../format/junctions/options-inherit/project.conf | 10 + tests/format/junctions/options-inherit/target.bst | 4 + tests/format/junctions/options/base.bst | 7 + tests/format/junctions/options/project.conf | 1 + tests/format/junctions/options/target.bst | 4 + tests/format/junctions/toplevel/bar.bst | 4 + tests/format/junctions/toplevel/base.bst | 4 + tests/format/junctions/toplevel/foo.bst | 4 + tests/format/junctions/toplevel/project.conf | 1 + tests/format/junctions/toplevel/target.bst | 6 + tests/loader/junctions.py | 310 --------------------- tests/loader/junctions/bar/app.bst | 7 - tests/loader/junctions/bar/bar.txt | 1 - tests/loader/junctions/bar/base.bst | 4 - tests/loader/junctions/bar/project.conf | 1 - tests/loader/junctions/bar/target.bst | 5 - tests/loader/junctions/base/base.txt | 1 - tests/loader/junctions/base/project.conf | 1 - tests/loader/junctions/base/target.bst | 4 - tests/loader/junctions/conflict/bar.bst | 4 - tests/loader/junctions/conflict/foo.bst | 4 - tests/loader/junctions/conflict/project.conf | 1 - tests/loader/junctions/conflict/target.bst | 6 - tests/loader/junctions/foo/app.bst | 7 - tests/loader/junctions/foo/base.bst | 4 - tests/loader/junctions/foo/foo.txt | 1 - tests/loader/junctions/foo/project.conf | 1 - tests/loader/junctions/foo/target.bst | 5 - .../inconsistent-names/elements/junction-A.bst | 4 - .../elements/junction-B-diff-name.bst | 4 - .../inconsistent-names/elements/target.bst | 9 - .../loader/junctions/inconsistent-names/files/foo | 0 .../inconsistent-names/junctionA/elements/app.bst | 6 - .../junctionA/elements/junction-B.bst | 4 - .../inconsistent-names/junctionA/elements/lib.bst | 7 - .../inconsistent-names/junctionA/files/app | 0 .../inconsistent-names/junctionA/files/lib | 0 .../junctionA/junctionB/base/baseimg | 0 .../junctionA/junctionB/elements/base.bst | 4 - .../junctionA/junctionB/elements/lib2.bst | 6 - .../junctionA/junctionB/files/lib2 | 0 .../junctionA/junctionB/project.conf | 5 - .../inconsistent-names/junctionA/project.conf | 5 - .../junctions/inconsistent-names/project.conf | 5 - tests/loader/junctions/invalid/app.bst | 4 - tests/loader/junctions/invalid/base-with-deps.bst | 6 - tests/loader/junctions/invalid/base.bst | 4 - tests/loader/junctions/invalid/foo.txt | 1 - tests/loader/junctions/invalid/junction-dep.bst | 3 - .../junctions/invalid/junction-with-deps.bst | 4 - tests/loader/junctions/invalid/missing-element.bst | 9 - tests/loader/junctions/invalid/missing.bst | 4 - tests/loader/junctions/invalid/project.conf | 1 - tests/loader/junctions/nested/foo.bst | 4 - tests/loader/junctions/nested/project.conf | 1 - tests/loader/junctions/nested/target.bst | 4 - tests/loader/junctions/options-base/horsy.txt | 1 - tests/loader/junctions/options-base/pony.txt | 1 - tests/loader/junctions/options-base/project.conf | 9 - tests/loader/junctions/options-base/target.bst | 8 - tests/loader/junctions/options-default/base.bst | 4 - .../loader/junctions/options-default/project.conf | 1 - tests/loader/junctions/options-default/target.bst | 4 - tests/loader/junctions/options-inherit/base.bst | 7 - .../loader/junctions/options-inherit/project.conf | 10 - tests/loader/junctions/options-inherit/target.bst | 4 - tests/loader/junctions/options/base.bst | 7 - tests/loader/junctions/options/project.conf | 1 - tests/loader/junctions/options/target.bst | 4 - tests/loader/junctions/toplevel/bar.bst | 4 - tests/loader/junctions/toplevel/base.bst | 4 - tests/loader/junctions/toplevel/foo.bst | 4 - tests/loader/junctions/toplevel/project.conf | 1 - tests/loader/junctions/toplevel/target.bst | 6 - 128 files changed, 551 insertions(+), 551 deletions(-) create mode 100644 tests/format/junctions.py create mode 100644 tests/format/junctions/bar/app.bst create mode 100644 tests/format/junctions/bar/bar.txt create mode 100644 tests/format/junctions/bar/base.bst create mode 100644 tests/format/junctions/bar/project.conf create mode 100644 tests/format/junctions/bar/target.bst create mode 100644 tests/format/junctions/base/base.txt create mode 100644 tests/format/junctions/base/project.conf create mode 100644 tests/format/junctions/base/target.bst create mode 100644 tests/format/junctions/conflict/bar.bst create mode 100644 tests/format/junctions/conflict/foo.bst create mode 100644 tests/format/junctions/conflict/project.conf create mode 100644 tests/format/junctions/conflict/target.bst create mode 100644 tests/format/junctions/foo/app.bst create mode 100644 tests/format/junctions/foo/base.bst create mode 100644 tests/format/junctions/foo/foo.txt create mode 100644 tests/format/junctions/foo/project.conf create mode 100644 tests/format/junctions/foo/target.bst create mode 100644 tests/format/junctions/inconsistent-names/elements/junction-A.bst create mode 100644 tests/format/junctions/inconsistent-names/elements/junction-B-diff-name.bst create mode 100644 tests/format/junctions/inconsistent-names/elements/target.bst create mode 100644 tests/format/junctions/inconsistent-names/files/foo create mode 100644 tests/format/junctions/inconsistent-names/junctionA/elements/app.bst create mode 100644 tests/format/junctions/inconsistent-names/junctionA/elements/junction-B.bst create mode 100644 tests/format/junctions/inconsistent-names/junctionA/elements/lib.bst create mode 100644 tests/format/junctions/inconsistent-names/junctionA/files/app create mode 100644 tests/format/junctions/inconsistent-names/junctionA/files/lib create mode 100644 tests/format/junctions/inconsistent-names/junctionA/junctionB/base/baseimg create mode 100644 tests/format/junctions/inconsistent-names/junctionA/junctionB/elements/base.bst create mode 100644 tests/format/junctions/inconsistent-names/junctionA/junctionB/elements/lib2.bst create mode 100644 tests/format/junctions/inconsistent-names/junctionA/junctionB/files/lib2 create mode 100644 tests/format/junctions/inconsistent-names/junctionA/junctionB/project.conf create mode 100644 tests/format/junctions/inconsistent-names/junctionA/project.conf create mode 100644 tests/format/junctions/inconsistent-names/project.conf create mode 100644 tests/format/junctions/invalid/app.bst create mode 100644 tests/format/junctions/invalid/base-with-deps.bst create mode 100644 tests/format/junctions/invalid/base.bst create mode 100644 tests/format/junctions/invalid/foo.txt create mode 100644 tests/format/junctions/invalid/junction-dep.bst create mode 100644 tests/format/junctions/invalid/junction-with-deps.bst create mode 100644 tests/format/junctions/invalid/missing-element.bst create mode 100644 tests/format/junctions/invalid/missing.bst create mode 100644 tests/format/junctions/invalid/project.conf create mode 100644 tests/format/junctions/nested/foo.bst create mode 100644 tests/format/junctions/nested/project.conf create mode 100644 tests/format/junctions/nested/target.bst create mode 100644 tests/format/junctions/options-base/horsy.txt create mode 100644 tests/format/junctions/options-base/pony.txt create mode 100644 tests/format/junctions/options-base/project.conf create mode 100644 tests/format/junctions/options-base/target.bst create mode 100644 tests/format/junctions/options-default/base.bst create mode 100644 tests/format/junctions/options-default/project.conf create mode 100644 tests/format/junctions/options-default/target.bst create mode 100644 tests/format/junctions/options-inherit/base.bst create mode 100644 tests/format/junctions/options-inherit/project.conf create mode 100644 tests/format/junctions/options-inherit/target.bst create mode 100644 tests/format/junctions/options/base.bst create mode 100644 tests/format/junctions/options/project.conf create mode 100644 tests/format/junctions/options/target.bst create mode 100644 tests/format/junctions/toplevel/bar.bst create mode 100644 tests/format/junctions/toplevel/base.bst create mode 100644 tests/format/junctions/toplevel/foo.bst create mode 100644 tests/format/junctions/toplevel/project.conf create mode 100644 tests/format/junctions/toplevel/target.bst delete mode 100644 tests/loader/junctions.py delete mode 100644 tests/loader/junctions/bar/app.bst delete mode 100644 tests/loader/junctions/bar/bar.txt delete mode 100644 tests/loader/junctions/bar/base.bst delete mode 100644 tests/loader/junctions/bar/project.conf delete mode 100644 tests/loader/junctions/bar/target.bst delete mode 100644 tests/loader/junctions/base/base.txt delete mode 100644 tests/loader/junctions/base/project.conf delete mode 100644 tests/loader/junctions/base/target.bst delete mode 100644 tests/loader/junctions/conflict/bar.bst delete mode 100644 tests/loader/junctions/conflict/foo.bst delete mode 100644 tests/loader/junctions/conflict/project.conf delete mode 100644 tests/loader/junctions/conflict/target.bst delete mode 100644 tests/loader/junctions/foo/app.bst delete mode 100644 tests/loader/junctions/foo/base.bst delete mode 100644 tests/loader/junctions/foo/foo.txt delete mode 100644 tests/loader/junctions/foo/project.conf delete mode 100644 tests/loader/junctions/foo/target.bst delete mode 100644 tests/loader/junctions/inconsistent-names/elements/junction-A.bst delete mode 100644 tests/loader/junctions/inconsistent-names/elements/junction-B-diff-name.bst delete mode 100644 tests/loader/junctions/inconsistent-names/elements/target.bst delete mode 100644 tests/loader/junctions/inconsistent-names/files/foo delete mode 100644 tests/loader/junctions/inconsistent-names/junctionA/elements/app.bst delete mode 100644 tests/loader/junctions/inconsistent-names/junctionA/elements/junction-B.bst delete mode 100644 tests/loader/junctions/inconsistent-names/junctionA/elements/lib.bst delete mode 100644 tests/loader/junctions/inconsistent-names/junctionA/files/app delete mode 100644 tests/loader/junctions/inconsistent-names/junctionA/files/lib delete mode 100644 tests/loader/junctions/inconsistent-names/junctionA/junctionB/base/baseimg delete mode 100644 tests/loader/junctions/inconsistent-names/junctionA/junctionB/elements/base.bst delete mode 100644 tests/loader/junctions/inconsistent-names/junctionA/junctionB/elements/lib2.bst delete mode 100644 tests/loader/junctions/inconsistent-names/junctionA/junctionB/files/lib2 delete mode 100644 tests/loader/junctions/inconsistent-names/junctionA/junctionB/project.conf delete mode 100644 tests/loader/junctions/inconsistent-names/junctionA/project.conf delete mode 100644 tests/loader/junctions/inconsistent-names/project.conf delete mode 100644 tests/loader/junctions/invalid/app.bst delete mode 100644 tests/loader/junctions/invalid/base-with-deps.bst delete mode 100644 tests/loader/junctions/invalid/base.bst delete mode 100644 tests/loader/junctions/invalid/foo.txt delete mode 100644 tests/loader/junctions/invalid/junction-dep.bst delete mode 100644 tests/loader/junctions/invalid/junction-with-deps.bst delete mode 100644 tests/loader/junctions/invalid/missing-element.bst delete mode 100644 tests/loader/junctions/invalid/missing.bst delete mode 100644 tests/loader/junctions/invalid/project.conf delete mode 100644 tests/loader/junctions/nested/foo.bst delete mode 100644 tests/loader/junctions/nested/project.conf delete mode 100644 tests/loader/junctions/nested/target.bst delete mode 100644 tests/loader/junctions/options-base/horsy.txt delete mode 100644 tests/loader/junctions/options-base/pony.txt delete mode 100644 tests/loader/junctions/options-base/project.conf delete mode 100644 tests/loader/junctions/options-base/target.bst delete mode 100644 tests/loader/junctions/options-default/base.bst delete mode 100644 tests/loader/junctions/options-default/project.conf delete mode 100644 tests/loader/junctions/options-default/target.bst delete mode 100644 tests/loader/junctions/options-inherit/base.bst delete mode 100644 tests/loader/junctions/options-inherit/project.conf delete mode 100644 tests/loader/junctions/options-inherit/target.bst delete mode 100644 tests/loader/junctions/options/base.bst delete mode 100644 tests/loader/junctions/options/project.conf delete mode 100644 tests/loader/junctions/options/target.bst delete mode 100644 tests/loader/junctions/toplevel/bar.bst delete mode 100644 tests/loader/junctions/toplevel/base.bst delete mode 100644 tests/loader/junctions/toplevel/foo.bst delete mode 100644 tests/loader/junctions/toplevel/project.conf delete mode 100644 tests/loader/junctions/toplevel/target.bst diff --git a/tests/format/junctions.py b/tests/format/junctions.py new file mode 100644 index 000000000..d97c9f702 --- /dev/null +++ b/tests/format/junctions.py @@ -0,0 +1,310 @@ +import os +import pytest +import shutil + +from buildstream import _yaml, ElementError +from buildstream._exceptions import ErrorDomain, LoadErrorReason +from tests.testutils import cli, create_repo +from tests.testutils.site import HAVE_GIT + + +DATA_DIR = os.path.join( + os.path.dirname(os.path.realpath(__file__)), + 'junctions', +) + + +def copy_subprojects(project, datafiles, subprojects): + for subproject in subprojects: + shutil.copytree(os.path.join(str(datafiles), subproject), os.path.join(str(project), subproject)) + + +@pytest.mark.datafiles(DATA_DIR) +def test_simple_pipeline(cli, datafiles): + project = os.path.join(str(datafiles), 'foo') + copy_subprojects(project, datafiles, ['base']) + + # Check that the pipeline includes the subproject element + element_list = cli.get_pipeline(project, ['target.bst']) + assert 'base.bst:target.bst' in element_list + + +@pytest.mark.datafiles(DATA_DIR) +def test_simple_build(cli, tmpdir, datafiles): + project = os.path.join(str(datafiles), 'foo') + copy_subprojects(project, datafiles, ['base']) + + checkoutdir = os.path.join(str(tmpdir), "checkout") + + # Build, checkout + result = cli.run(project=project, args=['build', 'target.bst']) + result.assert_success() + result = cli.run(project=project, args=['checkout', 'target.bst', checkoutdir]) + result.assert_success() + + # Check that the checkout contains the expected files from both projects + assert(os.path.exists(os.path.join(checkoutdir, 'base.txt'))) + assert(os.path.exists(os.path.join(checkoutdir, 'foo.txt'))) + + +@pytest.mark.datafiles(DATA_DIR) +def test_build_of_same_junction_used_twice(cli, tmpdir, datafiles): + project = os.path.join(str(datafiles), 'inconsistent-names') + + # Check we can build a project that contains the same junction + # that is used twice, but named differently + result = cli.run(project=project, args=['build', 'target.bst']) + result.assert_success() + + +@pytest.mark.datafiles(DATA_DIR) +def test_nested_simple(cli, tmpdir, datafiles): + foo = os.path.join(str(datafiles), 'foo') + copy_subprojects(foo, datafiles, ['base']) + + project = os.path.join(str(datafiles), 'nested') + copy_subprojects(project, datafiles, ['foo']) + + checkoutdir = os.path.join(str(tmpdir), "checkout") + + # Build, checkout + result = cli.run(project=project, args=['build', 'target.bst']) + result.assert_success() + result = cli.run(project=project, args=['checkout', 'target.bst', checkoutdir]) + result.assert_success() + + # Check that the checkout contains the expected files from all subprojects + assert(os.path.exists(os.path.join(checkoutdir, 'base.txt'))) + assert(os.path.exists(os.path.join(checkoutdir, 'foo.txt'))) + + +@pytest.mark.datafiles(DATA_DIR) +def test_nested_double(cli, tmpdir, datafiles): + foo = os.path.join(str(datafiles), 'foo') + copy_subprojects(foo, datafiles, ['base']) + + bar = os.path.join(str(datafiles), 'bar') + copy_subprojects(bar, datafiles, ['base']) + + project = os.path.join(str(datafiles), 'toplevel') + copy_subprojects(project, datafiles, ['base', 'foo', 'bar']) + + checkoutdir = os.path.join(str(tmpdir), "checkout") + + # Build, checkout + result = cli.run(project=project, args=['build', 'target.bst']) + result.assert_success() + result = cli.run(project=project, args=['checkout', 'target.bst', checkoutdir]) + result.assert_success() + + # Check that the checkout contains the expected files from all subprojects + assert(os.path.exists(os.path.join(checkoutdir, 'base.txt'))) + assert(os.path.exists(os.path.join(checkoutdir, 'foo.txt'))) + assert(os.path.exists(os.path.join(checkoutdir, 'bar.txt'))) + + +@pytest.mark.datafiles(DATA_DIR) +def test_nested_conflict(cli, datafiles): + foo = os.path.join(str(datafiles), 'foo') + copy_subprojects(foo, datafiles, ['base']) + + bar = os.path.join(str(datafiles), 'bar') + copy_subprojects(bar, datafiles, ['base']) + + project = os.path.join(str(datafiles), 'conflict') + copy_subprojects(project, datafiles, ['foo', 'bar']) + + result = cli.run(project=project, args=['build', 'target.bst']) + result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.CONFLICTING_JUNCTION) + + +# Test that we error correctly when the junction element itself is missing +@pytest.mark.datafiles(DATA_DIR) +def test_missing_junction(cli, datafiles): + project = os.path.join(str(datafiles), 'invalid') + + result = cli.run(project=project, args=['build', 'missing.bst']) + result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.MISSING_FILE) + + +# Test that we error correctly when an element is not found in the subproject +@pytest.mark.datafiles(DATA_DIR) +def test_missing_subproject_element(cli, datafiles): + project = os.path.join(str(datafiles), 'invalid') + copy_subprojects(project, datafiles, ['base']) + + result = cli.run(project=project, args=['build', 'missing-element.bst']) + result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.MISSING_FILE) + + +# Test that we error correctly when a junction itself has dependencies +@pytest.mark.datafiles(DATA_DIR) +def test_invalid_with_deps(cli, datafiles): + project = os.path.join(str(datafiles), 'invalid') + copy_subprojects(project, datafiles, ['base']) + + result = cli.run(project=project, args=['build', 'junction-with-deps.bst']) + result.assert_main_error(ErrorDomain.ELEMENT, 'element-forbidden-depends') + + +# Test that we error correctly when a junction is directly depended on +@pytest.mark.datafiles(DATA_DIR) +def test_invalid_junction_dep(cli, datafiles): + project = os.path.join(str(datafiles), 'invalid') + copy_subprojects(project, datafiles, ['base']) + + result = cli.run(project=project, args=['build', 'junction-dep.bst']) + result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.INVALID_DATA) + + +@pytest.mark.datafiles(DATA_DIR) +def test_options_default(cli, tmpdir, datafiles): + project = os.path.join(str(datafiles), 'options-default') + copy_subprojects(project, datafiles, ['options-base']) + + checkoutdir = os.path.join(str(tmpdir), "checkout") + + # Build, checkout + result = cli.run(project=project, args=['build', 'target.bst']) + result.assert_success() + result = cli.run(project=project, args=['checkout', 'target.bst', checkoutdir]) + result.assert_success() + + assert(os.path.exists(os.path.join(checkoutdir, 'pony.txt'))) + assert(not os.path.exists(os.path.join(checkoutdir, 'horsy.txt'))) + + +@pytest.mark.datafiles(DATA_DIR) +def test_options(cli, tmpdir, datafiles): + project = os.path.join(str(datafiles), 'options') + copy_subprojects(project, datafiles, ['options-base']) + + checkoutdir = os.path.join(str(tmpdir), "checkout") + + # Build, checkout + result = cli.run(project=project, args=['build', 'target.bst']) + result.assert_success() + result = cli.run(project=project, args=['checkout', 'target.bst', checkoutdir]) + result.assert_success() + + assert(not os.path.exists(os.path.join(checkoutdir, 'pony.txt'))) + assert(os.path.exists(os.path.join(checkoutdir, 'horsy.txt'))) + + +@pytest.mark.datafiles(DATA_DIR) +def test_options_inherit(cli, tmpdir, datafiles): + project = os.path.join(str(datafiles), 'options-inherit') + copy_subprojects(project, datafiles, ['options-base']) + + checkoutdir = os.path.join(str(tmpdir), "checkout") + + # Build, checkout + result = cli.run(project=project, args=['build', 'target.bst']) + result.assert_success() + result = cli.run(project=project, args=['checkout', 'target.bst', checkoutdir]) + result.assert_success() + + assert(not os.path.exists(os.path.join(checkoutdir, 'pony.txt'))) + assert(os.path.exists(os.path.join(checkoutdir, 'horsy.txt'))) + + +@pytest.mark.skipif(HAVE_GIT is False, reason="git is not available") +@pytest.mark.datafiles(DATA_DIR) +def test_git_show(cli, tmpdir, datafiles): + project = os.path.join(str(datafiles), 'foo') + checkoutdir = os.path.join(str(tmpdir), "checkout") + + # Create the repo from 'base' subdir + repo = create_repo('git', str(tmpdir)) + ref = repo.create(os.path.join(str(datafiles), 'base')) + + # Write out junction element with git source + element = { + 'kind': 'junction', + 'sources': [ + repo.source_config(ref=ref) + ] + } + _yaml.dump(element, os.path.join(project, 'base.bst')) + + # Verify that bst show does not implicitly fetch subproject + result = cli.run(project=project, args=['show', 'target.bst']) + result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.SUBPROJECT_FETCH_NEEDED) + + # Explicitly fetch subproject + result = cli.run(project=project, args=['source', 'fetch', 'base.bst']) + result.assert_success() + + # Check that bst show succeeds now and the pipeline includes the subproject element + element_list = cli.get_pipeline(project, ['target.bst']) + assert 'base.bst:target.bst' in element_list + + +@pytest.mark.skipif(HAVE_GIT is False, reason="git is not available") +@pytest.mark.datafiles(DATA_DIR) +def test_git_build(cli, tmpdir, datafiles): + project = os.path.join(str(datafiles), 'foo') + checkoutdir = os.path.join(str(tmpdir), "checkout") + + # Create the repo from 'base' subdir + repo = create_repo('git', str(tmpdir)) + ref = repo.create(os.path.join(str(datafiles), 'base')) + + # Write out junction element with git source + element = { + 'kind': 'junction', + 'sources': [ + repo.source_config(ref=ref) + ] + } + _yaml.dump(element, os.path.join(project, 'base.bst')) + + # Build (with implicit fetch of subproject), checkout + result = cli.run(project=project, args=['build', 'target.bst']) + result.assert_success() + result = cli.run(project=project, args=['checkout', 'target.bst', checkoutdir]) + result.assert_success() + + # Check that the checkout contains the expected files from both projects + assert(os.path.exists(os.path.join(checkoutdir, 'base.txt'))) + assert(os.path.exists(os.path.join(checkoutdir, 'foo.txt'))) + + +@pytest.mark.datafiles(DATA_DIR) +def test_cross_junction_names(cli, tmpdir, datafiles): + project = os.path.join(str(datafiles), 'foo') + copy_subprojects(project, datafiles, ['base']) + + element_list = cli.get_pipeline(project, ['base.bst:target.bst']) + assert 'base.bst:target.bst' in element_list + + +@pytest.mark.datafiles(DATA_DIR) +def test_build_git_cross_junction_names(cli, tmpdir, datafiles): + project = os.path.join(str(datafiles), 'foo') + checkoutdir = os.path.join(str(tmpdir), "checkout") + + # Create the repo from 'base' subdir + repo = create_repo('git', str(tmpdir)) + ref = repo.create(os.path.join(str(datafiles), 'base')) + + # Write out junction element with git source + element = { + 'kind': 'junction', + 'sources': [ + repo.source_config(ref=ref) + ] + } + _yaml.dump(element, os.path.join(project, 'base.bst')) + + print(element) + print(cli.get_pipeline(project, ['base.bst'])) + + # Build (with implicit fetch of subproject), checkout + result = cli.run(project=project, args=['build', 'base.bst:target.bst']) + result.assert_success() + result = cli.run(project=project, args=['checkout', 'base.bst:target.bst', checkoutdir]) + result.assert_success() + + # Check that the checkout contains the expected files from both projects + assert(os.path.exists(os.path.join(checkoutdir, 'base.txt'))) diff --git a/tests/format/junctions/bar/app.bst b/tests/format/junctions/bar/app.bst new file mode 100644 index 000000000..a1a7a0ed9 --- /dev/null +++ b/tests/format/junctions/bar/app.bst @@ -0,0 +1,7 @@ +kind: import +sources: +- kind: local + path: bar.txt +depends: +- junction: base.bst + filename: target.bst diff --git a/tests/format/junctions/bar/bar.txt b/tests/format/junctions/bar/bar.txt new file mode 100644 index 000000000..5716ca598 --- /dev/null +++ b/tests/format/junctions/bar/bar.txt @@ -0,0 +1 @@ +bar diff --git a/tests/format/junctions/bar/base.bst b/tests/format/junctions/bar/base.bst new file mode 100644 index 000000000..10ce559a9 --- /dev/null +++ b/tests/format/junctions/bar/base.bst @@ -0,0 +1,4 @@ +kind: junction +sources: +- kind: local + path: base diff --git a/tests/format/junctions/bar/project.conf b/tests/format/junctions/bar/project.conf new file mode 100644 index 000000000..f8ed6621d --- /dev/null +++ b/tests/format/junctions/bar/project.conf @@ -0,0 +1 @@ +name: bar diff --git a/tests/format/junctions/bar/target.bst b/tests/format/junctions/bar/target.bst new file mode 100644 index 000000000..70b78a3fc --- /dev/null +++ b/tests/format/junctions/bar/target.bst @@ -0,0 +1,5 @@ +kind: stack +depends: +- junction: base.bst + filename: target.bst +- app.bst diff --git a/tests/format/junctions/base/base.txt b/tests/format/junctions/base/base.txt new file mode 100644 index 000000000..a496efee8 --- /dev/null +++ b/tests/format/junctions/base/base.txt @@ -0,0 +1 @@ +This is a text file diff --git a/tests/format/junctions/base/project.conf b/tests/format/junctions/base/project.conf new file mode 100644 index 000000000..951ea1a34 --- /dev/null +++ b/tests/format/junctions/base/project.conf @@ -0,0 +1 @@ +name: base diff --git a/tests/format/junctions/base/target.bst b/tests/format/junctions/base/target.bst new file mode 100644 index 000000000..2b61c518b --- /dev/null +++ b/tests/format/junctions/base/target.bst @@ -0,0 +1,4 @@ +kind: import +sources: +- kind: local + path: base.txt diff --git a/tests/format/junctions/conflict/bar.bst b/tests/format/junctions/conflict/bar.bst new file mode 100644 index 000000000..62eee825a --- /dev/null +++ b/tests/format/junctions/conflict/bar.bst @@ -0,0 +1,4 @@ +kind: junction +sources: +- kind: local + path: bar diff --git a/tests/format/junctions/conflict/foo.bst b/tests/format/junctions/conflict/foo.bst new file mode 100644 index 000000000..1feb4010b --- /dev/null +++ b/tests/format/junctions/conflict/foo.bst @@ -0,0 +1,4 @@ +kind: junction +sources: +- kind: local + path: foo diff --git a/tests/format/junctions/conflict/project.conf b/tests/format/junctions/conflict/project.conf new file mode 100644 index 000000000..395bb8423 --- /dev/null +++ b/tests/format/junctions/conflict/project.conf @@ -0,0 +1 @@ +name: conflict diff --git a/tests/format/junctions/conflict/target.bst b/tests/format/junctions/conflict/target.bst new file mode 100644 index 000000000..5e280e542 --- /dev/null +++ b/tests/format/junctions/conflict/target.bst @@ -0,0 +1,6 @@ +kind: stack +depends: +- junction: foo.bst + filename: target.bst +- junction: bar.bst + filename: target.bst diff --git a/tests/format/junctions/foo/app.bst b/tests/format/junctions/foo/app.bst new file mode 100644 index 000000000..e658628b0 --- /dev/null +++ b/tests/format/junctions/foo/app.bst @@ -0,0 +1,7 @@ +kind: import +sources: +- kind: local + path: foo.txt +depends: +- junction: base.bst + filename: target.bst diff --git a/tests/format/junctions/foo/base.bst b/tests/format/junctions/foo/base.bst new file mode 100644 index 000000000..10ce559a9 --- /dev/null +++ b/tests/format/junctions/foo/base.bst @@ -0,0 +1,4 @@ +kind: junction +sources: +- kind: local + path: base diff --git a/tests/format/junctions/foo/foo.txt b/tests/format/junctions/foo/foo.txt new file mode 100644 index 000000000..257cc5642 --- /dev/null +++ b/tests/format/junctions/foo/foo.txt @@ -0,0 +1 @@ +foo diff --git a/tests/format/junctions/foo/project.conf b/tests/format/junctions/foo/project.conf new file mode 100644 index 000000000..5a240e3ed --- /dev/null +++ b/tests/format/junctions/foo/project.conf @@ -0,0 +1 @@ +name: foo diff --git a/tests/format/junctions/foo/target.bst b/tests/format/junctions/foo/target.bst new file mode 100644 index 000000000..70b78a3fc --- /dev/null +++ b/tests/format/junctions/foo/target.bst @@ -0,0 +1,5 @@ +kind: stack +depends: +- junction: base.bst + filename: target.bst +- app.bst diff --git a/tests/format/junctions/inconsistent-names/elements/junction-A.bst b/tests/format/junctions/inconsistent-names/elements/junction-A.bst new file mode 100644 index 000000000..74079f990 --- /dev/null +++ b/tests/format/junctions/inconsistent-names/elements/junction-A.bst @@ -0,0 +1,4 @@ +kind: junction +sources: +- kind: local + path: junctionA diff --git a/tests/format/junctions/inconsistent-names/elements/junction-B-diff-name.bst b/tests/format/junctions/inconsistent-names/elements/junction-B-diff-name.bst new file mode 100644 index 000000000..3b33406e5 --- /dev/null +++ b/tests/format/junctions/inconsistent-names/elements/junction-B-diff-name.bst @@ -0,0 +1,4 @@ +kind: junction +sources: +- kind: local + path: junctionA/junctionB diff --git a/tests/format/junctions/inconsistent-names/elements/target.bst b/tests/format/junctions/inconsistent-names/elements/target.bst new file mode 100644 index 000000000..7eba141de --- /dev/null +++ b/tests/format/junctions/inconsistent-names/elements/target.bst @@ -0,0 +1,9 @@ +kind: import +sources: +- kind: local + path: files/foo +depends: +- filename: lib2.bst + junction: junction-B-diff-name.bst +- filename: lib.bst + junction: junction-A.bst diff --git a/tests/format/junctions/inconsistent-names/files/foo b/tests/format/junctions/inconsistent-names/files/foo new file mode 100644 index 000000000..e69de29bb diff --git a/tests/format/junctions/inconsistent-names/junctionA/elements/app.bst b/tests/format/junctions/inconsistent-names/junctionA/elements/app.bst new file mode 100644 index 000000000..473aaee0b --- /dev/null +++ b/tests/format/junctions/inconsistent-names/junctionA/elements/app.bst @@ -0,0 +1,6 @@ +kind: import +sources: +- kind: local + path: files/app +depends: +- lib.bst diff --git a/tests/format/junctions/inconsistent-names/junctionA/elements/junction-B.bst b/tests/format/junctions/inconsistent-names/junctionA/elements/junction-B.bst new file mode 100644 index 000000000..bc66d7851 --- /dev/null +++ b/tests/format/junctions/inconsistent-names/junctionA/elements/junction-B.bst @@ -0,0 +1,4 @@ +kind: junction +sources: +- kind: local + path: junctionB diff --git a/tests/format/junctions/inconsistent-names/junctionA/elements/lib.bst b/tests/format/junctions/inconsistent-names/junctionA/elements/lib.bst new file mode 100644 index 000000000..684a64315 --- /dev/null +++ b/tests/format/junctions/inconsistent-names/junctionA/elements/lib.bst @@ -0,0 +1,7 @@ +kind: import +sources: +- kind: local + path: files/lib +depends: +- filename: base.bst + junction: junction-B.bst diff --git a/tests/format/junctions/inconsistent-names/junctionA/files/app b/tests/format/junctions/inconsistent-names/junctionA/files/app new file mode 100644 index 000000000..e69de29bb diff --git a/tests/format/junctions/inconsistent-names/junctionA/files/lib b/tests/format/junctions/inconsistent-names/junctionA/files/lib new file mode 100644 index 000000000..e69de29bb diff --git a/tests/format/junctions/inconsistent-names/junctionA/junctionB/base/baseimg b/tests/format/junctions/inconsistent-names/junctionA/junctionB/base/baseimg new file mode 100644 index 000000000..e69de29bb diff --git a/tests/format/junctions/inconsistent-names/junctionA/junctionB/elements/base.bst b/tests/format/junctions/inconsistent-names/junctionA/junctionB/elements/base.bst new file mode 100644 index 000000000..ecdc57c79 --- /dev/null +++ b/tests/format/junctions/inconsistent-names/junctionA/junctionB/elements/base.bst @@ -0,0 +1,4 @@ +kind: import +sources: +- kind: local + path: base diff --git a/tests/format/junctions/inconsistent-names/junctionA/junctionB/elements/lib2.bst b/tests/format/junctions/inconsistent-names/junctionA/junctionB/elements/lib2.bst new file mode 100644 index 000000000..5a7c17b99 --- /dev/null +++ b/tests/format/junctions/inconsistent-names/junctionA/junctionB/elements/lib2.bst @@ -0,0 +1,6 @@ +kind: import +sources: +- kind: local + path: files/lib2 +depends: +- base.bst diff --git a/tests/format/junctions/inconsistent-names/junctionA/junctionB/files/lib2 b/tests/format/junctions/inconsistent-names/junctionA/junctionB/files/lib2 new file mode 100644 index 000000000..e69de29bb diff --git a/tests/format/junctions/inconsistent-names/junctionA/junctionB/project.conf b/tests/format/junctions/inconsistent-names/junctionA/junctionB/project.conf new file mode 100644 index 000000000..2e96170f8 --- /dev/null +++ b/tests/format/junctions/inconsistent-names/junctionA/junctionB/project.conf @@ -0,0 +1,5 @@ +# Unique project name +name: projectB + +# Subdirectory where elements are stored +element-path: elements diff --git a/tests/format/junctions/inconsistent-names/junctionA/project.conf b/tests/format/junctions/inconsistent-names/junctionA/project.conf new file mode 100644 index 000000000..166c4b78c --- /dev/null +++ b/tests/format/junctions/inconsistent-names/junctionA/project.conf @@ -0,0 +1,5 @@ +# Unique project name +name: projectA + +# Subdirectory where elements are stored +element-path: elements diff --git a/tests/format/junctions/inconsistent-names/project.conf b/tests/format/junctions/inconsistent-names/project.conf new file mode 100644 index 000000000..064bbc588 --- /dev/null +++ b/tests/format/junctions/inconsistent-names/project.conf @@ -0,0 +1,5 @@ +# Unique project name +name: inconsistent-names + +# Subdirectory where elements are stored +element-path: elements diff --git a/tests/format/junctions/invalid/app.bst b/tests/format/junctions/invalid/app.bst new file mode 100644 index 000000000..9906149a6 --- /dev/null +++ b/tests/format/junctions/invalid/app.bst @@ -0,0 +1,4 @@ +kind: import +sources: +- kind: local + path: foo.txt diff --git a/tests/format/junctions/invalid/base-with-deps.bst b/tests/format/junctions/invalid/base-with-deps.bst new file mode 100644 index 000000000..a30eb3a52 --- /dev/null +++ b/tests/format/junctions/invalid/base-with-deps.bst @@ -0,0 +1,6 @@ +kind: junction +sources: +- kind: local + path: base +depends: +- app.bst diff --git a/tests/format/junctions/invalid/base.bst b/tests/format/junctions/invalid/base.bst new file mode 100644 index 000000000..10ce559a9 --- /dev/null +++ b/tests/format/junctions/invalid/base.bst @@ -0,0 +1,4 @@ +kind: junction +sources: +- kind: local + path: base diff --git a/tests/format/junctions/invalid/foo.txt b/tests/format/junctions/invalid/foo.txt new file mode 100644 index 000000000..257cc5642 --- /dev/null +++ b/tests/format/junctions/invalid/foo.txt @@ -0,0 +1 @@ +foo diff --git a/tests/format/junctions/invalid/junction-dep.bst b/tests/format/junctions/invalid/junction-dep.bst new file mode 100644 index 000000000..20fd30011 --- /dev/null +++ b/tests/format/junctions/invalid/junction-dep.bst @@ -0,0 +1,3 @@ +kind: stack +depends: +- base.bst diff --git a/tests/format/junctions/invalid/junction-with-deps.bst b/tests/format/junctions/invalid/junction-with-deps.bst new file mode 100644 index 000000000..d2ca337dd --- /dev/null +++ b/tests/format/junctions/invalid/junction-with-deps.bst @@ -0,0 +1,4 @@ +kind: stack +depends: +- junction: base-with-deps.bst + filename: target.bst diff --git a/tests/format/junctions/invalid/missing-element.bst b/tests/format/junctions/invalid/missing-element.bst new file mode 100644 index 000000000..4c29221af --- /dev/null +++ b/tests/format/junctions/invalid/missing-element.bst @@ -0,0 +1,9 @@ +# This refers to the `foo.bst` element through +# the `base.bst` junction. The `base.bst` junction +# exists but the `foo.bst` element does not exist +# in the subproject. +# +kind: stack +depends: +- junction: base.bst + filename: foo.bst diff --git a/tests/format/junctions/invalid/missing.bst b/tests/format/junctions/invalid/missing.bst new file mode 100644 index 000000000..672e967fe --- /dev/null +++ b/tests/format/junctions/invalid/missing.bst @@ -0,0 +1,4 @@ +kind: stack +depends: +- junction: missingfile.bst + filename: target.bst diff --git a/tests/format/junctions/invalid/project.conf b/tests/format/junctions/invalid/project.conf new file mode 100644 index 000000000..38070bf71 --- /dev/null +++ b/tests/format/junctions/invalid/project.conf @@ -0,0 +1 @@ +name: invalid diff --git a/tests/format/junctions/nested/foo.bst b/tests/format/junctions/nested/foo.bst new file mode 100644 index 000000000..1feb4010b --- /dev/null +++ b/tests/format/junctions/nested/foo.bst @@ -0,0 +1,4 @@ +kind: junction +sources: +- kind: local + path: foo diff --git a/tests/format/junctions/nested/project.conf b/tests/format/junctions/nested/project.conf new file mode 100644 index 000000000..551f51c6a --- /dev/null +++ b/tests/format/junctions/nested/project.conf @@ -0,0 +1 @@ +name: nested diff --git a/tests/format/junctions/nested/target.bst b/tests/format/junctions/nested/target.bst new file mode 100644 index 000000000..db59499a7 --- /dev/null +++ b/tests/format/junctions/nested/target.bst @@ -0,0 +1,4 @@ +kind: stack +depends: +- junction: foo.bst + filename: target.bst diff --git a/tests/format/junctions/options-base/horsy.txt b/tests/format/junctions/options-base/horsy.txt new file mode 100644 index 000000000..063dad656 --- /dev/null +++ b/tests/format/junctions/options-base/horsy.txt @@ -0,0 +1 @@ +horsy diff --git a/tests/format/junctions/options-base/pony.txt b/tests/format/junctions/options-base/pony.txt new file mode 100644 index 000000000..f62144808 --- /dev/null +++ b/tests/format/junctions/options-base/pony.txt @@ -0,0 +1 @@ +pony diff --git a/tests/format/junctions/options-base/project.conf b/tests/format/junctions/options-base/project.conf new file mode 100644 index 000000000..a98ebd5ed --- /dev/null +++ b/tests/format/junctions/options-base/project.conf @@ -0,0 +1,9 @@ +name: options-base +options: + animal: + type: enum + description: The kind of animal + values: + - pony + - horsy + default: pony diff --git a/tests/format/junctions/options-base/target.bst b/tests/format/junctions/options-base/target.bst new file mode 100644 index 000000000..cda17af98 --- /dev/null +++ b/tests/format/junctions/options-base/target.bst @@ -0,0 +1,8 @@ +kind: import +sources: +- kind: local + (?): + - animal == "pony": + path: pony.txt + - animal == "horsy": + path: horsy.txt diff --git a/tests/format/junctions/options-default/base.bst b/tests/format/junctions/options-default/base.bst new file mode 100644 index 000000000..5d42e5c31 --- /dev/null +++ b/tests/format/junctions/options-default/base.bst @@ -0,0 +1,4 @@ +kind: junction +sources: +- kind: local + path: options-base diff --git a/tests/format/junctions/options-default/project.conf b/tests/format/junctions/options-default/project.conf new file mode 100644 index 000000000..b9e58a582 --- /dev/null +++ b/tests/format/junctions/options-default/project.conf @@ -0,0 +1 @@ +name: options-default diff --git a/tests/format/junctions/options-default/target.bst b/tests/format/junctions/options-default/target.bst new file mode 100644 index 000000000..8395c0c77 --- /dev/null +++ b/tests/format/junctions/options-default/target.bst @@ -0,0 +1,4 @@ +kind: stack +depends: +- junction: base.bst + filename: target.bst diff --git a/tests/format/junctions/options-inherit/base.bst b/tests/format/junctions/options-inherit/base.bst new file mode 100644 index 000000000..8623d0d01 --- /dev/null +++ b/tests/format/junctions/options-inherit/base.bst @@ -0,0 +1,7 @@ +kind: junction +sources: +- kind: local + path: options-base +config: + options: + animal: '%{animal}' diff --git a/tests/format/junctions/options-inherit/project.conf b/tests/format/junctions/options-inherit/project.conf new file mode 100644 index 000000000..1e0ea4464 --- /dev/null +++ b/tests/format/junctions/options-inherit/project.conf @@ -0,0 +1,10 @@ +name: options-inherit +options: + animal: + type: enum + description: The kind of animal + values: + - pony + - horsy + default: horsy + variable: animal diff --git a/tests/format/junctions/options-inherit/target.bst b/tests/format/junctions/options-inherit/target.bst new file mode 100644 index 000000000..8395c0c77 --- /dev/null +++ b/tests/format/junctions/options-inherit/target.bst @@ -0,0 +1,4 @@ +kind: stack +depends: +- junction: base.bst + filename: target.bst diff --git a/tests/format/junctions/options/base.bst b/tests/format/junctions/options/base.bst new file mode 100644 index 000000000..a100e5e1e --- /dev/null +++ b/tests/format/junctions/options/base.bst @@ -0,0 +1,7 @@ +kind: junction +sources: +- kind: local + path: options-base +config: + options: + animal: horsy diff --git a/tests/format/junctions/options/project.conf b/tests/format/junctions/options/project.conf new file mode 100644 index 000000000..de53ae176 --- /dev/null +++ b/tests/format/junctions/options/project.conf @@ -0,0 +1 @@ +name: options diff --git a/tests/format/junctions/options/target.bst b/tests/format/junctions/options/target.bst new file mode 100644 index 000000000..8395c0c77 --- /dev/null +++ b/tests/format/junctions/options/target.bst @@ -0,0 +1,4 @@ +kind: stack +depends: +- junction: base.bst + filename: target.bst diff --git a/tests/format/junctions/toplevel/bar.bst b/tests/format/junctions/toplevel/bar.bst new file mode 100644 index 000000000..62eee825a --- /dev/null +++ b/tests/format/junctions/toplevel/bar.bst @@ -0,0 +1,4 @@ +kind: junction +sources: +- kind: local + path: bar diff --git a/tests/format/junctions/toplevel/base.bst b/tests/format/junctions/toplevel/base.bst new file mode 100644 index 000000000..10ce559a9 --- /dev/null +++ b/tests/format/junctions/toplevel/base.bst @@ -0,0 +1,4 @@ +kind: junction +sources: +- kind: local + path: base diff --git a/tests/format/junctions/toplevel/foo.bst b/tests/format/junctions/toplevel/foo.bst new file mode 100644 index 000000000..1feb4010b --- /dev/null +++ b/tests/format/junctions/toplevel/foo.bst @@ -0,0 +1,4 @@ +kind: junction +sources: +- kind: local + path: foo diff --git a/tests/format/junctions/toplevel/project.conf b/tests/format/junctions/toplevel/project.conf new file mode 100644 index 000000000..496c82128 --- /dev/null +++ b/tests/format/junctions/toplevel/project.conf @@ -0,0 +1 @@ +name: toplevel diff --git a/tests/format/junctions/toplevel/target.bst b/tests/format/junctions/toplevel/target.bst new file mode 100644 index 000000000..5e280e542 --- /dev/null +++ b/tests/format/junctions/toplevel/target.bst @@ -0,0 +1,6 @@ +kind: stack +depends: +- junction: foo.bst + filename: target.bst +- junction: bar.bst + filename: target.bst diff --git a/tests/loader/junctions.py b/tests/loader/junctions.py deleted file mode 100644 index d97c9f702..000000000 --- a/tests/loader/junctions.py +++ /dev/null @@ -1,310 +0,0 @@ -import os -import pytest -import shutil - -from buildstream import _yaml, ElementError -from buildstream._exceptions import ErrorDomain, LoadErrorReason -from tests.testutils import cli, create_repo -from tests.testutils.site import HAVE_GIT - - -DATA_DIR = os.path.join( - os.path.dirname(os.path.realpath(__file__)), - 'junctions', -) - - -def copy_subprojects(project, datafiles, subprojects): - for subproject in subprojects: - shutil.copytree(os.path.join(str(datafiles), subproject), os.path.join(str(project), subproject)) - - -@pytest.mark.datafiles(DATA_DIR) -def test_simple_pipeline(cli, datafiles): - project = os.path.join(str(datafiles), 'foo') - copy_subprojects(project, datafiles, ['base']) - - # Check that the pipeline includes the subproject element - element_list = cli.get_pipeline(project, ['target.bst']) - assert 'base.bst:target.bst' in element_list - - -@pytest.mark.datafiles(DATA_DIR) -def test_simple_build(cli, tmpdir, datafiles): - project = os.path.join(str(datafiles), 'foo') - copy_subprojects(project, datafiles, ['base']) - - checkoutdir = os.path.join(str(tmpdir), "checkout") - - # Build, checkout - result = cli.run(project=project, args=['build', 'target.bst']) - result.assert_success() - result = cli.run(project=project, args=['checkout', 'target.bst', checkoutdir]) - result.assert_success() - - # Check that the checkout contains the expected files from both projects - assert(os.path.exists(os.path.join(checkoutdir, 'base.txt'))) - assert(os.path.exists(os.path.join(checkoutdir, 'foo.txt'))) - - -@pytest.mark.datafiles(DATA_DIR) -def test_build_of_same_junction_used_twice(cli, tmpdir, datafiles): - project = os.path.join(str(datafiles), 'inconsistent-names') - - # Check we can build a project that contains the same junction - # that is used twice, but named differently - result = cli.run(project=project, args=['build', 'target.bst']) - result.assert_success() - - -@pytest.mark.datafiles(DATA_DIR) -def test_nested_simple(cli, tmpdir, datafiles): - foo = os.path.join(str(datafiles), 'foo') - copy_subprojects(foo, datafiles, ['base']) - - project = os.path.join(str(datafiles), 'nested') - copy_subprojects(project, datafiles, ['foo']) - - checkoutdir = os.path.join(str(tmpdir), "checkout") - - # Build, checkout - result = cli.run(project=project, args=['build', 'target.bst']) - result.assert_success() - result = cli.run(project=project, args=['checkout', 'target.bst', checkoutdir]) - result.assert_success() - - # Check that the checkout contains the expected files from all subprojects - assert(os.path.exists(os.path.join(checkoutdir, 'base.txt'))) - assert(os.path.exists(os.path.join(checkoutdir, 'foo.txt'))) - - -@pytest.mark.datafiles(DATA_DIR) -def test_nested_double(cli, tmpdir, datafiles): - foo = os.path.join(str(datafiles), 'foo') - copy_subprojects(foo, datafiles, ['base']) - - bar = os.path.join(str(datafiles), 'bar') - copy_subprojects(bar, datafiles, ['base']) - - project = os.path.join(str(datafiles), 'toplevel') - copy_subprojects(project, datafiles, ['base', 'foo', 'bar']) - - checkoutdir = os.path.join(str(tmpdir), "checkout") - - # Build, checkout - result = cli.run(project=project, args=['build', 'target.bst']) - result.assert_success() - result = cli.run(project=project, args=['checkout', 'target.bst', checkoutdir]) - result.assert_success() - - # Check that the checkout contains the expected files from all subprojects - assert(os.path.exists(os.path.join(checkoutdir, 'base.txt'))) - assert(os.path.exists(os.path.join(checkoutdir, 'foo.txt'))) - assert(os.path.exists(os.path.join(checkoutdir, 'bar.txt'))) - - -@pytest.mark.datafiles(DATA_DIR) -def test_nested_conflict(cli, datafiles): - foo = os.path.join(str(datafiles), 'foo') - copy_subprojects(foo, datafiles, ['base']) - - bar = os.path.join(str(datafiles), 'bar') - copy_subprojects(bar, datafiles, ['base']) - - project = os.path.join(str(datafiles), 'conflict') - copy_subprojects(project, datafiles, ['foo', 'bar']) - - result = cli.run(project=project, args=['build', 'target.bst']) - result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.CONFLICTING_JUNCTION) - - -# Test that we error correctly when the junction element itself is missing -@pytest.mark.datafiles(DATA_DIR) -def test_missing_junction(cli, datafiles): - project = os.path.join(str(datafiles), 'invalid') - - result = cli.run(project=project, args=['build', 'missing.bst']) - result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.MISSING_FILE) - - -# Test that we error correctly when an element is not found in the subproject -@pytest.mark.datafiles(DATA_DIR) -def test_missing_subproject_element(cli, datafiles): - project = os.path.join(str(datafiles), 'invalid') - copy_subprojects(project, datafiles, ['base']) - - result = cli.run(project=project, args=['build', 'missing-element.bst']) - result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.MISSING_FILE) - - -# Test that we error correctly when a junction itself has dependencies -@pytest.mark.datafiles(DATA_DIR) -def test_invalid_with_deps(cli, datafiles): - project = os.path.join(str(datafiles), 'invalid') - copy_subprojects(project, datafiles, ['base']) - - result = cli.run(project=project, args=['build', 'junction-with-deps.bst']) - result.assert_main_error(ErrorDomain.ELEMENT, 'element-forbidden-depends') - - -# Test that we error correctly when a junction is directly depended on -@pytest.mark.datafiles(DATA_DIR) -def test_invalid_junction_dep(cli, datafiles): - project = os.path.join(str(datafiles), 'invalid') - copy_subprojects(project, datafiles, ['base']) - - result = cli.run(project=project, args=['build', 'junction-dep.bst']) - result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.INVALID_DATA) - - -@pytest.mark.datafiles(DATA_DIR) -def test_options_default(cli, tmpdir, datafiles): - project = os.path.join(str(datafiles), 'options-default') - copy_subprojects(project, datafiles, ['options-base']) - - checkoutdir = os.path.join(str(tmpdir), "checkout") - - # Build, checkout - result = cli.run(project=project, args=['build', 'target.bst']) - result.assert_success() - result = cli.run(project=project, args=['checkout', 'target.bst', checkoutdir]) - result.assert_success() - - assert(os.path.exists(os.path.join(checkoutdir, 'pony.txt'))) - assert(not os.path.exists(os.path.join(checkoutdir, 'horsy.txt'))) - - -@pytest.mark.datafiles(DATA_DIR) -def test_options(cli, tmpdir, datafiles): - project = os.path.join(str(datafiles), 'options') - copy_subprojects(project, datafiles, ['options-base']) - - checkoutdir = os.path.join(str(tmpdir), "checkout") - - # Build, checkout - result = cli.run(project=project, args=['build', 'target.bst']) - result.assert_success() - result = cli.run(project=project, args=['checkout', 'target.bst', checkoutdir]) - result.assert_success() - - assert(not os.path.exists(os.path.join(checkoutdir, 'pony.txt'))) - assert(os.path.exists(os.path.join(checkoutdir, 'horsy.txt'))) - - -@pytest.mark.datafiles(DATA_DIR) -def test_options_inherit(cli, tmpdir, datafiles): - project = os.path.join(str(datafiles), 'options-inherit') - copy_subprojects(project, datafiles, ['options-base']) - - checkoutdir = os.path.join(str(tmpdir), "checkout") - - # Build, checkout - result = cli.run(project=project, args=['build', 'target.bst']) - result.assert_success() - result = cli.run(project=project, args=['checkout', 'target.bst', checkoutdir]) - result.assert_success() - - assert(not os.path.exists(os.path.join(checkoutdir, 'pony.txt'))) - assert(os.path.exists(os.path.join(checkoutdir, 'horsy.txt'))) - - -@pytest.mark.skipif(HAVE_GIT is False, reason="git is not available") -@pytest.mark.datafiles(DATA_DIR) -def test_git_show(cli, tmpdir, datafiles): - project = os.path.join(str(datafiles), 'foo') - checkoutdir = os.path.join(str(tmpdir), "checkout") - - # Create the repo from 'base' subdir - repo = create_repo('git', str(tmpdir)) - ref = repo.create(os.path.join(str(datafiles), 'base')) - - # Write out junction element with git source - element = { - 'kind': 'junction', - 'sources': [ - repo.source_config(ref=ref) - ] - } - _yaml.dump(element, os.path.join(project, 'base.bst')) - - # Verify that bst show does not implicitly fetch subproject - result = cli.run(project=project, args=['show', 'target.bst']) - result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.SUBPROJECT_FETCH_NEEDED) - - # Explicitly fetch subproject - result = cli.run(project=project, args=['source', 'fetch', 'base.bst']) - result.assert_success() - - # Check that bst show succeeds now and the pipeline includes the subproject element - element_list = cli.get_pipeline(project, ['target.bst']) - assert 'base.bst:target.bst' in element_list - - -@pytest.mark.skipif(HAVE_GIT is False, reason="git is not available") -@pytest.mark.datafiles(DATA_DIR) -def test_git_build(cli, tmpdir, datafiles): - project = os.path.join(str(datafiles), 'foo') - checkoutdir = os.path.join(str(tmpdir), "checkout") - - # Create the repo from 'base' subdir - repo = create_repo('git', str(tmpdir)) - ref = repo.create(os.path.join(str(datafiles), 'base')) - - # Write out junction element with git source - element = { - 'kind': 'junction', - 'sources': [ - repo.source_config(ref=ref) - ] - } - _yaml.dump(element, os.path.join(project, 'base.bst')) - - # Build (with implicit fetch of subproject), checkout - result = cli.run(project=project, args=['build', 'target.bst']) - result.assert_success() - result = cli.run(project=project, args=['checkout', 'target.bst', checkoutdir]) - result.assert_success() - - # Check that the checkout contains the expected files from both projects - assert(os.path.exists(os.path.join(checkoutdir, 'base.txt'))) - assert(os.path.exists(os.path.join(checkoutdir, 'foo.txt'))) - - -@pytest.mark.datafiles(DATA_DIR) -def test_cross_junction_names(cli, tmpdir, datafiles): - project = os.path.join(str(datafiles), 'foo') - copy_subprojects(project, datafiles, ['base']) - - element_list = cli.get_pipeline(project, ['base.bst:target.bst']) - assert 'base.bst:target.bst' in element_list - - -@pytest.mark.datafiles(DATA_DIR) -def test_build_git_cross_junction_names(cli, tmpdir, datafiles): - project = os.path.join(str(datafiles), 'foo') - checkoutdir = os.path.join(str(tmpdir), "checkout") - - # Create the repo from 'base' subdir - repo = create_repo('git', str(tmpdir)) - ref = repo.create(os.path.join(str(datafiles), 'base')) - - # Write out junction element with git source - element = { - 'kind': 'junction', - 'sources': [ - repo.source_config(ref=ref) - ] - } - _yaml.dump(element, os.path.join(project, 'base.bst')) - - print(element) - print(cli.get_pipeline(project, ['base.bst'])) - - # Build (with implicit fetch of subproject), checkout - result = cli.run(project=project, args=['build', 'base.bst:target.bst']) - result.assert_success() - result = cli.run(project=project, args=['checkout', 'base.bst:target.bst', checkoutdir]) - result.assert_success() - - # Check that the checkout contains the expected files from both projects - assert(os.path.exists(os.path.join(checkoutdir, 'base.txt'))) diff --git a/tests/loader/junctions/bar/app.bst b/tests/loader/junctions/bar/app.bst deleted file mode 100644 index a1a7a0ed9..000000000 --- a/tests/loader/junctions/bar/app.bst +++ /dev/null @@ -1,7 +0,0 @@ -kind: import -sources: -- kind: local - path: bar.txt -depends: -- junction: base.bst - filename: target.bst diff --git a/tests/loader/junctions/bar/bar.txt b/tests/loader/junctions/bar/bar.txt deleted file mode 100644 index 5716ca598..000000000 --- a/tests/loader/junctions/bar/bar.txt +++ /dev/null @@ -1 +0,0 @@ -bar diff --git a/tests/loader/junctions/bar/base.bst b/tests/loader/junctions/bar/base.bst deleted file mode 100644 index 10ce559a9..000000000 --- a/tests/loader/junctions/bar/base.bst +++ /dev/null @@ -1,4 +0,0 @@ -kind: junction -sources: -- kind: local - path: base diff --git a/tests/loader/junctions/bar/project.conf b/tests/loader/junctions/bar/project.conf deleted file mode 100644 index f8ed6621d..000000000 --- a/tests/loader/junctions/bar/project.conf +++ /dev/null @@ -1 +0,0 @@ -name: bar diff --git a/tests/loader/junctions/bar/target.bst b/tests/loader/junctions/bar/target.bst deleted file mode 100644 index 70b78a3fc..000000000 --- a/tests/loader/junctions/bar/target.bst +++ /dev/null @@ -1,5 +0,0 @@ -kind: stack -depends: -- junction: base.bst - filename: target.bst -- app.bst diff --git a/tests/loader/junctions/base/base.txt b/tests/loader/junctions/base/base.txt deleted file mode 100644 index a496efee8..000000000 --- a/tests/loader/junctions/base/base.txt +++ /dev/null @@ -1 +0,0 @@ -This is a text file diff --git a/tests/loader/junctions/base/project.conf b/tests/loader/junctions/base/project.conf deleted file mode 100644 index 951ea1a34..000000000 --- a/tests/loader/junctions/base/project.conf +++ /dev/null @@ -1 +0,0 @@ -name: base diff --git a/tests/loader/junctions/base/target.bst b/tests/loader/junctions/base/target.bst deleted file mode 100644 index 2b61c518b..000000000 --- a/tests/loader/junctions/base/target.bst +++ /dev/null @@ -1,4 +0,0 @@ -kind: import -sources: -- kind: local - path: base.txt diff --git a/tests/loader/junctions/conflict/bar.bst b/tests/loader/junctions/conflict/bar.bst deleted file mode 100644 index 62eee825a..000000000 --- a/tests/loader/junctions/conflict/bar.bst +++ /dev/null @@ -1,4 +0,0 @@ -kind: junction -sources: -- kind: local - path: bar diff --git a/tests/loader/junctions/conflict/foo.bst b/tests/loader/junctions/conflict/foo.bst deleted file mode 100644 index 1feb4010b..000000000 --- a/tests/loader/junctions/conflict/foo.bst +++ /dev/null @@ -1,4 +0,0 @@ -kind: junction -sources: -- kind: local - path: foo diff --git a/tests/loader/junctions/conflict/project.conf b/tests/loader/junctions/conflict/project.conf deleted file mode 100644 index 395bb8423..000000000 --- a/tests/loader/junctions/conflict/project.conf +++ /dev/null @@ -1 +0,0 @@ -name: conflict diff --git a/tests/loader/junctions/conflict/target.bst b/tests/loader/junctions/conflict/target.bst deleted file mode 100644 index 5e280e542..000000000 --- a/tests/loader/junctions/conflict/target.bst +++ /dev/null @@ -1,6 +0,0 @@ -kind: stack -depends: -- junction: foo.bst - filename: target.bst -- junction: bar.bst - filename: target.bst diff --git a/tests/loader/junctions/foo/app.bst b/tests/loader/junctions/foo/app.bst deleted file mode 100644 index e658628b0..000000000 --- a/tests/loader/junctions/foo/app.bst +++ /dev/null @@ -1,7 +0,0 @@ -kind: import -sources: -- kind: local - path: foo.txt -depends: -- junction: base.bst - filename: target.bst diff --git a/tests/loader/junctions/foo/base.bst b/tests/loader/junctions/foo/base.bst deleted file mode 100644 index 10ce559a9..000000000 --- a/tests/loader/junctions/foo/base.bst +++ /dev/null @@ -1,4 +0,0 @@ -kind: junction -sources: -- kind: local - path: base diff --git a/tests/loader/junctions/foo/foo.txt b/tests/loader/junctions/foo/foo.txt deleted file mode 100644 index 257cc5642..000000000 --- a/tests/loader/junctions/foo/foo.txt +++ /dev/null @@ -1 +0,0 @@ -foo diff --git a/tests/loader/junctions/foo/project.conf b/tests/loader/junctions/foo/project.conf deleted file mode 100644 index 5a240e3ed..000000000 --- a/tests/loader/junctions/foo/project.conf +++ /dev/null @@ -1 +0,0 @@ -name: foo diff --git a/tests/loader/junctions/foo/target.bst b/tests/loader/junctions/foo/target.bst deleted file mode 100644 index 70b78a3fc..000000000 --- a/tests/loader/junctions/foo/target.bst +++ /dev/null @@ -1,5 +0,0 @@ -kind: stack -depends: -- junction: base.bst - filename: target.bst -- app.bst diff --git a/tests/loader/junctions/inconsistent-names/elements/junction-A.bst b/tests/loader/junctions/inconsistent-names/elements/junction-A.bst deleted file mode 100644 index 74079f990..000000000 --- a/tests/loader/junctions/inconsistent-names/elements/junction-A.bst +++ /dev/null @@ -1,4 +0,0 @@ -kind: junction -sources: -- kind: local - path: junctionA diff --git a/tests/loader/junctions/inconsistent-names/elements/junction-B-diff-name.bst b/tests/loader/junctions/inconsistent-names/elements/junction-B-diff-name.bst deleted file mode 100644 index 3b33406e5..000000000 --- a/tests/loader/junctions/inconsistent-names/elements/junction-B-diff-name.bst +++ /dev/null @@ -1,4 +0,0 @@ -kind: junction -sources: -- kind: local - path: junctionA/junctionB diff --git a/tests/loader/junctions/inconsistent-names/elements/target.bst b/tests/loader/junctions/inconsistent-names/elements/target.bst deleted file mode 100644 index 7eba141de..000000000 --- a/tests/loader/junctions/inconsistent-names/elements/target.bst +++ /dev/null @@ -1,9 +0,0 @@ -kind: import -sources: -- kind: local - path: files/foo -depends: -- filename: lib2.bst - junction: junction-B-diff-name.bst -- filename: lib.bst - junction: junction-A.bst diff --git a/tests/loader/junctions/inconsistent-names/files/foo b/tests/loader/junctions/inconsistent-names/files/foo deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/loader/junctions/inconsistent-names/junctionA/elements/app.bst b/tests/loader/junctions/inconsistent-names/junctionA/elements/app.bst deleted file mode 100644 index 473aaee0b..000000000 --- a/tests/loader/junctions/inconsistent-names/junctionA/elements/app.bst +++ /dev/null @@ -1,6 +0,0 @@ -kind: import -sources: -- kind: local - path: files/app -depends: -- lib.bst diff --git a/tests/loader/junctions/inconsistent-names/junctionA/elements/junction-B.bst b/tests/loader/junctions/inconsistent-names/junctionA/elements/junction-B.bst deleted file mode 100644 index bc66d7851..000000000 --- a/tests/loader/junctions/inconsistent-names/junctionA/elements/junction-B.bst +++ /dev/null @@ -1,4 +0,0 @@ -kind: junction -sources: -- kind: local - path: junctionB diff --git a/tests/loader/junctions/inconsistent-names/junctionA/elements/lib.bst b/tests/loader/junctions/inconsistent-names/junctionA/elements/lib.bst deleted file mode 100644 index 684a64315..000000000 --- a/tests/loader/junctions/inconsistent-names/junctionA/elements/lib.bst +++ /dev/null @@ -1,7 +0,0 @@ -kind: import -sources: -- kind: local - path: files/lib -depends: -- filename: base.bst - junction: junction-B.bst diff --git a/tests/loader/junctions/inconsistent-names/junctionA/files/app b/tests/loader/junctions/inconsistent-names/junctionA/files/app deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/loader/junctions/inconsistent-names/junctionA/files/lib b/tests/loader/junctions/inconsistent-names/junctionA/files/lib deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/loader/junctions/inconsistent-names/junctionA/junctionB/base/baseimg b/tests/loader/junctions/inconsistent-names/junctionA/junctionB/base/baseimg deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/loader/junctions/inconsistent-names/junctionA/junctionB/elements/base.bst b/tests/loader/junctions/inconsistent-names/junctionA/junctionB/elements/base.bst deleted file mode 100644 index ecdc57c79..000000000 --- a/tests/loader/junctions/inconsistent-names/junctionA/junctionB/elements/base.bst +++ /dev/null @@ -1,4 +0,0 @@ -kind: import -sources: -- kind: local - path: base diff --git a/tests/loader/junctions/inconsistent-names/junctionA/junctionB/elements/lib2.bst b/tests/loader/junctions/inconsistent-names/junctionA/junctionB/elements/lib2.bst deleted file mode 100644 index 5a7c17b99..000000000 --- a/tests/loader/junctions/inconsistent-names/junctionA/junctionB/elements/lib2.bst +++ /dev/null @@ -1,6 +0,0 @@ -kind: import -sources: -- kind: local - path: files/lib2 -depends: -- base.bst diff --git a/tests/loader/junctions/inconsistent-names/junctionA/junctionB/files/lib2 b/tests/loader/junctions/inconsistent-names/junctionA/junctionB/files/lib2 deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/loader/junctions/inconsistent-names/junctionA/junctionB/project.conf b/tests/loader/junctions/inconsistent-names/junctionA/junctionB/project.conf deleted file mode 100644 index 2e96170f8..000000000 --- a/tests/loader/junctions/inconsistent-names/junctionA/junctionB/project.conf +++ /dev/null @@ -1,5 +0,0 @@ -# Unique project name -name: projectB - -# Subdirectory where elements are stored -element-path: elements diff --git a/tests/loader/junctions/inconsistent-names/junctionA/project.conf b/tests/loader/junctions/inconsistent-names/junctionA/project.conf deleted file mode 100644 index 166c4b78c..000000000 --- a/tests/loader/junctions/inconsistent-names/junctionA/project.conf +++ /dev/null @@ -1,5 +0,0 @@ -# Unique project name -name: projectA - -# Subdirectory where elements are stored -element-path: elements diff --git a/tests/loader/junctions/inconsistent-names/project.conf b/tests/loader/junctions/inconsistent-names/project.conf deleted file mode 100644 index 064bbc588..000000000 --- a/tests/loader/junctions/inconsistent-names/project.conf +++ /dev/null @@ -1,5 +0,0 @@ -# Unique project name -name: inconsistent-names - -# Subdirectory where elements are stored -element-path: elements diff --git a/tests/loader/junctions/invalid/app.bst b/tests/loader/junctions/invalid/app.bst deleted file mode 100644 index 9906149a6..000000000 --- a/tests/loader/junctions/invalid/app.bst +++ /dev/null @@ -1,4 +0,0 @@ -kind: import -sources: -- kind: local - path: foo.txt diff --git a/tests/loader/junctions/invalid/base-with-deps.bst b/tests/loader/junctions/invalid/base-with-deps.bst deleted file mode 100644 index a30eb3a52..000000000 --- a/tests/loader/junctions/invalid/base-with-deps.bst +++ /dev/null @@ -1,6 +0,0 @@ -kind: junction -sources: -- kind: local - path: base -depends: -- app.bst diff --git a/tests/loader/junctions/invalid/base.bst b/tests/loader/junctions/invalid/base.bst deleted file mode 100644 index 10ce559a9..000000000 --- a/tests/loader/junctions/invalid/base.bst +++ /dev/null @@ -1,4 +0,0 @@ -kind: junction -sources: -- kind: local - path: base diff --git a/tests/loader/junctions/invalid/foo.txt b/tests/loader/junctions/invalid/foo.txt deleted file mode 100644 index 257cc5642..000000000 --- a/tests/loader/junctions/invalid/foo.txt +++ /dev/null @@ -1 +0,0 @@ -foo diff --git a/tests/loader/junctions/invalid/junction-dep.bst b/tests/loader/junctions/invalid/junction-dep.bst deleted file mode 100644 index 20fd30011..000000000 --- a/tests/loader/junctions/invalid/junction-dep.bst +++ /dev/null @@ -1,3 +0,0 @@ -kind: stack -depends: -- base.bst diff --git a/tests/loader/junctions/invalid/junction-with-deps.bst b/tests/loader/junctions/invalid/junction-with-deps.bst deleted file mode 100644 index d2ca337dd..000000000 --- a/tests/loader/junctions/invalid/junction-with-deps.bst +++ /dev/null @@ -1,4 +0,0 @@ -kind: stack -depends: -- junction: base-with-deps.bst - filename: target.bst diff --git a/tests/loader/junctions/invalid/missing-element.bst b/tests/loader/junctions/invalid/missing-element.bst deleted file mode 100644 index 4c29221af..000000000 --- a/tests/loader/junctions/invalid/missing-element.bst +++ /dev/null @@ -1,9 +0,0 @@ -# This refers to the `foo.bst` element through -# the `base.bst` junction. The `base.bst` junction -# exists but the `foo.bst` element does not exist -# in the subproject. -# -kind: stack -depends: -- junction: base.bst - filename: foo.bst diff --git a/tests/loader/junctions/invalid/missing.bst b/tests/loader/junctions/invalid/missing.bst deleted file mode 100644 index 672e967fe..000000000 --- a/tests/loader/junctions/invalid/missing.bst +++ /dev/null @@ -1,4 +0,0 @@ -kind: stack -depends: -- junction: missingfile.bst - filename: target.bst diff --git a/tests/loader/junctions/invalid/project.conf b/tests/loader/junctions/invalid/project.conf deleted file mode 100644 index 38070bf71..000000000 --- a/tests/loader/junctions/invalid/project.conf +++ /dev/null @@ -1 +0,0 @@ -name: invalid diff --git a/tests/loader/junctions/nested/foo.bst b/tests/loader/junctions/nested/foo.bst deleted file mode 100644 index 1feb4010b..000000000 --- a/tests/loader/junctions/nested/foo.bst +++ /dev/null @@ -1,4 +0,0 @@ -kind: junction -sources: -- kind: local - path: foo diff --git a/tests/loader/junctions/nested/project.conf b/tests/loader/junctions/nested/project.conf deleted file mode 100644 index 551f51c6a..000000000 --- a/tests/loader/junctions/nested/project.conf +++ /dev/null @@ -1 +0,0 @@ -name: nested diff --git a/tests/loader/junctions/nested/target.bst b/tests/loader/junctions/nested/target.bst deleted file mode 100644 index db59499a7..000000000 --- a/tests/loader/junctions/nested/target.bst +++ /dev/null @@ -1,4 +0,0 @@ -kind: stack -depends: -- junction: foo.bst - filename: target.bst diff --git a/tests/loader/junctions/options-base/horsy.txt b/tests/loader/junctions/options-base/horsy.txt deleted file mode 100644 index 063dad656..000000000 --- a/tests/loader/junctions/options-base/horsy.txt +++ /dev/null @@ -1 +0,0 @@ -horsy diff --git a/tests/loader/junctions/options-base/pony.txt b/tests/loader/junctions/options-base/pony.txt deleted file mode 100644 index f62144808..000000000 --- a/tests/loader/junctions/options-base/pony.txt +++ /dev/null @@ -1 +0,0 @@ -pony diff --git a/tests/loader/junctions/options-base/project.conf b/tests/loader/junctions/options-base/project.conf deleted file mode 100644 index a98ebd5ed..000000000 --- a/tests/loader/junctions/options-base/project.conf +++ /dev/null @@ -1,9 +0,0 @@ -name: options-base -options: - animal: - type: enum - description: The kind of animal - values: - - pony - - horsy - default: pony diff --git a/tests/loader/junctions/options-base/target.bst b/tests/loader/junctions/options-base/target.bst deleted file mode 100644 index cda17af98..000000000 --- a/tests/loader/junctions/options-base/target.bst +++ /dev/null @@ -1,8 +0,0 @@ -kind: import -sources: -- kind: local - (?): - - animal == "pony": - path: pony.txt - - animal == "horsy": - path: horsy.txt diff --git a/tests/loader/junctions/options-default/base.bst b/tests/loader/junctions/options-default/base.bst deleted file mode 100644 index 5d42e5c31..000000000 --- a/tests/loader/junctions/options-default/base.bst +++ /dev/null @@ -1,4 +0,0 @@ -kind: junction -sources: -- kind: local - path: options-base diff --git a/tests/loader/junctions/options-default/project.conf b/tests/loader/junctions/options-default/project.conf deleted file mode 100644 index b9e58a582..000000000 --- a/tests/loader/junctions/options-default/project.conf +++ /dev/null @@ -1 +0,0 @@ -name: options-default diff --git a/tests/loader/junctions/options-default/target.bst b/tests/loader/junctions/options-default/target.bst deleted file mode 100644 index 8395c0c77..000000000 --- a/tests/loader/junctions/options-default/target.bst +++ /dev/null @@ -1,4 +0,0 @@ -kind: stack -depends: -- junction: base.bst - filename: target.bst diff --git a/tests/loader/junctions/options-inherit/base.bst b/tests/loader/junctions/options-inherit/base.bst deleted file mode 100644 index 8623d0d01..000000000 --- a/tests/loader/junctions/options-inherit/base.bst +++ /dev/null @@ -1,7 +0,0 @@ -kind: junction -sources: -- kind: local - path: options-base -config: - options: - animal: '%{animal}' diff --git a/tests/loader/junctions/options-inherit/project.conf b/tests/loader/junctions/options-inherit/project.conf deleted file mode 100644 index 1e0ea4464..000000000 --- a/tests/loader/junctions/options-inherit/project.conf +++ /dev/null @@ -1,10 +0,0 @@ -name: options-inherit -options: - animal: - type: enum - description: The kind of animal - values: - - pony - - horsy - default: horsy - variable: animal diff --git a/tests/loader/junctions/options-inherit/target.bst b/tests/loader/junctions/options-inherit/target.bst deleted file mode 100644 index 8395c0c77..000000000 --- a/tests/loader/junctions/options-inherit/target.bst +++ /dev/null @@ -1,4 +0,0 @@ -kind: stack -depends: -- junction: base.bst - filename: target.bst diff --git a/tests/loader/junctions/options/base.bst b/tests/loader/junctions/options/base.bst deleted file mode 100644 index a100e5e1e..000000000 --- a/tests/loader/junctions/options/base.bst +++ /dev/null @@ -1,7 +0,0 @@ -kind: junction -sources: -- kind: local - path: options-base -config: - options: - animal: horsy diff --git a/tests/loader/junctions/options/project.conf b/tests/loader/junctions/options/project.conf deleted file mode 100644 index de53ae176..000000000 --- a/tests/loader/junctions/options/project.conf +++ /dev/null @@ -1 +0,0 @@ -name: options diff --git a/tests/loader/junctions/options/target.bst b/tests/loader/junctions/options/target.bst deleted file mode 100644 index 8395c0c77..000000000 --- a/tests/loader/junctions/options/target.bst +++ /dev/null @@ -1,4 +0,0 @@ -kind: stack -depends: -- junction: base.bst - filename: target.bst diff --git a/tests/loader/junctions/toplevel/bar.bst b/tests/loader/junctions/toplevel/bar.bst deleted file mode 100644 index 62eee825a..000000000 --- a/tests/loader/junctions/toplevel/bar.bst +++ /dev/null @@ -1,4 +0,0 @@ -kind: junction -sources: -- kind: local - path: bar diff --git a/tests/loader/junctions/toplevel/base.bst b/tests/loader/junctions/toplevel/base.bst deleted file mode 100644 index 10ce559a9..000000000 --- a/tests/loader/junctions/toplevel/base.bst +++ /dev/null @@ -1,4 +0,0 @@ -kind: junction -sources: -- kind: local - path: base diff --git a/tests/loader/junctions/toplevel/foo.bst b/tests/loader/junctions/toplevel/foo.bst deleted file mode 100644 index 1feb4010b..000000000 --- a/tests/loader/junctions/toplevel/foo.bst +++ /dev/null @@ -1,4 +0,0 @@ -kind: junction -sources: -- kind: local - path: foo diff --git a/tests/loader/junctions/toplevel/project.conf b/tests/loader/junctions/toplevel/project.conf deleted file mode 100644 index 496c82128..000000000 --- a/tests/loader/junctions/toplevel/project.conf +++ /dev/null @@ -1 +0,0 @@ -name: toplevel diff --git a/tests/loader/junctions/toplevel/target.bst b/tests/loader/junctions/toplevel/target.bst deleted file mode 100644 index 5e280e542..000000000 --- a/tests/loader/junctions/toplevel/target.bst +++ /dev/null @@ -1,6 +0,0 @@ -kind: stack -depends: -- junction: foo.bst - filename: target.bst -- junction: bar.bst - filename: target.bst -- cgit v1.2.1