summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/sdk/cases/autotools.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/sdk/cases/autotools.py')
-rw-r--r--meta/lib/oeqa/sdk/cases/autotools.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/meta/lib/oeqa/sdk/cases/autotools.py b/meta/lib/oeqa/sdk/cases/autotools.py
new file mode 100644
index 0000000000..848e9392ec
--- /dev/null
+++ b/meta/lib/oeqa/sdk/cases/autotools.py
@@ -0,0 +1,36 @@
1#
2# Copyright OpenEmbedded Contributors
3#
4# SPDX-License-Identifier: MIT
5#
6
7import os
8import tempfile
9import subprocess
10
11from oeqa.sdk.case import OESDKTestCase
12from oeqa.utils.subprocesstweak import errors_have_output
13errors_have_output()
14
15class AutotoolsTest(OESDKTestCase):
16 """
17 Check that autotools will cross-compile correctly.
18 """
19 def test_cpio(self):
20 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")
22
23 dirs = {}
24 dirs["source"] = os.path.join(testdir, "cpio-2.15")
25 dirs["build"] = os.path.join(testdir, "build")
26 dirs["install"] = os.path.join(testdir, "install")
27
28 subprocess.check_output(["tar", "xf", tarball, "-C", testdir], stderr=subprocess.STDOUT)
29 self.assertTrue(os.path.isdir(dirs["source"]))
30 os.makedirs(dirs["build"])
31
32 self._run("cd {build} && {source}/configure $CONFIGURE_FLAGS".format(**dirs))
33 self._run("cd {build} && make -j".format(**dirs))
34 self._run("cd {build} && make install DESTDIR={install}".format(**dirs))
35
36 self.check_elf(os.path.join(dirs["install"], "usr", "local", "bin", "cpio"))