diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-09-22 12:16:45 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-10-08 17:03:36 +0900 |
commit | bc8a2ebb3b0d8e0f535b2956b9c6a3ad0a05fcef (patch) | |
tree | 3539adb821e527613bb13bc4242ae0b6c1665532 | |
parent | e1df2e2d0a33667993c9800ca567b755037704a0 (diff) | |
download | buildstream-bc8a2ebb3b0d8e0f535b2956b9c6a3ad0a05fcef.tar.gz |
Updating test cases to construct the project/loader properly again.
This had changed when we added project variants and had to split
up the loading steps a bit, now all is back to normal without variants.
-rw-r--r-- | tests/completions/completions.py | 2 | ||||
-rw-r--r-- | tests/loader/arches.py | 144 | ||||
-rw-r--r-- | tests/loader/arches/elements/variant-arch-conditional.bst | 25 | ||||
-rw-r--r-- | tests/loader/basics.py | 12 | ||||
-rw-r--r-- | tests/loader/dependencies.py | 20 | ||||
-rw-r--r-- | tests/pipeline/load.py | 16 | ||||
-rw-r--r-- | tests/plugins/pipeline.py | 12 | ||||
-rw-r--r-- | tests/project/plugins.py | 6 | ||||
-rw-r--r-- | tests/project/project.py | 6 | ||||
-rw-r--r-- | tests/sources/fixture.py | 3 | ||||
-rw-r--r-- | tests/variables/variables.py | 6 |
11 files changed, 44 insertions, 208 deletions
diff --git a/tests/completions/completions.py b/tests/completions/completions.py index b66950476..e20af4605 100644 --- a/tests/completions/completions.py +++ b/tests/completions/completions.py @@ -99,7 +99,7 @@ def test_commands(cli, cmd, word_idx, expected): ('bst --l', 1, ['--log-file ']), # Test that options of subcommands also complete - ('bst --no-colors build -', 3, ['--all ', '--track ', '--variant ']), + ('bst --no-colors build -', 3, ['--all ', '--track ']), # Test the behavior of completing after an option that has a # parameter that cannot be completed, vs an option that has diff --git a/tests/loader/arches.py b/tests/loader/arches.py index eb823c6f3..041fbb7e1 100644 --- a/tests/loader/arches.py +++ b/tests/loader/arches.py @@ -19,7 +19,7 @@ def test_simple_conditional_nomatch(datafiles): basedir = os.path.join(datafiles.dirname, datafiles.basename) loader = Loader( - basedir, 'elements/simple-conditional.bst', None, 'arm', None, []) + basedir, 'elements/simple-conditional.bst', 'arm', None) element = loader.load() assert(isinstance(element, MetaElement)) @@ -34,7 +34,7 @@ def test_simple_conditional_x86_64(datafiles): basedir = os.path.join(datafiles.dirname, datafiles.basename) loader = Loader( - basedir, 'elements/simple-conditional.bst', None, 'x86_64', None, []) + basedir, 'elements/simple-conditional.bst', 'x86_64', None) element = loader.load() assert(isinstance(element, MetaElement)) @@ -49,7 +49,7 @@ def test_simple_conditional_x86_32(datafiles): basedir = os.path.join(datafiles.dirname, datafiles.basename) loader = Loader( - basedir, 'elements/simple-conditional.bst', None, 'x86_32', None, []) + basedir, 'elements/simple-conditional.bst', 'x86_32', None) element = loader.load() assert(isinstance(element, MetaElement)) @@ -69,7 +69,7 @@ def test_host_arch_conditional_armv8(datafiles): basedir = os.path.join(datafiles.dirname, datafiles.basename) loader = Loader( - basedir, 'elements/host-arch-conditional.bst', None, 'armv8', None, []) + basedir, 'elements/host-arch-conditional.bst', 'armv8', None) element = loader.load() assert(isinstance(element, MetaElement)) @@ -84,7 +84,7 @@ def test_host_arch_conditional_ignores_target_arch(datafiles): basedir = os.path.join(datafiles.dirname, datafiles.basename) loader = Loader( - basedir, 'elements/host-arch-conditional.bst', None, 'armv8', 'x86_32', []) + basedir, 'elements/host-arch-conditional.bst', 'armv8', 'x86_32') element = loader.load() assert(isinstance(element, MetaElement)) @@ -100,7 +100,7 @@ def test_host_arch_conditional_overridden(datafiles): basedir = os.path.join(datafiles.dirname, datafiles.basename) loader = Loader( - basedir, 'elements/host-arch-conditional.bst', None, 'armv8', 'x86_64', []) + basedir, 'elements/host-arch-conditional.bst', 'armv8', 'x86_64') element = loader.load() assert(isinstance(element, MetaElement)) @@ -109,135 +109,3 @@ def test_host_arch_conditional_overridden(datafiles): # The 'arches' conditional follows the target architecture, and overrides # anything specified in 'host-arches'. assert(number == 6) - - -############################################################## -# Test Arch Conditionals inside Variants # -############################################################## -@pytest.mark.datafiles(DATA_DIR) -def test_variant_arch_default(datafiles): - - basedir = os.path.join(datafiles.dirname, datafiles.basename) - loader = Loader( - basedir, 'elements/variant-arch-conditional.bst', None, 'arm', None, []) - - element = loader.load() - assert(isinstance(element, MetaElement)) - number = element.config.get('number') - - # The default "pink" variant sets number to 6 - assert(number == 6) - - -@pytest.mark.datafiles(DATA_DIR) -def test_variant_arch_default_x86_64(datafiles): - - basedir = os.path.join(datafiles.dirname, datafiles.basename) - loader = Loader( - basedir, 'elements/variant-arch-conditional.bst', None, 'x86_64', None, []) - - element = loader.load() - assert(isinstance(element, MetaElement)) - number = element.config.get('number') - - assert(number == 7) - - -@pytest.mark.datafiles(DATA_DIR) -def test_variant_arch_default_x86_32(datafiles): - - basedir = os.path.join(datafiles.dirname, datafiles.basename) - loader = Loader( - basedir, 'elements/variant-arch-conditional.bst', None, 'x86_32', None, []) - - element = loader.load() - assert(isinstance(element, MetaElement)) - number = element.config.get('number') - - assert(number == 8) - - -@pytest.mark.datafiles(DATA_DIR) -def test_variant_arch_pink_pony(datafiles): - - basedir = os.path.join(datafiles.dirname, datafiles.basename) - loader = Loader( - basedir, 'elements/variant-arch-conditional.bst', 'pink', 'arm', None, []) - - element = loader.load() - assert(isinstance(element, MetaElement)) - number = element.config.get('number') - - # The default "pink" variant sets number to 6 - assert(number == 6) - - -@pytest.mark.datafiles(DATA_DIR) -def test_variant_arch_pink_pony_x86_64(datafiles): - - basedir = os.path.join(datafiles.dirname, datafiles.basename) - loader = Loader( - basedir, 'elements/variant-arch-conditional.bst', 'pink', 'x86_64', None, []) - - element = loader.load() - assert(isinstance(element, MetaElement)) - number = element.config.get('number') - - assert(number == 7) - - -@pytest.mark.datafiles(DATA_DIR) -def test_variant_arch_pink_pony_x86_32(datafiles): - - basedir = os.path.join(datafiles.dirname, datafiles.basename) - loader = Loader( - basedir, 'elements/variant-arch-conditional.bst', 'pink', 'x86_32', None, []) - - element = loader.load() - assert(isinstance(element, MetaElement)) - number = element.config.get('number') - - assert(number == 8) - - -@pytest.mark.datafiles(DATA_DIR) -def test_variant_arch_blue_pony(datafiles): - - basedir = os.path.join(datafiles.dirname, datafiles.basename) - loader = Loader( - basedir, 'elements/variant-arch-conditional.bst', 'blue', 'arm', None, []) - - element = loader.load() - assert(isinstance(element, MetaElement)) - number = element.config.get('number') - - # The "blue" variant sets number to 4 - assert(number == 4) - - -@pytest.mark.datafiles(DATA_DIR) -def test_variant_arch_blue_pony_x86_64(datafiles): - - basedir = os.path.join(datafiles.dirname, datafiles.basename) - loader = Loader( - basedir, 'elements/variant-arch-conditional.bst', 'blue', 'x86_64', None, []) - - element = loader.load() - assert(isinstance(element, MetaElement)) - number = element.config.get('number') - - assert(number == 3) - - -@pytest.mark.datafiles(DATA_DIR) -def test_variant_arch_blue_pony_x86_32(datafiles): - - basedir = os.path.join(datafiles.dirname, datafiles.basename) - loader = Loader( - basedir, 'elements/variant-arch-conditional.bst', 'blue', 'x86_32', None, []) - - element = loader.load() - assert(isinstance(element, MetaElement)) - number = element.config.get('number') - - assert(number == 2) diff --git a/tests/loader/arches/elements/variant-arch-conditional.bst b/tests/loader/arches/elements/variant-arch-conditional.bst deleted file mode 100644 index 1171911d7..000000000 --- a/tests/loader/arches/elements/variant-arch-conditional.bst +++ /dev/null @@ -1,25 +0,0 @@ -kind: pony -description: Test out arch conditionals nested inside variant declarations -config: - number: 5 -variants: -- variant: pink - config: - number: 6 - arches: - x86_64: - config: - number: 7 - x86_32: - config: - number: 8 -- variant: blue - config: - number: 4 - arches: - x86_64: - config: - number: 3 - x86_32: - config: - number: 2 diff --git a/tests/loader/basics.py b/tests/loader/basics.py index ef2a2158a..a395d3768 100644 --- a/tests/loader/basics.py +++ b/tests/loader/basics.py @@ -18,7 +18,7 @@ DATA_DIR = os.path.join( def test_one_file(datafiles): basedir = os.path.join(datafiles.dirname, datafiles.basename) - loader = Loader(basedir, 'elements/onefile.bst', None, None, None, []) + loader = Loader(basedir, 'elements/onefile.bst', None, None) element = loader.load() @@ -30,7 +30,7 @@ def test_one_file(datafiles): def test_missing_file(datafiles): basedir = os.path.join(datafiles.dirname, datafiles.basename) - loader = Loader(basedir, 'elements/missing.bst', None, None, None, []) + loader = Loader(basedir, 'elements/missing.bst', None, None) with pytest.raises(LoadError) as exc: element = loader.load() @@ -42,7 +42,7 @@ def test_missing_file(datafiles): def test_invalid_reference(datafiles): basedir = os.path.join(datafiles.dirname, datafiles.basename) - loader = Loader(basedir, 'elements/badreference.bst', None, None, None, []) + loader = Loader(basedir, 'elements/badreference.bst', None, None) with pytest.raises(LoadError) as exc: element = loader.load() @@ -54,7 +54,7 @@ def test_invalid_reference(datafiles): def test_invalid_yaml(datafiles): basedir = os.path.join(datafiles.dirname, datafiles.basename) - loader = Loader(basedir, 'elements/badfile.bst', None, None, None, []) + loader = Loader(basedir, 'elements/badfile.bst', None, None) with pytest.raises(LoadError) as exc: element = loader.load() @@ -69,7 +69,7 @@ def test_fail_fullpath_target(datafiles): fullpath = os.path.join(basedir, 'elements', 'onefile.bst') with pytest.raises(LoadError) as exc: - loader = Loader(basedir, fullpath, None, None, None, []) + loader = Loader(basedir, fullpath, None, None) assert (exc.value.reason == LoadErrorReason.INVALID_DATA) @@ -78,7 +78,7 @@ def test_fail_fullpath_target(datafiles): def test_invalid_key(datafiles): basedir = os.path.join(datafiles.dirname, datafiles.basename) - loader = Loader(basedir, 'elements/invalidkey.bst', None, None, None, []) + loader = Loader(basedir, 'elements/invalidkey.bst', None, None) with pytest.raises(LoadError) as exc: element = loader.load() diff --git a/tests/loader/dependencies.py b/tests/loader/dependencies.py index d4f9956c1..3850a0086 100644 --- a/tests/loader/dependencies.py +++ b/tests/loader/dependencies.py @@ -18,7 +18,7 @@ DATA_DIR = os.path.join( def test_two_files(datafiles): basedir = os.path.join(datafiles.dirname, datafiles.basename) - loader = Loader(basedir, 'elements/target.bst', None, None, None, []) + loader = Loader(basedir, 'elements/target.bst', None, None) element = loader.load() assert(isinstance(element, MetaElement)) @@ -34,7 +34,7 @@ def test_two_files(datafiles): def test_shared_dependency(datafiles): basedir = os.path.join(datafiles.dirname, datafiles.basename) - loader = Loader(basedir, 'elements/shareddeptarget.bst', None, None, None, []) + loader = Loader(basedir, 'elements/shareddeptarget.bst', None, None) element = loader.load() # Toplevel is 'pony' with 2 dependencies @@ -77,7 +77,7 @@ def test_shared_dependency(datafiles): def test_dependency_dict(datafiles): basedir = os.path.join(datafiles.dirname, datafiles.basename) - loader = Loader(basedir, 'elements/target-depdict.bst', None, None, None, []) + loader = Loader(basedir, 'elements/target-depdict.bst', None, None) element = loader.load() assert(isinstance(element, MetaElement)) @@ -92,7 +92,7 @@ def test_dependency_dict(datafiles): @pytest.mark.datafiles(DATA_DIR) def test_invalid_dependency_declaration(datafiles): basedir = os.path.join(datafiles.dirname, datafiles.basename) - loader = Loader(basedir, 'elements/invaliddep.bst', None, None, None, []) + loader = Loader(basedir, 'elements/invaliddep.bst', None, None) with pytest.raises(LoadError) as exc: element = loader.load() @@ -103,7 +103,7 @@ def test_invalid_dependency_declaration(datafiles): @pytest.mark.datafiles(DATA_DIR) def test_circular_dependency(datafiles): basedir = os.path.join(datafiles.dirname, datafiles.basename) - loader = Loader(basedir, 'elements/circulartarget.bst', None, None, None, []) + loader = Loader(basedir, 'elements/circulartarget.bst', None, None) with pytest.raises(LoadError) as exc: element = loader.load() @@ -114,7 +114,7 @@ def test_circular_dependency(datafiles): @pytest.mark.datafiles(DATA_DIR) def test_invalid_dependency_type(datafiles): basedir = os.path.join(datafiles.dirname, datafiles.basename) - loader = Loader(basedir, 'elements/invaliddeptype.bst', None, None, None, []) + loader = Loader(basedir, 'elements/invaliddeptype.bst', None, None) with pytest.raises(LoadError) as exc: element = loader.load() @@ -125,7 +125,7 @@ def test_invalid_dependency_type(datafiles): @pytest.mark.datafiles(DATA_DIR) def test_build_dependency(datafiles): basedir = os.path.join(datafiles.dirname, datafiles.basename) - loader = Loader(basedir, 'elements/builddep.bst', None, None, None, []) + loader = Loader(basedir, 'elements/builddep.bst', None, None) element = loader.load() assert(isinstance(element, MetaElement)) @@ -141,7 +141,7 @@ def test_build_dependency(datafiles): @pytest.mark.datafiles(DATA_DIR) def test_runtime_dependency(datafiles): basedir = os.path.join(datafiles.dirname, datafiles.basename) - loader = Loader(basedir, 'elements/runtimedep.bst', None, None, None, []) + loader = Loader(basedir, 'elements/runtimedep.bst', None, None) element = loader.load() assert(isinstance(element, MetaElement)) @@ -157,7 +157,7 @@ def test_runtime_dependency(datafiles): @pytest.mark.datafiles(DATA_DIR) def test_build_runtime_dependency(datafiles): basedir = os.path.join(datafiles.dirname, datafiles.basename) - loader = Loader(basedir, 'elements/target.bst', None, None, None, []) + loader = Loader(basedir, 'elements/target.bst', None, None) element = loader.load() assert(isinstance(element, MetaElement)) @@ -174,7 +174,7 @@ def test_build_runtime_dependency(datafiles): @pytest.mark.datafiles(DATA_DIR) def test_all_dependency(datafiles): basedir = os.path.join(datafiles.dirname, datafiles.basename) - loader = Loader(basedir, 'elements/alldep.bst', None, None, None, []) + loader = Loader(basedir, 'elements/alldep.bst', None, None) element = loader.load() assert(isinstance(element, MetaElement)) diff --git a/tests/pipeline/load.py b/tests/pipeline/load.py index a1db764dc..ef7aedc96 100644 --- a/tests/pipeline/load.py +++ b/tests/pipeline/load.py @@ -13,7 +13,7 @@ DATA_DIR = os.path.join( ) -def create_pipeline(tmpdir, basedir, target, variant): +def create_pipeline(tmpdir, basedir, target): context = Context('x86_64') project = Project(basedir, 'x86_64') @@ -21,7 +21,7 @@ def create_pipeline(tmpdir, basedir, target, variant): context.artifactdir = os.path.join(str(tmpdir), 'artifact') context._platform = Platform.get_platform(context, project) - return Pipeline(context, project, target, variant) + return Pipeline(context, project, target) @pytest.mark.skipif(not HAVE_ROOT, reason="requires root permissions") @@ -29,7 +29,7 @@ def create_pipeline(tmpdir, basedir, target, variant): def test_load_simple(datafiles, tmpdir): basedir = os.path.join(datafiles.dirname, datafiles.basename) - pipeline = create_pipeline(tmpdir, basedir, 'simple.bst', None) + pipeline = create_pipeline(tmpdir, basedir, 'simple.bst') assert(pipeline.target.get_kind() == "autotools") @@ -47,7 +47,7 @@ def test_load_simple(datafiles, tmpdir): def test_iterate_scope_all(datafiles, tmpdir): basedir = os.path.join(datafiles.dirname, datafiles.basename) - pipeline = create_pipeline(tmpdir, basedir, 'target.bst', None) + pipeline = create_pipeline(tmpdir, basedir, 'target.bst') assert(pipeline.target.get_kind() == "autotools") @@ -74,7 +74,7 @@ def test_iterate_scope_all(datafiles, tmpdir): def test_iterate_scope_run(datafiles, tmpdir): basedir = os.path.join(datafiles.dirname, datafiles.basename) - pipeline = create_pipeline(tmpdir, basedir, 'target.bst', None) + pipeline = create_pipeline(tmpdir, basedir, 'target.bst') assert(pipeline.target.get_kind() == "autotools") @@ -98,7 +98,7 @@ def test_iterate_scope_run(datafiles, tmpdir): def test_iterate_scope_build(datafiles, tmpdir): basedir = os.path.join(datafiles.dirname, datafiles.basename) - pipeline = create_pipeline(tmpdir, basedir, 'target.bst', None) + pipeline = create_pipeline(tmpdir, basedir, 'target.bst') assert(pipeline.target.get_kind() == "autotools") @@ -122,7 +122,7 @@ def test_iterate_scope_build(datafiles, tmpdir): def test_iterate_scope_build_of_child(datafiles, tmpdir): basedir = os.path.join(datafiles.dirname, datafiles.basename) - pipeline = create_pipeline(tmpdir, basedir, 'target.bst', None) + pipeline = create_pipeline(tmpdir, basedir, 'target.bst') assert(pipeline.target.get_kind() == "autotools") @@ -154,7 +154,7 @@ def test_iterate_scope_build_of_child(datafiles, tmpdir): def test_remove_elements(datafiles, tmpdir): basedir = os.path.join(datafiles.dirname, datafiles.basename) - pipeline = create_pipeline(tmpdir, basedir, 'build.bst', None) + pipeline = create_pipeline(tmpdir, basedir, 'build.bst') # Remove second-level-2 and check that the correct dependencies # are removed. diff --git a/tests/plugins/pipeline.py b/tests/plugins/pipeline.py index e44af789c..c8dcb32f8 100644 --- a/tests/plugins/pipeline.py +++ b/tests/plugins/pipeline.py @@ -13,7 +13,7 @@ DATA_DIR = os.path.join( ) -def create_pipeline(tmpdir, basedir, target, variant): +def create_pipeline(tmpdir, basedir, target): context = Context('x86_64') project = Project(basedir, 'x86_64') @@ -21,7 +21,7 @@ def create_pipeline(tmpdir, basedir, target, variant): context.artifactdir = os.path.join(str(tmpdir), 'artifact') context._platform = Platform.get_platform(context, project) - return Pipeline(context, project, target, variant) + return Pipeline(context, project, target) @pytest.mark.skipif(not HAVE_ROOT, reason="requires root permissions") @@ -29,7 +29,7 @@ def create_pipeline(tmpdir, basedir, target, variant): def test_customsource(datafiles, tmpdir): basedir = os.path.join(datafiles.dirname, datafiles.basename) - pipeline = create_pipeline(tmpdir, basedir, 'simple.bst', None) + pipeline = create_pipeline(tmpdir, basedir, 'simple.bst') assert(pipeline.target.get_kind() == "autotools") @@ -38,7 +38,7 @@ def test_customsource(datafiles, tmpdir): def test_customelement(datafiles, tmpdir): basedir = os.path.join(datafiles.dirname, datafiles.basename) - pipeline = create_pipeline(tmpdir, basedir, 'simple.bst', None) + pipeline = create_pipeline(tmpdir, basedir, 'simple.bst') assert(pipeline.target.get_kind() == "foo") @@ -48,7 +48,7 @@ def test_badversionsource(datafiles, tmpdir): basedir = os.path.join(datafiles.dirname, datafiles.basename) with pytest.raises(PluginError) as exc: - pipeline = create_pipeline(tmpdir, basedir, 'simple.bst', None) + pipeline = create_pipeline(tmpdir, basedir, 'simple.bst') @pytest.mark.skipif(not HAVE_ROOT, reason="requires root permissions") @@ -57,4 +57,4 @@ def test_badversionelement(datafiles, tmpdir): basedir = os.path.join(datafiles.dirname, datafiles.basename) with pytest.raises(PluginError) as exc: - pipeline = create_pipeline(tmpdir, basedir, 'simple.bst', None) + pipeline = create_pipeline(tmpdir, basedir, 'simple.bst') diff --git a/tests/project/plugins.py b/tests/project/plugins.py index 4aeb3fc09..3d4b38795 100644 --- a/tests/project/plugins.py +++ b/tests/project/plugins.py @@ -13,13 +13,13 @@ DATA_DIR = os.path.join( ) -def create_pipeline(tmpdir, basedir, target, variant): +def create_pipeline(tmpdir, basedir, target): context = Context('x86_64') project = Project(basedir, 'x86_64') context.artifactdir = os.path.join(str(tmpdir), 'artifact') context._platform = Platform.get_platform(context, project) - return Pipeline(context, project, target, variant) + return Pipeline(context, project, target) # We've already validated that the plugin system works in @@ -33,7 +33,7 @@ def create_pipeline(tmpdir, basedir, target, variant): def test_custom_element(datafiles, tmpdir): basedir = os.path.join(datafiles.dirname, datafiles.basename) - pipeline = create_pipeline(tmpdir, basedir, 'custom.bst', None) + pipeline = create_pipeline(tmpdir, basedir, 'custom.bst') element = pipeline.target assert(len(element._Element__sources) > 0) diff --git a/tests/project/project.py b/tests/project/project.py index f4c5b3ead..5b6c9740d 100644 --- a/tests/project/project.py +++ b/tests/project/project.py @@ -16,7 +16,6 @@ def test_missing_project_conf(datafiles): with pytest.raises(LoadError) as exc: project = Project(directory, 'x86_64') - project._resolve(None) assert (exc.value.reason == LoadErrorReason.MISSING_FILE) @@ -27,7 +26,6 @@ def test_missing_project_name(datafiles): with pytest.raises(LoadError) as exc: project = Project(directory, 'x86_64') - project._resolve(None) assert (exc.value.reason == LoadErrorReason.INVALID_DATA) @@ -37,7 +35,6 @@ def test_load_basic_project(datafiles): directory = os.path.join(datafiles.dirname, datafiles.basename, "basic") project = Project(directory, 'x86_64') - project._resolve(None) # User provided assert (project.name == "pony") @@ -53,7 +50,6 @@ def test_override_project_path(datafiles): directory = os.path.join(datafiles.dirname, datafiles.basename, "overridepath") project = Project(directory, 'x86_64') - project._resolve(None) # Test the override assert (project._environment['PATH'] == "/bin:/sbin") @@ -64,7 +60,6 @@ def test_project_alias(datafiles): directory = os.path.join(datafiles.dirname, datafiles.basename, "alias") project = Project(directory, 'x86_64') - project._resolve(None) # Test the override assert (project.translate_url('baserock:foo') == 'git://git.baserock.org/baserock/foo') @@ -77,6 +72,5 @@ def test_project_unsupported(datafiles): with pytest.raises(LoadError) as exc: project = Project(directory, 'x86_64') - project._resolve(None) assert (exc.value.reason == LoadErrorReason.UNSUPPORTED_PROJECT) diff --git a/tests/sources/fixture.py b/tests/sources/fixture.py index 0a32c16ba..0f1bdb8f6 100644 --- a/tests/sources/fixture.py +++ b/tests/sources/fixture.py @@ -35,9 +35,8 @@ class Setup(): if not os.path.exists(self.context.builddir): os.mkdir(self.context.builddir) - loader = Loader(directory, target, None, None, None, []) + loader = Loader(directory, target, None, None) element = loader.load() - self.project._resolve(loader.project_variant) # Allow repo aliases to access files in the directories using tmpdir and datafiles self.project._aliases['tmpdir'] = "file:///" + str(tmpdir) diff --git a/tests/variables/variables.py b/tests/variables/variables.py index 55a44b322..8cf84b6a4 100644 --- a/tests/variables/variables.py +++ b/tests/variables/variables.py @@ -12,18 +12,18 @@ DATA_DIR = os.path.join( ) -def create_pipeline(tmpdir, basedir, target, variant): +def create_pipeline(tmpdir, basedir, target): context = Context('x86_64') project = Project(basedir, 'x86_64') context.artifactdir = os.path.join(str(tmpdir), 'artifact') context._platform = Platform.get_platform(context, project) - return Pipeline(context, project, target, variant) + return Pipeline(context, project, target) def assert_command(datafiles, tmpdir, target, command, expected): basedir = os.path.join(datafiles.dirname, datafiles.basename) - pipeline = create_pipeline(tmpdir, basedir, target, None) + pipeline = create_pipeline(tmpdir, basedir, target) assert(isinstance(pipeline.target, BuildElement)) commands = pipeline.target.commands |