diff options
Diffstat (limited to 'meta/lib/oeqa/sdk')
-rw-r--r-- | meta/lib/oeqa/sdk/buildtools-cases/gcc.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/meta/lib/oeqa/sdk/buildtools-cases/gcc.py b/meta/lib/oeqa/sdk/buildtools-cases/gcc.py new file mode 100644 index 0000000000..36ba15b134 --- /dev/null +++ b/meta/lib/oeqa/sdk/buildtools-cases/gcc.py | |||
@@ -0,0 +1,29 @@ | |||
1 | # | ||
2 | # SPDX-License-Identifier: MIT | ||
3 | # | ||
4 | |||
5 | import os.path | ||
6 | from oeqa.sdk.case import OESDKTestCase | ||
7 | |||
8 | class GccTests(OESDKTestCase): | ||
9 | def test_verify_specs(self): | ||
10 | """ | ||
11 | Verify that the compiler has been relocated successfully and isn't | ||
12 | looking in the hard-coded prefix. | ||
13 | """ | ||
14 | # Canonicalise the SDK root | ||
15 | sdk_base = os.path.realpath(self.tc.sdk_dir) | ||
16 | # Canonicalise the location of GCC | ||
17 | gcc_path = os.path.realpath(self._run("command -v gcc").strip()) | ||
18 | # Skip the test if the GCC didn't come from the buildtools, as it only | ||
19 | # comes with buildtools-extended-tarball. | ||
20 | if os.path.commonprefix((sdk_base, gcc_path)) != sdk_base: | ||
21 | self.skipTest("Buildtools does not provide GCC") | ||
22 | |||
23 | # This is the prefix that GCC is build with, and should be replaced at | ||
24 | # installation time. | ||
25 | sdkpath = self.td.get("SDKPATH") | ||
26 | self.assertTrue(sdkpath) | ||
27 | |||
28 | for line in self._run('gcc -dumpspecs').splitlines(): | ||
29 | self.assertNotIn(sdkpath, line) | ||