summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Maat <tristan.maat@codethink.co.uk>2017-11-07 18:07:20 +0000
committerTristan Maat <tristan.maat@codethink.co.uk>2017-11-07 18:07:20 +0000
commit2f18e6511058cbe2f929cdecc4320a09832c799a (patch)
treeeb3553920e47554d5a4ac3fb18ba143c4a24beba
parente5929c7ee5551dc3575f7975d4224607e130ad2e (diff)
downloadbuildstream-multiple_targets.tar.gz
-rw-r--r--tests/pipeline/load.py12
-rw-r--r--tests/plugins/pipeline.py2
-rw-r--r--tests/project/plugins.py2
-rw-r--r--tests/variables/variables.py2
4 files changed, 11 insertions, 7 deletions
diff --git a/tests/pipeline/load.py b/tests/pipeline/load.py
index 90b19ee7e..bb3e1b5b0 100644
--- a/tests/pipeline/load.py
+++ b/tests/pipeline/load.py
@@ -13,15 +13,19 @@ DATA_DIR = os.path.join(
)
-def create_pipeline(tmpdir, basedir, target):
+def create_pipeline(tmpdir, basedir, target, except_=[]):
context = Context([], 'x86_64')
project = Project(basedir, context)
context.deploydir = os.path.join(str(tmpdir), 'deploy')
context.artifactdir = os.path.join(str(tmpdir), 'artifact')
+ Platform._create_instance(context, project)
context._platform = Platform.get_platform()
- return Pipeline(context, project, [target])
+ # target = list(target)
+ # except_ = list(except_)
+
+ return Pipeline(context, project, [target], except_)
@pytest.mark.skipif(not HAVE_ROOT, reason="requires root permissions")
@@ -154,12 +158,12 @@ 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')
+ pipeline = create_pipeline(tmpdir, basedir, 'build.bst', ['second-level-1.bst'])
# Remove second-level-2 and check that the correct dependencies
# are removed.
element_list = pipeline.targets[0].dependencies(Scope.ALL)
- element_list = pipeline.remove_elements(element_list, ['second-level-1.bst'])
+ element_list = pipeline.remove_elements(element_list)
assert(set(e.name for e in element_list) ==
set(['build.bst', 'third-level-2.bst', 'fourth-level-2.bst',
diff --git a/tests/plugins/pipeline.py b/tests/plugins/pipeline.py
index 9f5e94ae9..8a2b2a51a 100644
--- a/tests/plugins/pipeline.py
+++ b/tests/plugins/pipeline.py
@@ -21,7 +21,7 @@ def create_pipeline(tmpdir, basedir, target):
context.artifactdir = os.path.join(str(tmpdir), 'artifact')
context._platform = Platform.get_platform()
- return Pipeline(context, project, [target])
+ return Pipeline(context, project, [target], [])
@pytest.mark.skipif(not HAVE_ROOT, reason="requires root permissions")
diff --git a/tests/project/plugins.py b/tests/project/plugins.py
index fd90de9aa..1476f57a8 100644
--- a/tests/project/plugins.py
+++ b/tests/project/plugins.py
@@ -19,7 +19,7 @@ def create_pipeline(tmpdir, basedir, target):
context.artifactdir = os.path.join(str(tmpdir), 'artifact')
context._platform = Platform.get_platform()
- return Pipeline(context, project, [target])
+ return Pipeline(context, project, [target], [])
# We've already validated that the plugin system works in
diff --git a/tests/variables/variables.py b/tests/variables/variables.py
index d6855591e..7ab0119b7 100644
--- a/tests/variables/variables.py
+++ b/tests/variables/variables.py
@@ -18,7 +18,7 @@ def create_pipeline(tmpdir, basedir, target):
context.artifactdir = os.path.join(str(tmpdir), 'artifact')
context._platform = Platform.get_platform()
- return Pipeline(context, project, [target])
+ return Pipeline(context, project, [target], [])
def assert_command(datafiles, tmpdir, target, command, expected):