Files
poky/meta/lib/oeqa/sdk/buildtools-cases/gcc.py
Richard Purdie ce08cf4825 lib: Add copyright statements to files without one
Where there isn't a copyright statement, add one to make it explicit.
Also add license identifiers as MIT if there isn't one.

(From OE-Core rev: bb731d1f3d2a1d50ec0aed864dbca54cf795b040)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12 12:00:43 +01:00

32 lines
1.1 KiB
Python

#
# Copyright OpenEmbedded Contributors
#
# SPDX-License-Identifier: MIT
#
import os.path
from oeqa.sdk.case import OESDKTestCase
class GccTests(OESDKTestCase):
def test_verify_specs(self):
"""
Verify that the compiler has been relocated successfully and isn't
looking in the hard-coded prefix.
"""
# Canonicalise the SDK root
sdk_base = os.path.realpath(self.tc.sdk_dir)
# Canonicalise the location of GCC
gcc_path = os.path.realpath(self._run("command -v gcc").strip())
# Skip the test if the GCC didn't come from the buildtools, as it only
# comes with buildtools-extended-tarball.
if os.path.commonprefix((sdk_base, gcc_path)) != sdk_base:
self.skipTest("Buildtools does not provide GCC")
# This is the prefix that GCC is build with, and should be replaced at
# installation time.
sdkpath = self.td.get("SDKPATH")
self.assertTrue(sdkpath)
for line in self._run('gcc -dumpspecs').splitlines():
self.assertNotIn(sdkpath, line)