diff options
Diffstat (limited to 'meta/lib/oeqa/sdk/cases/perl.py')
-rw-r--r-- | meta/lib/oeqa/sdk/cases/perl.py | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/meta/lib/oeqa/sdk/cases/perl.py b/meta/lib/oeqa/sdk/cases/perl.py index 8085678116..8eab4442e8 100644 --- a/meta/lib/oeqa/sdk/cases/perl.py +++ b/meta/lib/oeqa/sdk/cases/perl.py @@ -1,28 +1,22 @@ -import os -import shutil -import unittest +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# -from oeqa.core.utils.path import remove_safe +import unittest from oeqa.sdk.case import OESDKTestCase +from oeqa.utils.subprocesstweak import errors_have_output +errors_have_output() + class PerlTest(OESDKTestCase): - @classmethod - def setUpClass(self): + def setUp(self): if not (self.tc.hasHostPackage("nativesdk-perl") or self.tc.hasHostPackage("perl-native")): raise unittest.SkipTest("No perl package in the SDK") - for f in ['test.pl']: - shutil.copyfile(os.path.join(self.tc.files_dir, f), - os.path.join(self.tc.sdk_dir, f)) - self.testfile = os.path.join(self.tc.sdk_dir, "test.pl") - - def test_perl_exists(self): - self._run('which perl') - - def test_perl_works(self): - self._run('perl %s' % self.testfile) - - @classmethod - def tearDownClass(self): - remove_safe(self.testfile) + def test_perl(self): + cmd = "perl -e '$_=\"Uryyb, jbeyq\"; tr/a-zA-Z/n-za-mN-ZA-M/;print'" + output = self._run(cmd) + self.assertEqual(output, "Hello, world") |