Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 108-integration-tests-not-idempotent-and-self-contained
  • 131-behavior-of-except-argument-is-frustrating-and-confusing
  • 132-loading-external-plugins-works-without-explicit-requirement-in-project-conf
  • 135-expire-artifacts-in-local-cache
  • 135-expire-artifacts-in-local-cache-clean
  • 138-aborting-bst-push-command-causes-stack-trace-3
  • 142-potentially-printing-provenance-more-than-once-in-loaderrors
  • 188-trigger-external-commands-on-certain-events
  • 214-filter-workspacing-rework
  • 218-allow-specifying-the-chroot-binary-to-use-for-sandboxes-on-unix-platforms
  • 239-use-pylint-for-linting
  • 372-allow-queues-to-run-auxilliary-jobs-after-an-element-s-job-finishes
  • 380-untagged-bst
  • 463-make-dependency-type-default-to-build
  • 537-mirror-fallback-does-not-work-for-git
  • 64-clarify-about-plugins-importing-other-plugins
  • 716-add-example-with-build-directory-outside-of-source-directory
  • 716-add-example-with-build-directory-outside-of-source-directory-2
  • 81-non-empty-read-only-directories-not-handled-during-bst-build-and-others
  • BenjaminSchubert/fix-quota-tests
  • Qinusty/235-manifest
  • Qinusty/397
  • Qinusty/470-bst-track-yaml-indent
  • Qinusty/553-backport-1.2
  • Qinusty/663-missing-cache-key-workspace-open
  • Qinusty/backport-576
  • Qinusty/backport-skipped-562
  • Qinusty/gitlab-ci
  • Qinusty/gitlab-ci-duration
  • Qinusty/message-helpers
  • Qinusty/pytest_cache_gitignore
  • abderrahim/cached-failure
  • abderrahim/cachekey-strictrebuild
  • abderrahim/cleanup-speedup
  • abderrahim/makemaker
  • abderrahim/resolve-remotes
  • abderrahim/source-cache
  • abderrahim/stage-artifact-scriptelement
  • abderrahim/virtual-extract
  • adamjones/contributing
  • adamjones/contribution-guide
  • aevri/assert_no_unexpected_size_writes
  • aevri/casdprocessmanager2
  • aevri/check_spawn_ci_working
  • aevri/enable_spawn_ci_4
  • aevri/enable_spawn_ci_6
  • aevri/enable_spawn_ci_7
  • aevri/json_artifact_meta
  • aevri/picklable_jobs
  • aevri/plugin_venvs
  • aevri/provenance_scope
  • aevri/pylint_ignore_argsdiff
  • aevri/safe_noninteractive
  • aevri/win32
  • aevri/win32_minimal
  • aevri/win32_minimal_seemstowork_20190829
  • aevri/win32_receive_signals
  • aevri/win32_temptext
  • alexfazakas/add-bst-init-argument
  • alexfazakas/use-merge-trains
  • always-do-linting
  • another-segfault
  • becky/locally_downloaded_files
  • becky/shell_launch_errors
  • bschubert/add-isolated-tests
  • bschubert/isort
  • bschubert/merge-parent-child-job
  • bschubert/more-mypy
  • bschubert/no-multiprocessing-bak
  • bschubert/no-multiprocessing-full
  • bschubert/optimize-deps
  • bschubert/optimize-element-init
  • bschubert/optimize-loader-sorting
  • bschubert/optimize-mapping-node
  • bschubert/optimize-splits
  • bschubert/remove-multiline-switch-for-re
  • bschubert/remove-parent-child-pipe
  • bschubert/remove-pip-source
  • bschubert/standardize-source-tests
  • bschubert/test-plugins
  • bschubert/update-coverage
  • bst-1
  • bst-1.0
  • bst-1.2
  • bst-1.4
  • bst-pull
  • bst-push
  • buildbox-pre-will
  • cache-key-v0
  • caching_build_trees
  • cascache_timeouts
  • chandan/automate-pypi-release
  • chandan/cli-deps
  • chandan/contrib-dependencies
  • chandan/element-cache
  • chandan/enums
  • chandan/extras-require
  • chandan/macos-multiprocessing
  • chandan/moar-parallelism
  • chandan/moar-runners
  • 1.0.0
  • 1.0.1
  • 1.1.0
  • 1.1.1
  • 1.1.2
  • 1.1.3
  • 1.1.4
  • 1.1.5
  • 1.1.6
  • 1.1.7
  • 1.2.0
  • 1.2.1
  • 1.2.2
  • 1.2.3
  • 1.2.4
  • 1.2.5
  • 1.2.6
  • 1.2.7
  • 1.2.8
  • 1.3.0
  • 1.3.1
  • 1.4.0
  • 1.4.1
  • 1.4.2
  • 1.4.3
  • 1.5.0
  • 1.5.1
  • 1.6.0
  • 1.6.1
  • 1.91.0
  • 1.91.1
  • 1.91.2
  • 1.91.3
  • 1.93.0
  • 1.93.1
  • 1.93.2
  • 1.93.3
  • 1.93.4
  • 1.93.5
  • CROSS_PLATFORM_SEPT_2017
  • PRE_CAS_MERGE_JULY_2018
  • bst-1-branchpoint
  • bst-1.2-branchpoint
  • bst-1.4-branchpoint
144 results

Target

Select target project
  • willsalmon/buildstream
  • CumHoleZH/buildstream
  • tchaik/buildstream
  • DCotyPortfolio/buildstream
  • jesusoctavioas/buildstream
  • patrickmmartin/buildstream
  • franred/buildstream
  • tintou/buildstream
  • alatiera/buildstream
  • martinblanchard/buildstream
  • neverdie22042524/buildstream
  • Mattlk13/buildstream
  • PServers/buildstream
  • phamnghia610909/buildstream
  • chiaratolentino/buildstream
  • eysz7-x-x/buildstream
  • kerrick1/buildstream
  • matthew-yates/buildstream
  • twofeathers/buildstream
  • mhadjimichael/buildstream
  • pointswaves/buildstream
  • Mr.JackWilson/buildstream
  • Tw3akG33k/buildstream
  • AlexFazakas/buildstream
  • eruidfkiy/buildstream
  • clamotion2/buildstream
  • nanonyme/buildstream
  • wickyjaaa/buildstream
  • nmanchev/buildstream
  • bojorquez.ja/buildstream
  • mostynb/buildstream
  • highpit74/buildstream
  • Demo112/buildstream
  • ba2014sheer/buildstream
  • tonimadrino/buildstream
  • usuario2o/buildstream
  • Angelika123456/buildstream
  • neo355/buildstream
  • corentin-ferlay/buildstream
  • coldtom/buildstream
  • wifitvbox81/buildstream
  • 358253885/buildstream
  • seanborg/buildstream
  • SotK/buildstream
  • DouglasWinship/buildstream
  • karansthr97/buildstream
  • louib/buildstream
  • bwh-ct/buildstream
  • robjh/buildstream
  • we88c0de/buildstream
  • zhengxian5555/buildstream
51 results
Select Git revision
  • 108-integration-tests-not-idempotent-and-self-contained
  • 131-behavior-of-except-argument-is-frustrating-and-confusing
  • 132-loading-external-plugins-works-without-explicit-requirement-in-project-conf
  • 135-expire-artifacts-in-local-cache
  • 135-expire-artifacts-in-local-cache-clean
  • 138-aborting-bst-push-command-causes-stack-trace-3
  • 142-potentially-printing-provenance-more-than-once-in-loaderrors
  • 188-trigger-external-commands-on-certain-events
  • 214-filter-workspacing-rework
  • 218-allow-specifying-the-chroot-binary-to-use-for-sandboxes-on-unix-platforms
  • 239-use-pylint-for-linting
  • 372-allow-queues-to-run-auxilliary-jobs-after-an-element-s-job-finishes
  • 380-untagged-bst
  • 463-make-dependency-type-default-to-build
  • 537-mirror-fallback-does-not-work-for-git
  • 64-clarify-about-plugins-importing-other-plugins
  • 716-add-example-with-build-directory-outside-of-source-directory
  • 716-add-example-with-build-directory-outside-of-source-directory-2
  • 81-non-empty-read-only-directories-not-handled-during-bst-build-and-others
  • BenjaminSchubert/fix-quota-tests
  • Qinusty/235-manifest
  • Qinusty/397
  • Qinusty/470-bst-track-yaml-indent
  • Qinusty/553-backport-1.2
  • Qinusty/663-missing-cache-key-workspace-open
  • Qinusty/backport-576
  • Qinusty/backport-skipped-562
  • Qinusty/gitlab-ci
  • Qinusty/gitlab-ci-duration
  • Qinusty/message-helpers
  • Qinusty/pytest_cache_gitignore
  • abderrahim/cached-failure
  • abderrahim/cachekey-strictrebuild
  • abderrahim/cleanup-speedup
  • abderrahim/makemaker
  • abderrahim/resolve-remotes
  • abderrahim/source-cache
  • abderrahim/stage-artifact-scriptelement
  • abderrahim/virtual-extract
  • adamjones/contributing
  • adamjones/contribution-guide
  • aevri/assert_no_unexpected_size_writes
  • aevri/casdprocessmanager2
  • aevri/check_spawn_ci_working
  • aevri/enable_spawn_ci_4
  • aevri/enable_spawn_ci_6
  • aevri/enable_spawn_ci_7
  • aevri/json_artifact_meta
  • aevri/picklable_jobs
  • aevri/plugin_venvs
  • aevri/provenance_scope
  • aevri/pylint_ignore_argsdiff
  • aevri/safe_noninteractive
  • aevri/win32
  • aevri/win32_minimal
  • aevri/win32_minimal_seemstowork_20190829
  • aevri/win32_receive_signals
  • aevri/win32_temptext
  • alexfazakas/add-bst-init-argument
  • alexfazakas/use-merge-trains
  • always-do-linting
  • another-segfault
  • becky/locally_downloaded_files
  • becky/shell_launch_errors
  • bschubert/add-isolated-tests
  • bschubert/isort
  • bschubert/merge-parent-child-job
  • bschubert/more-mypy
  • bschubert/no-multiprocessing-bak
  • bschubert/no-multiprocessing-full
  • bschubert/optimize-deps
  • bschubert/optimize-element-init
  • bschubert/optimize-loader-sorting
  • bschubert/optimize-mapping-node
  • bschubert/optimize-splits
  • bschubert/remove-multiline-switch-for-re
  • bschubert/remove-parent-child-pipe
  • bschubert/remove-pip-source
  • bschubert/standardize-source-tests
  • bschubert/test-plugins
  • bschubert/update-coverage
  • bst-1
  • bst-1.0
  • bst-1.2
  • bst-1.4
  • bst-pull
  • bst-push
  • buildbox-pre-will
  • cache-key-v0
  • caching_build_trees
  • cascache_timeouts
  • chandan/automate-pypi-release
  • chandan/cli-deps
  • chandan/contrib-dependencies
  • chandan/element-cache
  • chandan/enums
  • chandan/extras-require
  • chandan/macos-multiprocessing
  • chandan/moar-parallelism
  • chandan/moar-runners
  • 1.0.0
  • 1.0.1
  • 1.1.0
  • 1.1.1
  • 1.1.2
  • 1.1.3
  • 1.1.4
  • 1.1.5
  • 1.1.6
  • 1.1.7
  • 1.2.0
  • 1.2.1
  • 1.2.2
  • 1.2.3
  • 1.2.4
  • 1.2.5
  • 1.2.6
  • 1.2.7
  • 1.2.8
  • 1.3.0
  • 1.3.1
  • 1.4.0
  • 1.4.1
  • 1.4.2
  • 1.4.3
  • 1.5.0
  • 1.5.1
  • 1.6.0
  • 1.6.1
  • 1.91.0
  • 1.91.1
  • 1.91.2
  • 1.91.3
  • 1.93.0
  • 1.93.1
  • 1.93.2
  • 1.93.3
  • 1.93.4
  • 1.93.5
  • CROSS_PLATFORM_SEPT_2017
  • PRE_CAS_MERGE_JULY_2018
  • bst-1-branchpoint
  • bst-1.2-branchpoint
  • bst-1.4-branchpoint
144 results
Show changes
Commits on Source (4)
Showing
with 192 additions and 44 deletions
......@@ -17,7 +17,7 @@
# Authors:
# Tristan Van Berkom <tristan.vanberkom@codethink.co.uk>
import os
from .._platform import Platform
from .optionenum import OptionEnum
......@@ -41,8 +41,7 @@ class OptionArch(OptionEnum):
super(OptionArch, self).load(node, allow_default_definition=False)
def load_default_value(self, node):
_, _, _, _, machine_arch = os.uname()
return machine_arch
return Platform.get_host_os()
def resolve(self):
......
#
# Copyright (C) 2017 Codethink Limited
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <http://www.gnu.org/licenses/>.
#
# Authors:
# Raoul Hidalgo Charman <raoul.hidalgocharman@codethink.co.uk>
import os
from .optionenum import OptionEnum
# OptionOS
#
class OptionOS(OptionEnum):
OPTION_TYPE = 'os'
def load(self, node):
super(OptionOS, self).load(node, allow_default_definition=False)
def load_default_value(self, node):
return os.uname()[0]
def resolve(self):
# Validate that the default OS reported by uname() is explicitly
# supported by the project, if not overridden by user config or cli.
self.validate(self.value)
......@@ -28,6 +28,7 @@ from .optionenum import OptionEnum
from .optionflags import OptionFlags
from .optioneltmask import OptionEltMask
from .optionarch import OptionArch
from .optionos import OptionOS
_OPTION_TYPES = {
......@@ -36,6 +37,7 @@ _OPTION_TYPES = {
OptionFlags.OPTION_TYPE: OptionFlags,
OptionEltMask.OPTION_TYPE: OptionEltMask,
OptionArch.OPTION_TYPE: OptionArch,
OptionOS.OPTION_TYPE: OptionOS,
}
......
......@@ -65,13 +65,20 @@ class SandboxRemote(Sandbox):
EnvironmentVariable(name=k, value=v)
for (k, v) in environment.items()]
config = self._get_config()
platform = remote_execution_pb2.Platform()
platform.properties.extend([remote_execution_pb2.Platform.
Property(name="os", value=config.build_os),
remote_execution_pb2.Platform.
Property(name="arch", value=config.build_arch)])
# Create and send the Command object.
remote_command = remote_execution_pb2.Command(arguments=command,
working_directory=working_directory,
environment_variables=environment_variables,
output_files=[],
output_directories=[self._output_directory],
platform=None)
platform=platform)
context = self._get_context()
cascache = context.artifactcache
# Upload the Command message to the remote CAS server
......
......@@ -5,10 +5,10 @@ sources:
url: gnomesdk:repo/
gpg-key: keys/gnome-sdk.gpg
(?):
- arch == "x86_64":
- arch == "x86-64":
track: runtime/org.freedesktop.BaseSdk/x86_64/1.4
ref: 0d9d255d56b08aeaaffb1c820eef85266eb730cb5667e50681185ccf5cd7c882
- arch == "i386":
- arch == "x86-32":
track: runtime/org.freedesktop.BaseSdk/i386/1.4
ref: 16036b747c1ec8e7fe291f5b1f667cb942f0267d08fcad962e9b7627d6cf1981
config:
......
......@@ -10,6 +10,6 @@ options:
type: arch
description: The machine architecture
values:
- x86_64
- i386
- x86-64
- x86-32
......@@ -144,7 +144,7 @@ DATA_DIR = os.path.join(
# The cache key test uses a project which exercises all plugins,
# so we cant run it at all if we dont have them installed.
#
@pytest.mark.skipif(MACHINE_ARCH != 'x86_64',
@pytest.mark.skipif(MACHINE_ARCH != 'x86-64',
reason='Cache keys depend on architecture')
@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
@pytest.mark.skipif(HAVE_BZR is False, reason="bzr is not available")
......
......@@ -13,8 +13,8 @@ DATA_DIR = os.path.join(
# Tests a build of the autotools amhello project on a alpine-linux base runtime
@pytest.mark.skipif(MACHINE_ARCH != 'x86_64',
reason='Examples are writtent for x86_64')
@pytest.mark.skipif(MACHINE_ARCH != 'x86-64',
reason='Examples are writtent for x86-64')
@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap')
@pytest.mark.datafiles(DATA_DIR)
def test_autotools_build(cli, tmpdir, datafiles):
......@@ -38,8 +38,8 @@ def test_autotools_build(cli, tmpdir, datafiles):
# Test running an executable built with autotools.
@pytest.mark.skipif(MACHINE_ARCH != 'x86_64',
reason='Examples are writtent for x86_64')
@pytest.mark.skipif(MACHINE_ARCH != 'x86-64',
reason='Examples are writtent for x86-64')
@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap')
@pytest.mark.datafiles(DATA_DIR)
def test_autotools_run(cli, tmpdir, datafiles):
......
......@@ -14,8 +14,8 @@ DATA_DIR = os.path.join(
# Test that the project builds successfully
@pytest.mark.skipif(MACHINE_ARCH != 'x86_64',
reason='Examples are writtent for x86_64')
@pytest.mark.skipif(MACHINE_ARCH != 'x86-64',
reason='Examples are writtent for x86-64')
@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap')
@pytest.mark.datafiles(DATA_DIR)
def test_autotools_build(cli, tmpdir, datafiles):
......@@ -37,8 +37,8 @@ def test_autotools_build(cli, tmpdir, datafiles):
# Test the unmodified hello command works as expected.
@pytest.mark.skipif(MACHINE_ARCH != 'x86_64',
reason='Examples are writtent for x86_64')
@pytest.mark.skipif(MACHINE_ARCH != 'x86-64',
reason='Examples are writtent for x86-64')
@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap')
@pytest.mark.datafiles(DATA_DIR)
def test_run_unmodified_hello(cli, tmpdir, datafiles):
......@@ -70,8 +70,8 @@ def test_open_workspace(cli, tmpdir, datafiles):
# Test making a change using the workspace
@pytest.mark.skipif(MACHINE_ARCH != 'x86_64',
reason='Examples are writtent for x86_64')
@pytest.mark.skipif(MACHINE_ARCH != 'x86-64',
reason='Examples are writtent for x86-64')
@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap')
@pytest.mark.datafiles(DATA_DIR)
def test_make_change_in_workspace(cli, tmpdir, datafiles):
......
......@@ -32,8 +32,8 @@ def workaround_setuptools_bug(project):
# Test that a build upon flatpak runtime 'works' - we use the autotools sample
# amhello project for this.
@pytest.mark.skipif(MACHINE_ARCH != 'x86_64',
reason='Examples are writtent for x86_64')
@pytest.mark.skipif(MACHINE_ARCH != 'x86-64',
reason='Examples are writtent for x86-64')
@pytest.mark.skipif(not IS_LINUX or not HAVE_OSTREE, reason='Only available on linux with ostree')
@pytest.mark.datafiles(DATA_DIR)
def test_autotools_build(cli, tmpdir, datafiles):
......@@ -57,8 +57,8 @@ def test_autotools_build(cli, tmpdir, datafiles):
# Test running an executable built with autotools
@pytest.mark.skipif(MACHINE_ARCH != 'x86_64',
reason='Examples are writtent for x86_64')
@pytest.mark.skipif(MACHINE_ARCH != 'x86-64',
reason='Examples are writtent for x86-64')
@pytest.mark.skipif(not IS_LINUX or not HAVE_OSTREE, reason='Only available on linux with ostree')
@pytest.mark.datafiles(DATA_DIR)
def test_autotools_run(cli, tmpdir, datafiles):
......
......@@ -12,8 +12,8 @@ DATA_DIR = os.path.join(
)
@pytest.mark.skipif(MACHINE_ARCH != 'x86_64',
reason='Examples are writtent for x86_64')
@pytest.mark.skipif(MACHINE_ARCH != 'x86-64',
reason='Examples are writtent for x86-64')
@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap')
@pytest.mark.datafiles(DATA_DIR)
def test_integration_commands_build(cli, tmpdir, datafiles):
......@@ -25,8 +25,8 @@ def test_integration_commands_build(cli, tmpdir, datafiles):
# Test running the executable
@pytest.mark.skipif(MACHINE_ARCH != 'x86_64',
reason='Examples are writtent for x86_64')
@pytest.mark.skipif(MACHINE_ARCH != 'x86-64',
reason='Examples are writtent for x86-64')
@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap')
@pytest.mark.datafiles(DATA_DIR)
def test_integration_commands_run(cli, tmpdir, datafiles):
......
......@@ -13,8 +13,8 @@ DATA_DIR = os.path.join(
# Test that the project builds successfully
@pytest.mark.skipif(MACHINE_ARCH != 'x86_64',
reason='Examples are writtent for x86_64')
@pytest.mark.skipif(MACHINE_ARCH != 'x86-64',
reason='Examples are writtent for x86-64')
@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap')
@pytest.mark.datafiles(DATA_DIR)
def test_build(cli, tmpdir, datafiles):
......@@ -25,8 +25,8 @@ def test_build(cli, tmpdir, datafiles):
# Test the callHello script works as expected.
@pytest.mark.skipif(MACHINE_ARCH != 'x86_64',
reason='Examples are writtent for x86_64')
@pytest.mark.skipif(MACHINE_ARCH != 'x86-64',
reason='Examples are writtent for x86-64')
@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap')
@pytest.mark.datafiles(DATA_DIR)
def test_shell_call_hello(cli, tmpdir, datafiles):
......
......@@ -12,8 +12,8 @@ DATA_DIR = os.path.join(
)
@pytest.mark.skipif(MACHINE_ARCH != 'x86_64',
reason='Examples are writtent for x86_64')
@pytest.mark.skipif(MACHINE_ARCH != 'x86-64',
reason='Examples are writtent for x86-64')
@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap')
@pytest.mark.datafiles(DATA_DIR)
def test_running_commands_build(cli, tmpdir, datafiles):
......@@ -25,8 +25,8 @@ def test_running_commands_build(cli, tmpdir, datafiles):
# Test running the executable
@pytest.mark.skipif(MACHINE_ARCH != 'x86_64',
reason='Examples are writtent for x86_64')
@pytest.mark.skipif(MACHINE_ARCH != 'x86-64',
reason='Examples are writtent for x86-64')
@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap')
@pytest.mark.datafiles(DATA_DIR)
def test_running_commands_run(cli, tmpdir, datafiles):
......
......@@ -4,4 +4,4 @@ options:
arch:
type: arch
description: Example architecture option
values: [ x86_32, x86_64, aarch64 ]
values: [ x86-32, x86-64, AArch64 ]
\ No newline at end of file
......@@ -2,7 +2,7 @@ kind: autotools
variables:
result: "Nothing"
(?):
- machine_arch == "arm":
- machine_arch == "AArch32":
result: "Army"
- machine_arch == "aarch64":
- machine_arch == "AArch64":
result: "Aarchy"
......@@ -5,5 +5,5 @@ options:
type: arch
description: The machine architecture
values:
- arm
- aarch64
- AArch32
- AArch64
kind: autotools
variables:
result: "Nothing"
(?):
- machine_os == "Linux":
result: "Linuxy"
- machine_os == "Darwin":
result: "Darwiny"
- machine_os == "SunOS":
result: "SunOSy"
- machine_os == "FreeBSD":
result: "FreeBSDy"
\ No newline at end of file
name: test
options:
machine_os:
type: os
description: The operating system
values:
- Linux
- Darwin
- FreeBSD
- SunOS
......@@ -29,8 +29,8 @@ def override_uname_arch(name):
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.parametrize("uname,value,expected", [
# Test explicitly provided arches
('arm', 'arm', 'Army'),
('arm', 'aarch64', 'Aarchy'),
('arm', 'AArch32', 'Army'),
('arm', 'AArch64', 'Aarchy'),
# Test automatically derived arches
('arm', None, 'Army'),
......@@ -38,8 +38,8 @@ def override_uname_arch(name):
# Test that explicitly provided arches dont error out
# when the `uname` reported arch is not supported
('i386', 'arm', 'Army'),
('x86_64', 'aarch64', 'Aarchy'),
('i386', 'AArch32', 'Army'),
('x86_64', 'AArch64', 'Aarchy'),
])
def test_conditional(cli, datafiles, uname, value, expected):
with override_uname_arch(uname):
......
import os
import pytest
from contextlib import contextmanager
from buildstream import _yaml
from buildstream._exceptions import ErrorDomain, LoadErrorReason
from tests.testutils.runcli import cli
DATA_DIR = os.path.dirname(os.path.realpath(__file__))
@contextmanager
def override_uname_os(name):
orig_uname = os.uname
orig_tuple = tuple(os.uname())
override_result = (name, orig_tuple[1],
orig_tuple[2], orig_tuple[3],
orig_tuple[4])
def override():
return override_result
os.uname = override
yield
os.uname = orig_uname
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.parametrize("uname,value,expected", [
# Test explicitly provided arches
('Darwin', 'Linux', 'Linuxy'),
('SunOS', 'FreeBSD', 'FreeBSDy'),
# Test automatically derived arches
('Linux', None, 'Linuxy'),
('Darwin', None, 'Darwiny'),
# Test that explicitly provided arches dont error out
# when the `uname` reported arch is not supported
('AIX', 'Linux', 'Linuxy'),
('HaikuOS', 'SunOS', 'SunOSy'),
])
def test_conditionals(cli, datafiles, uname, value, expected):
with override_uname_os(uname):
project = os.path.join(datafiles.dirname, datafiles.basename, 'option-os')
bst_args = []
if value is not None:
bst_args += ['--option', 'machine_os', value]
bst_args += [
'show',
'--deps', 'none',
'--format', '%{vars}',
'element.bst'
]
result = cli.run(project=project, silent=True, args=bst_args)
result.assert_success()
loaded = _yaml.load_data(result.output)
assert loaded['result'] == expected
@pytest.mark.datafiles(DATA_DIR)
def test_unsupported_arch(cli, datafiles):
with override_uname_os("AIX"):
project = os.path.join(datafiles.dirname, datafiles.basename, 'option-os')
result = cli.run(project=project, silent=True, args=[
'show',
'--deps', 'none',
'--format', '%{vars}',
'element.bst'
])
result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.INVALID_DATA)