From 49bb971fdcb7c54c5044f5854de3c177a6f41d1f Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sun, 17 Jan 2016 13:21:15 -0800 Subject: fix C code in yacc file to be pass default compiler warnings --- test/YACC/live.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/YACC/live.py b/test/YACC/live.py index d567ec3..f6733da 100644 --- a/test/YACC/live.py +++ b/test/YACC/live.py @@ -61,20 +61,23 @@ foo.CFile(target = 'not_foo', source = 'foo.y') yacc = r""" %%{ #include +extern int yyparse(); +int yyerror(char *s); +int yylex(); -main() +int main() { - yyparse(); + return yyparse(); } -yyerror(s) +int yyerror(s) char *s; { fprintf(stderr, "%%s\n", s); return 0; } -yylex() +int yylex() { int c; -- cgit v0.12 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 From 04d57cfde1553cb10638a4f2d066c1c7f17a5d6f Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sun, 17 Jan 2016 15:33:39 -0800 Subject: added comment per William Blevins comment on pull request to indicate why we're skipping some tests for gcj --- test/Java/JAVAH.py | 3 +++ test/Java/multi-step.py | 3 +++ test/Java/nested-classes.py | 3 +++ 3 files changed, 9 insertions(+) diff --git a/test/Java/JAVAH.py b/test/Java/JAVAH.py index df0ec2d..81582d7 100644 --- a/test/Java/JAVAH.py +++ b/test/Java/JAVAH.py @@ -99,6 +99,9 @@ where_javah = test.java_where_javah() if java_version: java_version = repr(java_version) +# Skip this test as SCons doesn't (currently) predict the generated +# inner/anonymous class generated .class files generated by gcj +# and so will always fail if test.javac_is_gcj: test.skip_test('Test not valid for gcj (gnu java); skipping test(s).\n') diff --git a/test/Java/multi-step.py b/test/Java/multi-step.py index 4675895..160c523 100644 --- a/test/Java/multi-step.py +++ b/test/Java/multi-step.py @@ -43,6 +43,9 @@ swig = test.where_is('swig') if not swig: test.skip_test('Can not find installed "swig", skipping test.\n') +# Skip this test as SCons doesn't (currently) predict the generated +# inner/anonymous class generated .class files generated by gcj +# and so will always fail if test.javac_is_gcj: test.skip_test('Test not valid for gcj (gnu java); skipping test(s).\n') diff --git a/test/Java/nested-classes.py b/test/Java/nested-classes.py index 8126157..a764054 100644 --- a/test/Java/nested-classes.py +++ b/test/Java/nested-classes.py @@ -40,6 +40,9 @@ where_javac, java_version = test.java_where_javac() # Work around javac 1.4 not reporting its version: java_version = java_version or "1.4" +# Skip this test as SCons doesn't (currently) predict the generated +# inner/anonymous class generated .class files generated by gcj +# and so will always fail if test.javac_is_gcj: test.skip_test('Test not valid for gcj (gnu java); skipping test(s).\n') -- cgit v0.12 From 6cc2ad09d86e6da5812485b0e50a820e2560b31b Mon Sep 17 00:00:00 2001 From: Russel Winder Date: Tue, 19 Jan 2016 10:46:38 +0000 Subject: Correct the Issue number. Amend the test to use an option valid for dmd, ldc2, and gdc. --- .../Issues/2944/D_changed_DFLAGS_not_rebuilding.py | 23 ---------------------- test/D/Issues/2944/image/SConstruct | 11 ----------- test/D/Issues/2944/image/main.d | 11 ----------- .../Issues/2994/D_changed_DFLAGS_not_rebuilding.py | 23 ++++++++++++++++++++++ test/D/Issues/2994/image/SConstruct | 9 +++++++++ test/D/Issues/2994/image/main.d | 11 +++++++++++ 6 files changed, 43 insertions(+), 45 deletions(-) delete mode 100644 test/D/Issues/2944/D_changed_DFLAGS_not_rebuilding.py delete mode 100644 test/D/Issues/2944/image/SConstruct delete mode 100644 test/D/Issues/2944/image/main.d create mode 100644 test/D/Issues/2994/D_changed_DFLAGS_not_rebuilding.py create mode 100644 test/D/Issues/2994/image/SConstruct create mode 100644 test/D/Issues/2994/image/main.d diff --git a/test/D/Issues/2944/D_changed_DFLAGS_not_rebuilding.py b/test/D/Issues/2944/D_changed_DFLAGS_not_rebuilding.py deleted file mode 100644 index 1d9854f..0000000 --- a/test/D/Issues/2944/D_changed_DFLAGS_not_rebuilding.py +++ /dev/null @@ -1,23 +0,0 @@ -# Test to check for issue reported in tigris bug 2994 -# http://scons.tigris.org/issues/show_bug.cgi?id=2994 -# - -import TestSCons - -test = TestSCons.TestSCons() - -dmd_present = test.detect_tool('dmd', prog='dmd') -ldc_present = test.detect_tool('ldc',prog='ldc2') -gdc_present = test.detect_tool('gdc',prog='gdc') - -if not (dmd_present or ldc_present or gdc_present): - test.skip_test("Could not load dmd ldc or gdc Tool; skipping test(s).\n") - - -test.dir_fixture('image') -test.run() -test.fail_test('main.o' not in test.stdout()) -test.run(arguments='change=1') -test.fail_test('is up to date' in test.stdout()) - -test.pass_test() diff --git a/test/D/Issues/2944/image/SConstruct b/test/D/Issues/2944/image/SConstruct deleted file mode 100644 index 2c7deee..0000000 --- a/test/D/Issues/2944/image/SConstruct +++ /dev/null @@ -1,11 +0,0 @@ -# -*- codig:utf-8; -*- - -env=Environment() - -change = ARGUMENTS.get('change', 0) -if int(change): - env.Append(DFLAGS = '-d') - -env.Program('proj', ['main.d']) - - diff --git a/test/D/Issues/2944/image/main.d b/test/D/Issues/2944/image/main.d deleted file mode 100644 index f0aa23a..0000000 --- a/test/D/Issues/2944/image/main.d +++ /dev/null @@ -1,11 +0,0 @@ -/* This program prints a - hello world message - to the console. */ - -import std.stdio; - -void main() -{ - writeln("Hello, World!"); -} - diff --git a/test/D/Issues/2994/D_changed_DFLAGS_not_rebuilding.py b/test/D/Issues/2994/D_changed_DFLAGS_not_rebuilding.py new file mode 100644 index 0000000..1d9854f --- /dev/null +++ b/test/D/Issues/2994/D_changed_DFLAGS_not_rebuilding.py @@ -0,0 +1,23 @@ +# Test to check for issue reported in tigris bug 2994 +# http://scons.tigris.org/issues/show_bug.cgi?id=2994 +# + +import TestSCons + +test = TestSCons.TestSCons() + +dmd_present = test.detect_tool('dmd', prog='dmd') +ldc_present = test.detect_tool('ldc',prog='ldc2') +gdc_present = test.detect_tool('gdc',prog='gdc') + +if not (dmd_present or ldc_present or gdc_present): + test.skip_test("Could not load dmd ldc or gdc Tool; skipping test(s).\n") + + +test.dir_fixture('image') +test.run() +test.fail_test('main.o' not in test.stdout()) +test.run(arguments='change=1') +test.fail_test('is up to date' in test.stdout()) + +test.pass_test() diff --git a/test/D/Issues/2994/image/SConstruct b/test/D/Issues/2994/image/SConstruct new file mode 100644 index 0000000..3d059e7 --- /dev/null +++ b/test/D/Issues/2994/image/SConstruct @@ -0,0 +1,9 @@ +# -*- coding:utf-8; -*- + +env=Environment() + +change = ARGUMENTS.get('change', 0) +if int(change): + env.Append(DFLAGS = '-I.') + +env.Program('proj', ['main.d']) diff --git a/test/D/Issues/2994/image/main.d b/test/D/Issues/2994/image/main.d new file mode 100644 index 0000000..f0aa23a --- /dev/null +++ b/test/D/Issues/2994/image/main.d @@ -0,0 +1,11 @@ +/* This program prints a + hello world message + to the console. */ + +import std.stdio; + +void main() +{ + writeln("Hello, World!"); +} + -- cgit v0.12