diff options
Diffstat (limited to 'meta/lib/oeqa/sdk/cases/autotools.py')
-rw-r--r-- | meta/lib/oeqa/sdk/cases/autotools.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/meta/lib/oeqa/sdk/cases/autotools.py b/meta/lib/oeqa/sdk/cases/autotools.py index 848e9392ec..ee6c522551 100644 --- a/meta/lib/oeqa/sdk/cases/autotools.py +++ b/meta/lib/oeqa/sdk/cases/autotools.py | |||
@@ -7,6 +7,7 @@ | |||
7 | import os | 7 | import os |
8 | import tempfile | 8 | import tempfile |
9 | import subprocess | 9 | import subprocess |
10 | import unittest | ||
10 | 11 | ||
11 | from oeqa.sdk.case import OESDKTestCase | 12 | from oeqa.sdk.case import OESDKTestCase |
12 | from oeqa.utils.subprocesstweak import errors_have_output | 13 | from oeqa.utils.subprocesstweak import errors_have_output |
@@ -16,6 +17,11 @@ class AutotoolsTest(OESDKTestCase): | |||
16 | """ | 17 | """ |
17 | Check that autotools will cross-compile correctly. | 18 | Check that autotools will cross-compile correctly. |
18 | """ | 19 | """ |
20 | def setUp(self): | ||
21 | libc = self.td.get("TCLIBC") | ||
22 | if libc in [ 'newlib' ]: | ||
23 | raise unittest.SkipTest("AutotoolsTest class: SDK doesn't contain a supported C library") | ||
24 | |||
19 | def test_cpio(self): | 25 | def test_cpio(self): |
20 | with tempfile.TemporaryDirectory(prefix="cpio-", dir=self.tc.sdk_dir) as testdir: | 26 | with tempfile.TemporaryDirectory(prefix="cpio-", dir=self.tc.sdk_dir) as testdir: |
21 | tarball = self.fetch(testdir, self.td["DL_DIR"], "https://ftp.gnu.org/gnu/cpio/cpio-2.15.tar.gz") | 27 | tarball = self.fetch(testdir, self.td["DL_DIR"], "https://ftp.gnu.org/gnu/cpio/cpio-2.15.tar.gz") |
@@ -29,8 +35,14 @@ class AutotoolsTest(OESDKTestCase): | |||
29 | self.assertTrue(os.path.isdir(dirs["source"])) | 35 | self.assertTrue(os.path.isdir(dirs["source"])) |
30 | os.makedirs(dirs["build"]) | 36 | os.makedirs(dirs["build"]) |
31 | 37 | ||
32 | self._run("cd {build} && {source}/configure $CONFIGURE_FLAGS".format(**dirs)) | 38 | self._run("cd {build} && {source}/configure CFLAGS='-std=gnu17 -Dbool=int -Dtrue=1 -Dfalse=0 -Wno-error=implicit-function-declaration' $CONFIGURE_FLAGS".format(**dirs)) |
33 | self._run("cd {build} && make -j".format(**dirs)) | 39 | |
40 | # Check that configure detected the target correctly | ||
41 | with open(os.path.join(dirs["build"], "config.log")) as f: | ||
42 | host_sys = self.td["HOST_SYS"] | ||
43 | self.assertIn(f"host_alias='{host_sys}'\n", f.readlines()) | ||
44 | |||
45 | self._run("cd {build} && make CFLAGS='-std=gnu17 -Dbool=int -Dtrue=1 -Dfalse=0 -Wno-error=implicit-function-declaration' -j".format(**dirs)) | ||
34 | self._run("cd {build} && make install DESTDIR={install}".format(**dirs)) | 46 | self._run("cd {build} && make install DESTDIR={install}".format(**dirs)) |
35 | 47 | ||
36 | self.check_elf(os.path.join(dirs["install"], "usr", "local", "bin", "cpio")) | 48 | self.check_elf(os.path.join(dirs["install"], "usr", "local", "bin", "cpio")) |