Esempio n. 1
0
def test_unsupported_arch(cli, datafiles):

    with override_platform_uname(system="ULTRIX"):
        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)
Esempio n. 2
0
def test_unknown_host_arch(cli, datafiles):

    with override_platform_uname(machine="x86_128"):
        project = os.path.join(datafiles.dirname, datafiles.basename,
                               "option-arch")
        result = cli.run(project=project,
                         silent=True,
                         args=[
                             "show", "--deps", "none", "--format", "%{vars}",
                             "element.bst"
                         ])

        result.assert_main_error(ErrorDomain.PLATFORM, None)
Esempio n. 3
0
def test_alias(cli, datafiles):

    with override_platform_uname(machine="arm"):
        project = os.path.join(datafiles.dirname, datafiles.basename,
                               "option-arch-alias")
        result = cli.run(project=project,
                         silent=True,
                         args=[
                             "show", "--deps", "none", "--format", "%{vars}",
                             "element.bst"
                         ])

        result.assert_success()
Esempio n. 4
0
def test_conditionals(cli, datafiles, system, value, expected):
    with override_platform_uname(system=system):
        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.get_str("result") == expected