]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
oeqa: rename variable dirs to opts is cases with parallel make
authorPeter Marko <peter.marko@siemens.com>
Fri, 8 Aug 2025 10:24:12 +0000 (12:24 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 11 Aug 2025 17:03:13 +0000 (18:03 +0100)
This is a refactoring commit so that next commit which is fixing
parallel make settings is readable.

Rename makes sense as the variable will contain not only directories but
also parallel make settings afterwards.

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
meta/lib/oeqa/sdk/cases/autotools.py
meta/lib/oeqa/sdk/cases/cmake.py
meta/lib/oeqa/sdk/cases/makefile.py

index ee6c522551b8e791c36a5b02408e5e7b505ca697..f641d660159ff9da6f2fb48d3670330aa4addb1e 100644 (file)
@@ -26,23 +26,23 @@ class AutotoolsTest(OESDKTestCase):
         with tempfile.TemporaryDirectory(prefix="cpio-", dir=self.tc.sdk_dir) as testdir:
             tarball = self.fetch(testdir, self.td["DL_DIR"], "https://ftp.gnu.org/gnu/cpio/cpio-2.15.tar.gz")
 
-            dirs = {}
-            dirs["source"] = os.path.join(testdir, "cpio-2.15")
-            dirs["build"] = os.path.join(testdir, "build")
-            dirs["install"] = os.path.join(testdir, "install")
+            opts = {}
+            opts["source"] = os.path.join(testdir, "cpio-2.15")
+            opts["build"] = os.path.join(testdir, "build")
+            opts["install"] = os.path.join(testdir, "install")
 
             subprocess.check_output(["tar", "xf", tarball, "-C", testdir], stderr=subprocess.STDOUT)
-            self.assertTrue(os.path.isdir(dirs["source"]))
-            os.makedirs(dirs["build"])
+            self.assertTrue(os.path.isdir(opts["source"]))
+            os.makedirs(opts["build"])
 
-            self._run("cd {build} && {source}/configure CFLAGS='-std=gnu17 -Dbool=int -Dtrue=1 -Dfalse=0 -Wno-error=implicit-function-declaration' $CONFIGURE_FLAGS".format(**dirs))
+            self._run("cd {build} && {source}/configure CFLAGS='-std=gnu17 -Dbool=int -Dtrue=1 -Dfalse=0 -Wno-error=implicit-function-declaration' $CONFIGURE_FLAGS".format(**opts))
 
             # Check that configure detected the target correctly
-            with open(os.path.join(dirs["build"], "config.log")) as f:
+            with open(os.path.join(opts["build"], "config.log")) as f:
                 host_sys = self.td["HOST_SYS"]
                 self.assertIn(f"host_alias='{host_sys}'\n", f.readlines())
 
-            self._run("cd {build} && make CFLAGS='-std=gnu17 -Dbool=int -Dtrue=1 -Dfalse=0 -Wno-error=implicit-function-declaration' -j".format(**dirs))
-            self._run("cd {build} && make install DESTDIR={install}".format(**dirs))
+            self._run("cd {build} && make CFLAGS='-std=gnu17 -Dbool=int -Dtrue=1 -Dfalse=0 -Wno-error=implicit-function-declaration' -j".format(**opts))
+            self._run("cd {build} && make install DESTDIR={install}".format(**opts))
 
-            self.check_elf(os.path.join(dirs["install"], "usr", "local", "bin", "cpio"))
+            self.check_elf(os.path.join(opts["install"], "usr", "local", "bin", "cpio"))
index 070682ef084d8e786dce63b813bf3af304d1ab84..32b951c0f838cd6a5361526cdf4e4cf849de5977 100644 (file)
@@ -29,19 +29,19 @@ class CMakeTest(OESDKTestCase):
         with tempfile.TemporaryDirectory(prefix="assimp", dir=self.tc.sdk_dir) as testdir:
             tarball = self.fetch(testdir, self.td["DL_DIR"], "https://github.com/assimp/assimp/archive/v5.4.1.tar.gz")
 
-            dirs = {}
-            dirs["source"] = os.path.join(testdir, "assimp-5.4.1")
-            dirs["build"] = os.path.join(testdir, "build")
-            dirs["install"] = os.path.join(testdir, "install")
+            opts = {}
+            opts["source"] = os.path.join(testdir, "assimp-5.4.1")
+            opts["build"] = os.path.join(testdir, "build")
+            opts["install"] = os.path.join(testdir, "install")
 
             subprocess.check_output(["tar", "xf", tarball, "-C", testdir], stderr=subprocess.STDOUT)
-            self.assertTrue(os.path.isdir(dirs["source"]))
+            self.assertTrue(os.path.isdir(opts["source"]))
             # Apply the zlib patch https://github.com/madler/zlib/commit/a566e156b3fa07b566ddbf6801b517a9dba04fa3
             # this sed wont be needed once assimp moves its zlib copy to v1.3.1+
-            self._run("sed -i '/#  ifdef _FILE_OFFSET_BITS/I,+2 d' {source}/contrib/zlib/gzguts.h".format(**dirs))
-            os.makedirs(dirs["build"])
+            self._run("sed -i '/#  ifdef _FILE_OFFSET_BITS/I,+2 d' {source}/contrib/zlib/gzguts.h".format(**opts))
+            os.makedirs(opts["build"])
 
-            self._run("cd {build} && cmake -DASSIMP_WARNINGS_AS_ERRORS=OFF -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DASSIMP_BUILD_ZLIB=ON {source}".format(**dirs))
-            self._run("cmake --build {build} -- -j".format(**dirs))
-            self._run("cmake --build {build} --target install -- DESTDIR={install}".format(**dirs))
-            self.check_elf(os.path.join(dirs["install"], "usr", "local", "lib", "libassimp.so.5.4.1"))
+            self._run("cd {build} && cmake -DASSIMP_WARNINGS_AS_ERRORS=OFF -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DASSIMP_BUILD_ZLIB=ON {source}".format(**opts))
+            self._run("cmake --build {build} -- -j".format(**opts))
+            self._run("cmake --build {build} --target install -- DESTDIR={install}".format(**opts))
+            self.check_elf(os.path.join(opts["install"], "usr", "local", "lib", "libassimp.so.5.4.1"))
index e1e2484820659c23952cf559c3b047508f78a437..0dcf94c6d795c4bfd1a3e28d153a1659dab1de19 100644 (file)
@@ -23,14 +23,14 @@ class MakefileTest(OESDKTestCase):
         with tempfile.TemporaryDirectory(prefix="lzip", dir=self.tc.sdk_dir) as testdir:
             tarball = self.fetch(testdir, self.td["DL_DIR"], "http://downloads.yoctoproject.org/mirror/sources/lzip-1.19.tar.gz")
 
-            dirs = {}
-            dirs["source"] = os.path.join(testdir, "lzip-1.19")
-            dirs["build"] = os.path.join(testdir, "build")
-            dirs["install"] = os.path.join(testdir, "install")
+            opts = {}
+            opts["source"] = os.path.join(testdir, "lzip-1.19")
+            opts["build"] = os.path.join(testdir, "build")
+            opts["install"] = os.path.join(testdir, "install")
 
             subprocess.check_output(["tar", "xf", tarball, "-C", testdir], stderr=subprocess.STDOUT)
-            self.assertTrue(os.path.isdir(dirs["source"]))
-            os.makedirs(dirs["build"])
+            self.assertTrue(os.path.isdir(opts["source"]))
+            os.makedirs(opts["build"])
 
             cmd = """cd {build} && \
                      {source}/configure --srcdir {source} \
@@ -39,7 +39,7 @@ class MakefileTest(OESDKTestCase):
                      CXXFLAGS="$CXXFLAGS" \
                      LDFLAGS="$LDFLAGS" \
                   """
-            self._run(cmd.format(**dirs))
-            self._run("cd {build} && make -j".format(**dirs))
-            self._run("cd {build} && make install DESTDIR={install}".format(**dirs))
-            self.check_elf(os.path.join(dirs["install"], "usr", "local", "bin", "lzip"))
+            self._run(cmd.format(**opts))
+            self._run("cd {build} && make -j".format(**opts))
+            self._run("cd {build} && make install DESTDIR={install}".format(**opts))
+            self.check_elf(os.path.join(opts["install"], "usr", "local", "bin", "lzip"))