Hi Michael, Cc'd the bug-bison.
> Le 25 janv. 2015 à 17:44, Michael Felt <aixto...@gmail.com> a écrit : > > ## ------------- ## > ## Test results. ## > ## ------------- ## > > ERROR: 491 tests were run, > 3 failed unexpectedly. > 2 tests were skipped. > ## -------------------------- ## > ## testsuite.log was created. ## > ## -------------------------- ## The relevant part of your logs are: > # -*- compilation -*- > 95. output.at:264: testing Output file name: `~!@#$%^&*()-=_+{}[]|\:;<>, .' > ... > ./output.at:264: touch "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.tmp" || exit 77 > ./output.at:264: bison -fno-caret -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" > --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h" glr.y > ./output.at:264: ls "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" > "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h" > stdout: > `~!@#$%^&*()-=_+{}[]|\:;<>, .'.c > `~!@#$%^&*()-=_+{}[]|\:;<>, .'.h > ./output.at:264: $BISON_C_WORKS > stderr: > stdout: > ./output.at:264: $CC $CFLAGS $CPPFLAGS -c -o glr.o -c > "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" > stderr: > stdout: > ./output.at:264: bison -fno-caret -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.cc" > --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.hh" cxx.y > ./output.at:264: ls "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.cc" > "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.hh" > stdout: > `~!@#$%^&*()-=_+{}[]|\:;<>, .'.cc > `~!@#$%^&*()-=_+{}[]|\:;<>, .'.hh > ./output.at:264: $BISON_CXX_WORKS > stderr: > stdout: > ./output.at:264: $CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c > "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.cc" > stderr: > 1500-004: (U) INTERNAL COMPILER ERROR while compiling > yy::parser::~parser(). Compilation ended. Contact your Service > Representative and provide the following information: Internal abort. For > more information visit: http://www.ibm.com/support/docview.wss?uid=swg21110810 > stdout: > ./output.at:264: exit code was 1, expected 0 > 95. output.at:264: 95. Output file name: `~!@#$%^&*()-=_+{}[]|\:;<>, .' > (output.at:264): FAILED (output.at:264) So it appears that there is something that your compiler dislikes here, I don't know what. You probably should report the bug. > # -*- compilation -*- > 463. javapush.at:311: testing Calc parser with api.push-pull both ... > ./javapush.at:579: bison -fno-caret -Dapi.push-pull=both -o Calc.java Calc.y > ./javapush.at:580: $SHELL ../../../javacomp.sh Calc.java > stderr: > Calc.java:1072: cannot resolve symbol > symbol : class StringBuilder > location: class Calc > StringBuilder buf = new StringBuilder(); > ^ > Calc.java:1072: cannot resolve symbol > symbol : class StringBuilder > location: class Calc > StringBuilder buf = new StringBuilder(); > ^ > 2 errors > stdout: > ./javapush.at:580: exit code was 1, expected 0 > 463. javapush.at:311: 463. Calc parser with api.push-pull both > (javapush.at:311): FAILED (javapush.at:580) The problem here is that your Java compiler is too old and does not feature the StringBuilder. Since this is not the first time that this is reported as a bug, I guess we should skip the test if Java is not recent enough. Could you try the patch below? > # -*- compilation -*- > 464. javapush.at:599: testing Calc parser with %locations %code lexer and > api.push-pull both ... > ./javapush.at:851: bison -fno-caret -Dapi.push-pull=both -o Calc.java Calc.y > ./javapush.at:852: $SHELL ../../../javacomp.sh Calc.java > stderr: > Calc.java:1245: cannot resolve symbol > symbol : class StringBuilder > location: class Calc > StringBuilder buf = new StringBuilder(); > ^ > Calc.java:1245: cannot resolve symbol > symbol : class StringBuilder > location: class Calc > StringBuilder buf = new StringBuilder(); > ^ > 2 errors > stdout: > ./javapush.at:852: exit code was 1, expected 0 > 464. javapush.at:599: 464. Calc parser with %locations %code lexer and > api.push-pull both (javapush.at:599): FAILED (javapush.at:852) commit fc46324b2aad543c8ddc8b31fa79bd40eb705b66 Author: Akim Demaille <a...@lrde.epita.fr> Date: Tue Jan 27 07:41:25 2015 +0100 tests: java: skip tests with unmeet requirements Reported by Michael Felt. * tests/local.at (AT_SKIP_IF_NO_JAVAC): New. * tests/javapush.at (Calc parser with api.push-pull both): Skip if StringBuilder is not available. diff --git a/tests/javapush.at b/tests/javapush.at index 28e6947..a15e73b 100644 --- a/tests/javapush.at +++ b/tests/javapush.at @@ -244,7 +244,7 @@ m4_define([AT_CALC_BODY],[ StringBuilder buf = new StringBuilder(); FileReader file = new FileReader(filename); int c; - while ((c=file.read()) > 0) + while (0 < (c = file.read())) buf.append((char)c); file.close(); return new StringReader(buf.toString()); @@ -577,8 +577,23 @@ Stack now 0 7 15 ]]) AT_BISON_CHECK([PUSHPULLFLAG [-o Calc.java Calc.y]]) + +# We use StringBuffer which requires Java 1.5. +AT_SKIP_IF_NO_JAVAC +AT_DATA([Test.java], +[[class Test +{ + static void test() + { + new StringBuilder(); + } +} +]]) +AT_CHECK([[$SHELL ../../../javacomp.sh Test.java || exit 77]], + [[0]], [ignore], [ignore]) + AT_JAVA_COMPILE([[Calc.java]]) -#Verify that this is a push parser. +# Verify that this is a push parser. AT_CHECK_JAVA_GREP([[Calc.java]], [[.*public void push_parse_initialize().*]]) # Capture stderr output for comparison purposes. diff --git a/tests/local.at b/tests/local.at index 5a459c6..84fa135 100644 --- a/tests/local.at +++ b/tests/local.at @@ -778,14 +778,21 @@ AT_CHECK(m4_join([ ], 0, [ignore], [ignore])]) +# AT_SKIP_IF_NO_JAVAC +# ------------------- +# Check that we can compile Java code. +m4_define([AT_SKIP_IF_NO_JAVAC], +[AT_KEYWORDS(java) +AT_SKIP_IF([[test -z "$CONF_JAVAC"]]) +AT_SKIP_IF([[test -z "$CONF_JAVA"]]) +]) + # AT_JAVA_COMPILE(SOURCES) # ------------------------ # Compile SOURCES into Java class files. Skip the test if java or javac # is not installed. m4_define([AT_JAVA_COMPILE], -[AT_KEYWORDS(java) -AT_SKIP_IF([[test -z "$CONF_JAVAC"]]) -AT_SKIP_IF([[test -z "$CONF_JAVA"]]) +[AT_SKIP_IF_NO_JAVAC AT_CHECK([[$SHELL ../../../javacomp.sh ]$1], [[0]], [ignore], [ignore])])