Exemplo n.º 1
0
    def test_assimp(self):
        import tempfile
        import oe.qa, oe.elf

        with tempfile.TemporaryDirectory(prefix="assimp", dir=self.tc.sdk_dir) as testdir:
            dl_dir = self.td.get('DL_DIR', None)
            tarball = self.fetch(testdir, dl_dir, "https://github.com/assimp/assimp/archive/v4.1.0.tar.gz")
            subprocess.check_output(["tar", "xf", tarball, "-C", testdir])

            sourcedir = os.path.join(testdir, "assimp-4.1.0") 
            builddir = os.path.join(testdir, "build")
            installdir = os.path.join(testdir, "install")
            bb.utils.mkdirhier(builddir)

            self._run("cd %s && cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON %s " % (builddir, sourcedir))
            self._run("cmake --build %s -- -j" % builddir)
            self._run("cmake --build %s --target install -- DESTDIR=%s" % (builddir, installdir))

            elf = oe.qa.ELFFile(os.path.join(installdir, "usr", "local", "lib", "libassimp.so.4.1.0"))
            elf.open()

            output = self._run("echo $OECORE_TARGET_OS:$OECORE_TARGET_ARCH")
            target_os, target_arch = output.strip().split(":")
            machine_data = oe.elf.machine_dict(None)[target_os][target_arch]
            (machine, osabi, abiversion, endian, bits) = machine_data

            self.assertEqual(machine, elf.machine())
            self.assertEqual(bits, elf.abiSize())
            self.assertEqual(endian, elf.isLittleEndian())
Exemplo n.º 2
0
    def test_assimp(self):
        import tempfile
        import oe.qa, oe.elf

        with tempfile.TemporaryDirectory(prefix="assimp", dir=self.tc.sdk_dir) as testdir:
            dl_dir = self.td.get('DL_DIR', None)
            tarball = self.fetch(testdir, dl_dir, "https://github.com/assimp/assimp/archive/v4.1.0.tar.gz")
            subprocess.check_output(["tar", "xf", tarball, "-C", testdir])

            sourcedir = os.path.join(testdir, "assimp-4.1.0") 
            builddir = os.path.join(testdir, "build")
            installdir = os.path.join(testdir, "install")
            bb.utils.mkdirhier(builddir)

            self._run("cd %s && cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON %s " % (builddir, sourcedir))
            self._run("cmake --build %s -- -j" % builddir)
            self._run("cmake --build %s --target install -- DESTDIR=%s" % (builddir, installdir))

            elf = oe.qa.ELFFile(os.path.join(installdir, "usr", "local", "lib", "libassimp.so.4.1.0"))
            elf.open()

            output = self._run("echo $OECORE_TARGET_OS:$OECORE_TARGET_ARCH")
            target_os, target_arch = output.strip().split(":")
            machine_data = oe.elf.machine_dict(None)[target_os][target_arch]
            (machine, osabi, abiversion, endian, bits) = machine_data

            self.assertEqual(machine, elf.machine())
            self.assertEqual(bits, elf.abiSize())
            self.assertEqual(endian, elf.isLittleEndian())
Exemplo n.º 3
0
    def check_elf(self, path, target_os=None, target_arch=None):
        """
        Verify that the ELF binary $path matches the specified target
        OS/architecture, or if not specified the currently configured MACHINE's
        OS/architecture.
        """
        import oe.qa, oe.elf

        if not target_os or not target_arch:
            output = self._run("echo $OECORE_TARGET_OS:$OECORE_TARGET_ARCH")
            target_os, target_arch = output.strip().split(":")

        machine_data = oe.elf.machine_dict(None)[target_os][target_arch]
        (machine, osabi, abiversion, endian, bits) = machine_data

        elf = oe.qa.ELFFile(path)
        elf.open()

        self.assertEqual(machine, elf.machine(),
                         "Binary was %s but expected %s" %
                         (oe.qa.elf_machine_to_string(elf.machine()), oe.qa.elf_machine_to_string(machine)))
        self.assertEqual(bits, elf.abiSize())
        self.assertEqual(endian, elf.isLittleEndian())
Exemplo n.º 4
0
    def check_elf(self, path, target_os=None, target_arch=None):
        import oe.qa, oe.elf

        elf = oe.qa.ELFFile(path)
        elf.open()

        if not target_os or not target_arch:
            output = self._run("echo $OECORE_TARGET_OS:$OECORE_TARGET_ARCH")
            target_os, target_arch = output.strip().split(":")

        machine_data = oe.elf.machine_dict(None)[target_os][target_arch]
        (machine, osabi, abiversion, endian, bits) = machine_data

        self.assertEqual(machine, elf.machine())
        self.assertEqual(bits, elf.abiSize())
        self.assertEqual(endian, elf.isLittleEndian())