mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 21:09:03 +02:00

The manifests for eSDK are generated using shared states so there is a need to validate to different "packages names" into the test cases. For example for perl: SDK provides nativesdk-perl eSDK provides perl-native [YOCTO #9090] (From OE-Core rev: 8db06dd1290dd53d626050879c9c306f95d76ac2) Signed-off-by: Francisco Pedraza <francisco.j.pedraza.gonzalez@intel.com> Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
44 lines
1.5 KiB
Python
44 lines
1.5 KiB
Python
import os
|
|
import shutil
|
|
import unittest
|
|
|
|
from oeqa.core.utils.path import remove_safe
|
|
from oeqa.sdk.case import OESDKTestCase
|
|
|
|
class GccCompileTest(OESDKTestCase):
|
|
td_vars = ['MACHINE']
|
|
|
|
@classmethod
|
|
def setUpClass(self):
|
|
files = {'test.c' : self.tc.files_dir, 'test.cpp' : self.tc.files_dir,
|
|
'testsdkmakefile' : self.tc.sdk_files_dir}
|
|
for f in files:
|
|
shutil.copyfile(os.path.join(files[f], f),
|
|
os.path.join(self.tc.sdk_dir, f))
|
|
|
|
def setUp(self):
|
|
machine = self.td.get("MACHINE")
|
|
if not (self.tc.hasTargetPackage("packagegroup-cross-canadian-%s" % machine) or
|
|
self.tc.hasTargetPackage("gcc")):
|
|
raise unittest.SkipTest("GccCompileTest class: SDK doesn't contain a cross-canadian toolchain")
|
|
|
|
def test_gcc_compile(self):
|
|
self._run('$CC %s/test.c -o %s/test -lm' % (self.tc.sdk_dir, self.tc.sdk_dir))
|
|
|
|
def test_gpp_compile(self):
|
|
self._run('$CXX %s/test.c -o %s/test -lm' % (self.tc.sdk_dir, self.tc.sdk_dir))
|
|
|
|
def test_gpp2_compile(self):
|
|
self._run('$CXX %s/test.cpp -o %s/test -lm' % (self.tc.sdk_dir, self.tc.sdk_dir))
|
|
|
|
def test_make(self):
|
|
self._run('cd %s; make -f testsdkmakefile' % self.tc.sdk_dir)
|
|
|
|
@classmethod
|
|
def tearDownClass(self):
|
|
files = [os.path.join(self.tc.sdk_dir, f) \
|
|
for f in ['test.c', 'test.cpp', 'test.o', 'test',
|
|
'testsdkmakefile']]
|
|
for f in files:
|
|
remove_safe(f)
|