diff options
Diffstat (limited to 'lib/oeqa/runtime/cases/javac.py')
| -rw-r--r-- | lib/oeqa/runtime/cases/javac.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/oeqa/runtime/cases/javac.py b/lib/oeqa/runtime/cases/javac.py new file mode 100644 index 0000000..ad6de25 --- /dev/null +++ b/lib/oeqa/runtime/cases/javac.py | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | import os | ||
| 2 | |||
| 3 | from oeqa.runtime.case import OERuntimeTestCase | ||
| 4 | from oeqa.core.decorator.depends import OETestDepends | ||
| 5 | from oeqa.core.decorator.oeid import OETestID | ||
| 6 | from oeqa.runtime.decorator.package import OEHasPackage | ||
| 7 | |||
| 8 | class JavacTest(OERuntimeTestCase): | ||
| 9 | |||
| 10 | @classmethod | ||
| 11 | def setUpClass(cls): | ||
| 12 | myfilesdir = os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../files/') | ||
| 13 | src = os.path.join(myfilesdir, 'test.java') | ||
| 14 | dst = '/tmp/test.java' | ||
| 15 | cls.tc.target.copyTo(src, dst) | ||
| 16 | |||
| 17 | @classmethod | ||
| 18 | def tearDownClass(cls): | ||
| 19 | dst = '/tmp/test.java /tmp/test.class' | ||
| 20 | cls.tc.target.run('rm %s' % dst) | ||
| 21 | |||
| 22 | @OETestDepends(['java.JavaTest.test_java_exists']) | ||
| 23 | def test_javac_exists(self): | ||
| 24 | status, output = self.target.run('which javac') | ||
| 25 | msg = 'javac binary not in PATH or not on target.' | ||
| 26 | self.assertEqual(status, 0, msg=msg) | ||
| 27 | |||
| 28 | @OETestDepends(['javac.JavacTest.test_javac_exists']) | ||
| 29 | def test_javac_works(self): | ||
| 30 | status, output = self.target.run('javac /tmp/test.java') | ||
| 31 | msg = 'Exit status was not 0. Output: %s' % output | ||
| 32 | self.assertEqual(status, 0, msg=msg) | ||
