aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/sdk/cases/perl.py
blob: 6f22ceba8ef5b66d8cb6b7250a3ce0c55d1017a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import os
import shutil
import unittest

from oeqa.core.utils.path import remove_safe
from oeqa.sdk.case import OESDKTestCase

class PerlTest(OESDKTestCase):
    @classmethod
    def setUpClass(self):
        if not (self.tc.hasHostPackage("nativesdk-perl") or 
                self.tc.hasHostPackage("perl-native") or
                self.tc.hasHostPackage("libperl5") or 
                self.tc.hasHostPackage("perl")):
            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)