Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 1 | import os |
| 2 | import shutil |
| 3 | import unittest |
| 4 | |
| 5 | from oeqa.core.utils.path import remove_safe |
| 6 | from oeqa.sdk.case import OESDKTestCase |
| 7 | |
| 8 | class PerlTest(OESDKTestCase): |
| 9 | @classmethod |
| 10 | def setUpClass(self): |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 11 | if not (self.tc.hasHostPackage("nativesdk-perl") or |
| 12 | self.tc.hasHostPackage("perl-native")): |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 13 | 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) |