blob: 8085678116c1158cc2d0316108e3446c34166746 [file] [log] [blame]
Brad Bishop6e60e8b2018-02-01 10:27:11 -05001import os
2import shutil
3import unittest
4
5from oeqa.core.utils.path import remove_safe
6from oeqa.sdk.case import OESDKTestCase
7
8class PerlTest(OESDKTestCase):
9 @classmethod
10 def setUpClass(self):
Brad Bishopd7bf8c12018-02-25 22:55:05 -050011 if not (self.tc.hasHostPackage("nativesdk-perl") or
12 self.tc.hasHostPackage("perl-native")):
Brad Bishop6e60e8b2018-02-01 10:27:11 -050013 raise unittest.SkipTest("No perl package in the SDK")
14
15 for f in ['test.pl']:
16 shutil.copyfile(os.path.join(self.tc.files_dir, f),
17 os.path.join(self.tc.sdk_dir, f))
18 self.testfile = os.path.join(self.tc.sdk_dir, "test.pl")
19
20 def test_perl_exists(self):
21 self._run('which perl')
22
23 def test_perl_works(self):
24 self._run('perl %s' % self.testfile)
25
26 @classmethod
27 def tearDownClass(self):
28 remove_safe(self.testfile)