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