tests/regression/bugzilla/*.class
tests/regression/codepatching/*.class
tests/regression/jasmin/*.class
+tests/regression/junit/*.class
tests/regression/native/*.class
tests/regression/native/*.h
tests/regression/native/*.so
[tests/regression/codepatching/Makefile]
[tests/regression/assertion/Makefile]
[tests/regression/jasmin/Makefile]
+ [tests/regression/junit/Makefile]
[tests/regression/native/Makefile]
[tests/regression/resolving/Makefile]
[tests/regression/resolving/classes1/Makefile]
bugzilla \
codepatching \
jasmin \
+ junit \
native \
resolving
$(srcdir)/fptest.java \
$(srcdir)/fp.java \
$(srcdir)/extest.java \
- $(srcdir)/clinitexception.java \
$(srcdir)/LoadDisplacementOverflow.java \
$(srcdir)/FieldDisplacementOverflow.java \
$(srcdir)/StackDisplacementOverflow.java \
fptest.output \
fp.output\
extest.2output \
- clinitexception.2output \
LoadDisplacementOverflow.output \
FieldDisplacementOverflow.output \
StackDisplacementOverflow.output \
fp \
extest \
\
- clinitexception \
LoadDisplacementOverflow \
FieldDisplacementOverflow \
StackDisplacementOverflow \
check: build $(SIMPLE_JAVA_TESTS) $(OUTPUT_JAVA_TESTS)
build:
- @$(JAVACCMD) -d . $(SOURCE_FILES)
+ $(JAVACCMD) -d . $(SOURCE_FILES)
$(SIMPLE_JAVA_TESTS):
@echo "$@: "
+++ /dev/null
-Exception in thread "main" java.lang.ExceptionInInitializerError
- <<No stacktrace available>>
-Caused by: java.lang.RuntimeException
- at clinitexception.<clinit>(clinitexception.java:4)
+++ /dev/null
-public class clinitexception {
- static {
- if (true)
- throw new RuntimeException();
- }
-
- public static void main(String[] argv) {
- }
-}
--- /dev/null
+/* tests/regression/junit/All.java - runs all CACAO regression unit tests
+
+ Copyright (C) 2008
+ CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
+
+ This file is part of CACAO.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2, or (at
+ your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
+
+*/
+
+
+import junit.framework.*;
+import junit.textui.*;
+
+public class All extends TestCase {
+ /**
+ * Runs all CACAO regression unit tests using
+ * junit.textui.TestRunner
+ */
+ public static void main(String[] args) {
+ Test s = suite();
+ TestRunner.run(s);
+ }
+
+ /**
+ * Collects all CACAO regression unit tests as one suite.
+ */
+ public static Test suite() {
+ TestSuite suite = new TestSuite("CACAO Regression Unit Tests");
+
+ // Add your test here.
+
+ suite.addTest(new TestSuite(TestExceptionInStaticClassInitializer.class));
+
+ return suite;
+ }
+}
--- /dev/null
+## tests/regression/junit/Makefile.am
+##
+## Copyright (C) 2008
+## CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
+##
+## This file is part of CACAO.
+##
+## This program is free software; you can redistribute it and/or
+## modify it under the terms of the GNU General Public License as
+## published by the Free Software Foundation; either version 2, or (at
+## your option) any later version.
+##
+## This program is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+## 02110-1301, USA.
+
+
+JAVA = LD_LIBRARY_PATH=$(top_builddir)/src/cacao/.libs $(top_builddir)/src/cacao/cacao
+JAVACMD = $(JAVA) -Xbootclasspath:$(BOOTCLASSPATH)
+JAVACCMD = $(JAVAC) -bootclasspath $(BOOTCLASSPATH)
+
+EXTRA_DIST = \
+ *.java
+
+CLEANFILES = \
+ *.class
+
+build:
+ $(JAVACCMD) -classpath /usr/share/java/junit4.jar -d . $(srcdir)/*.java
+
+check: build
+ $(JAVACMD) -classpath /usr/share/java/junit4.jar:. org.junit.runner.JUnitCore All
+
+
+## Local variables:
+## mode: Makefile
+## indent-tabs-mode: t
+## c-basic-offset: 4
+## tab-width: 8
+## compile-command: "automake --add-missing"
+## End:
--- /dev/null
+/* tests/regression/bugzilla/TestExceptionInStaticClassInitializer.java
+
+ Copyright (C) 2008
+ CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
+
+ This file is part of CACAO.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2, or (at
+ your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
+
+*/
+
+
+import junit.framework.*;
+import junit.textui.*;
+
+public class TestExceptionInStaticClassInitializer extends TestCase {
+ public static void main(String[] args) {
+ TestRunner.run(suite());
+ }
+
+ public static Test suite() {
+ return new TestSuite(TestExceptionInStaticClassInitializer.class);
+ }
+
+ public void test() {
+ try {
+ TestExceptionInStaticClassInitializer_x.i = 1;
+ fail("Should throw ExceptionInInitializerError");
+ }
+ catch (ExceptionInInitializerError success) {
+ Throwable cause = success.getCause();
+
+ assertTrue("Cause should be RuntimeException but is " + cause.getClass(), cause.getClass() == RuntimeException.class);
+
+ StackTraceElement[] ste = cause.getStackTrace();
+
+ assertTrue("Linenumber should be " + LINE + " but is " + ste[0].getLineNumber(), ste[0].getLineNumber() == LINE);
+ }
+ }
+
+ // This linenumber must be the one from...
+ final static int LINE = 64;
+}
+
+class TestExceptionInStaticClassInitializer_x {
+ static int i;
+
+ static {
+ if (true)
+ // ...the following line.
+ throw new RuntimeException();
+ }
+}