Jürg Billeter pushed to branch juerg/arch at BuildStream / buildstream
Commits:
-
0c2a66b3
by Jürg Billeter at 2019-01-10T13:06:02Z
5 changed files:
- + tests/format/option-arch-alias/element.bst
- + tests/format/option-arch-alias/project.conf
- + tests/format/option-arch-unknown/element.bst
- + tests/format/option-arch-unknown/project.conf
- tests/format/optionarch.py
Changes:
| 1 |
+kind: autotools
|
|
| 2 |
+variables:
|
|
| 3 |
+ result: "Nothing"
|
|
| 4 |
+ (?):
|
|
| 5 |
+ - machine_arch == "arm":
|
|
| 6 |
+ result: "Army"
|
|
| 7 |
+ - machine_arch == "x86_64":
|
|
| 8 |
+ result: "X86-64y"
|
| 1 |
+name: test
|
|
| 2 |
+ |
|
| 3 |
+options:
|
|
| 4 |
+ machine_arch:
|
|
| 5 |
+ type: arch
|
|
| 6 |
+ description: The machine architecture
|
|
| 7 |
+ values:
|
|
| 8 |
+ - arm
|
|
| 9 |
+ - x86_64
|
| 1 |
+kind: autotools
|
|
| 2 |
+variables:
|
|
| 3 |
+ result: "Nothing"
|
|
| 4 |
+ (?):
|
|
| 5 |
+ - machine_arch == "aarch32":
|
|
| 6 |
+ result: "Army"
|
|
| 7 |
+ - machine_arch == "aarch64":
|
|
| 8 |
+ result: "Aarchy"
|
|
| 9 |
+ - machine_arch == "x86-128":
|
|
| 10 |
+ result: "X86-128y"
|
| 1 |
+name: test
|
|
| 2 |
+ |
|
| 3 |
+options:
|
|
| 4 |
+ machine_arch:
|
|
| 5 |
+ type: arch
|
|
| 6 |
+ description: The machine architecture
|
|
| 7 |
+ values:
|
|
| 8 |
+ - aarch32
|
|
| 9 |
+ - aarch64
|
|
| 10 |
+ - x86-128
|
| ... | ... | @@ -75,3 +75,47 @@ def test_unsupported_arch(cli, datafiles): |
| 75 | 75 |
])
|
| 76 | 76 |
|
| 77 | 77 |
result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.INVALID_DATA)
|
| 78 |
+ |
|
| 79 |
+ |
|
| 80 |
+@pytest.mark.datafiles(DATA_DIR)
|
|
| 81 |
+def test_alias(cli, datafiles):
|
|
| 82 |
+ |
|
| 83 |
+ with override_uname_arch("arm"):
|
|
| 84 |
+ project = os.path.join(datafiles.dirname, datafiles.basename, 'option-arch-alias')
|
|
| 85 |
+ result = cli.run(project=project, silent=True, args=[
|
|
| 86 |
+ 'show',
|
|
| 87 |
+ '--deps', 'none',
|
|
| 88 |
+ '--format', '%{vars}',
|
|
| 89 |
+ 'element.bst'
|
|
| 90 |
+ ])
|
|
| 91 |
+ |
|
| 92 |
+ result.assert_success()
|
|
| 93 |
+ |
|
| 94 |
+ |
|
| 95 |
+@pytest.mark.datafiles(DATA_DIR)
|
|
| 96 |
+def test_unknown_host_arch(cli, datafiles):
|
|
| 97 |
+ |
|
| 98 |
+ with override_uname_arch("x86_128"):
|
|
| 99 |
+ project = os.path.join(datafiles.dirname, datafiles.basename, 'option-arch')
|
|
| 100 |
+ result = cli.run(project=project, silent=True, args=[
|
|
| 101 |
+ 'show',
|
|
| 102 |
+ '--deps', 'none',
|
|
| 103 |
+ '--format', '%{vars}',
|
|
| 104 |
+ 'element.bst'
|
|
| 105 |
+ ])
|
|
| 106 |
+ |
|
| 107 |
+ result.assert_main_error(ErrorDomain.PLATFORM, None)
|
|
| 108 |
+ |
|
| 109 |
+ |
|
| 110 |
+@pytest.mark.datafiles(DATA_DIR)
|
|
| 111 |
+def test_unknown_project_arch(cli, datafiles):
|
|
| 112 |
+ |
|
| 113 |
+ project = os.path.join(datafiles.dirname, datafiles.basename, 'option-arch-unknown')
|
|
| 114 |
+ result = cli.run(project=project, silent=True, args=[
|
|
| 115 |
+ 'show',
|
|
| 116 |
+ '--deps', 'none',
|
|
| 117 |
+ '--format', '%{vars}',
|
|
| 118 |
+ 'element.bst'
|
|
| 119 |
+ ])
|
|
| 120 |
+ |
|
| 121 |
+ result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.INVALID_DATA)
|
