Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | import unittest |
| 2 | import os |
| 3 | import shutil |
| 4 | from oeqa.oetest import oeSDKTest, skipModule |
| 5 | from oeqa.utils.decorators import * |
| 6 | |
| 7 | def setUpModule(): |
| 8 | if not oeSDKTest.hasHostPackage("nativesdk-perl"): |
| 9 | skipModule("No perl package in the SDK") |
| 10 | |
| 11 | |
| 12 | class PerlTest(oeSDKTest): |
| 13 | |
| 14 | @classmethod |
| 15 | def setUpClass(self): |
| 16 | for f in ['test.pl']: |
| 17 | shutil.copyfile(os.path.join(self.tc.filesdir, f), self.tc.sdktestdir + f) |
| 18 | self.testfile = self.tc.sdktestdir + "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/test.pl' % self.tc.sdktestdir) |
| 25 | |
| 26 | @classmethod |
| 27 | def tearDownClass(self): |
| 28 | bb.utils.remove("%s/test.pl" % self.tc.sdktestdir) |