From 87d2714f989ab8082dc5bd4111c9d5212e81b1a9 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sun, 17 Jan 2016 14:02:32 -0800 Subject: changes to skip tests on ubuntu-next when gcj and not real java, and also when no latex is available --- QMTest/TestSCons.py | 7 +++++++ test/DVIPDF/makeindex.py | 11 +++++++++-- test/DVIPS/DVIPS.py | 3 +++ test/DVIPS/DVIPSFLAGS.py | 3 +++ test/Java/JAVAH.py | 4 ++-- test/Java/multi-step.py | 4 ++++ test/Java/nested-classes.py | 4 ++++ test/TEX/TEX.py | 3 +++ test/TEX/bibliography.py | 12 ++++++++++-- test/TEX/multi-run.py | 2 ++ 10 files changed, 47 insertions(+), 6 deletions(-) diff --git a/QMTest/TestSCons.py b/QMTest/TestSCons.py index a9fd6a0..43832e8 100644 --- a/QMTest/TestSCons.py +++ b/QMTest/TestSCons.py @@ -201,6 +201,7 @@ class TestSCons(TestCommon): """ scons_version = SConsVersion + javac_is_gcj = False def __init__(self, **kw): """Initialize an SCons testing object. @@ -768,8 +769,13 @@ class TestSCons(TestCommon): m = re.search(r'javac (\d\.\d)', self.stderr()) if m: version = m.group(1) + self.javac_is_gcj = False + elif self.stderr().find('gcj'): + version='1.2' + self.javac_is_gcj = True else: version = None + self.javac_is_gcj = False return where_javac, version def java_where_javah(self, version=None): @@ -792,6 +798,7 @@ class TestSCons(TestCommon): self.skip_test("Could not find Java rmic, skipping non-simulated test(s).\n") return where_rmic + def java_get_class_files(self, dir): result = [] for dirpath, dirnames, filenames in os.walk(dir): diff --git a/test/DVIPDF/makeindex.py b/test/DVIPDF/makeindex.py index 22a31be..b4ac2d0 100644 --- a/test/DVIPDF/makeindex.py +++ b/test/DVIPDF/makeindex.py @@ -31,10 +31,17 @@ test = TestSCons.TestSCons() dvipdf = test.where_is('dvipdf') +if not dvipdf: + test.skip_test('Could not find dvipdf; skipping test(s).\n') + tex = test.where_is('tex') +if not tex: + test.skip_test('Could not find tex; skipping test(s).\n') + +latex = test.where_is('latex') +if not latex: + test.skip_test('Could not find latex; skipping test(s).\n') -if not dvipdf or not tex: - test.skip_test('Could not find dvipdf or text; skipping test(s).\n') diff --git a/test/DVIPS/DVIPS.py b/test/DVIPS/DVIPS.py index e28a121..b243bfc 100644 --- a/test/DVIPS/DVIPS.py +++ b/test/DVIPS/DVIPS.py @@ -114,6 +114,9 @@ test.must_match('test3.ps', "This is a .ltx test.\n") test.must_match('test4.ps', "This is a .latex test.\n") +have_latex = test.where_is('latex') +if not have_latex: + test.skip_test('Could not find latex; skipping test(s).\n') dvips = test.where_is('dvips') diff --git a/test/DVIPS/DVIPSFLAGS.py b/test/DVIPS/DVIPSFLAGS.py index 285c729..4ab1b53 100644 --- a/test/DVIPS/DVIPSFLAGS.py +++ b/test/DVIPS/DVIPSFLAGS.py @@ -120,6 +120,9 @@ test.must_match('test3.ps', " -x\nThis is a .ltx test.\n") test.must_match('test4.ps', " -x\nThis is a .latex test.\n") +have_latex = test.where_is('latex') +if not have_latex: + test.skip_test('Could not find latex; skipping test(s).\n') dvips = test.where_is('dvips') diff --git a/test/Java/JAVAH.py b/test/Java/JAVAH.py index f7c9dcc..df0ec2d 100644 --- a/test/Java/JAVAH.py +++ b/test/Java/JAVAH.py @@ -93,14 +93,14 @@ line 3 test.must_match('test2.h', "test2.JAVA\nline 3\n") - where_javac, java_version = test.java_where_javac() where_javah = test.java_where_javah() if java_version: java_version = repr(java_version) - +if test.javac_is_gcj: + test.skip_test('Test not valid for gcj (gnu java); skipping test(s).\n') test.write("wrapper.py", """\ import os diff --git a/test/Java/multi-step.py b/test/Java/multi-step.py index a8efcd4..4675895 100644 --- a/test/Java/multi-step.py +++ b/test/Java/multi-step.py @@ -43,6 +43,10 @@ swig = test.where_is('swig') if not swig: test.skip_test('Can not find installed "swig", skipping test.\n') +if test.javac_is_gcj: + test.skip_test('Test not valid for gcj (gnu java); skipping test(s).\n') + + test.subdir(['src'], diff --git a/test/Java/nested-classes.py b/test/Java/nested-classes.py index 2b1b5db..8126157 100644 --- a/test/Java/nested-classes.py +++ b/test/Java/nested-classes.py @@ -40,6 +40,10 @@ where_javac, java_version = test.java_where_javac() # Work around javac 1.4 not reporting its version: java_version = java_version or "1.4" +if test.javac_is_gcj: + test.skip_test('Test not valid for gcj (gnu java); skipping test(s).\n') + + test.write('SConstruct', """ env = Environment() env['JAVAVERSION'] = '%(java_version)s' diff --git a/test/TEX/TEX.py b/test/TEX/TEX.py index 24d4bdd..42c1903 100644 --- a/test/TEX/TEX.py +++ b/test/TEX/TEX.py @@ -35,6 +35,9 @@ _python_ = TestSCons._python_ test = TestSCons.TestSCons() +have_latex = test.where_is('latex') +if not have_latex: + test.skip_test('Could not find latex; skipping test(s).\n') test.write('mytex.py', r""" diff --git a/test/TEX/bibliography.py b/test/TEX/bibliography.py index c26b010..9e79320 100644 --- a/test/TEX/bibliography.py +++ b/test/TEX/bibliography.py @@ -36,11 +36,19 @@ import TestSCons test = TestSCons.TestSCons() dvips = test.where_is('dvips') + +if not dvips: + test.skip_test("Could not find dvips; skipping test(s).\n") + bibtex = test.where_is('bibtex') +if not bibtex: + test.skip_test("Could not find bibtex; skipping test(s).\n") -if not dvips or not bibtex: - test.skip_test("Could not find dvips or bibtex; skipping test(s).\n") +have_latex = test.where_is('latex') +if not have_latex: + test.skip_test('Could not find latex; skipping test(s).\n') + test.write('SConstruct', """\ import os env = Environment(tools = ['tex', 'latex', 'dvips']) diff --git a/test/TEX/multi-run.py b/test/TEX/multi-run.py index 7e94be3..37a839b 100644 --- a/test/TEX/multi-run.py +++ b/test/TEX/multi-run.py @@ -39,6 +39,8 @@ test = TestSCons.TestSCons() tex = test.where_is('tex') latex = test.where_is('latex') +if not latex: + test.skip_test("Could not find latex; skipping test(s).\n") if not tex and not latex: test.skip_test("Could not find tex or latex; skipping test(s).\n") -- cgit v0.12