From 827ad09b6ff2ec1bf3c13a6a84f046ff3313b9f6 Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Sun, 20 May 2012 02:00:10 +0200 Subject: [PATCH] Makefile: optional call file for testcases in order to easier pass arguments to the JVM for certain testcases, e.g. classpath stuff --- Makefile | 12 +++++++++--- tests/ClassPath2.call | 1 + tests/ClassPath2.compile | 2 ++ tests/ClassPath2.java | 7 +++++++ tests/ClassPath3.call | 1 + tests/ClassPath3.compile | 1 + tests/ClassPath3.java | 7 +++++++ tests/JARUsage1.call | 1 + tests/JARUsage1.compile | 1 + tests/JARUsage1.java | 7 +++++++ tests/JARUsage2.call | 1 + tests/JARUsage2.java | 7 +++++++ tests/jar1.jar | Bin 0 -> 2084 bytes tests/this/is/a/class/path/test/ClassPath1.java | 11 +++++++++++ tests/this/is/a/class/path/test/ClassPath2.java | 7 +++++++ 15 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 tests/ClassPath2.call create mode 100644 tests/ClassPath2.compile create mode 100644 tests/ClassPath2.java create mode 100644 tests/ClassPath3.call create mode 100644 tests/ClassPath3.compile create mode 100644 tests/ClassPath3.java create mode 100644 tests/JARUsage1.call create mode 100644 tests/JARUsage1.compile create mode 100644 tests/JARUsage1.java create mode 100644 tests/JARUsage2.call create mode 100644 tests/JARUsage2.java create mode 100644 tests/jar1.jar create mode 100644 tests/this/is/a/class/path/test/ClassPath1.java create mode 100644 tests/this/is/a/class/path/test/ClassPath2.java diff --git a/Makefile b/Makefile index 55954ae..48a1b40 100644 --- a/Makefile +++ b/Makefile @@ -25,12 +25,18 @@ all: mate $(CLASS_FILES) tests: mate $(TEST_CLASS_FILES) +CALLF = $(basename $@).call +testcase = ./tools/openjdktest.sh "$(1) $(basename $@)" %.test: %.class mate - @./tools/openjdktest.sh $(basename $@) - + @if [ -f $(CALLF) ]; \ + then $(call testcase,`cat $(CALLF)`); \ + else $(call testcase, ); fi +COMPILEF = $(basename $@).compile %.class: %.java - $(JAVAC) $< + @if [ -f $(COMPILEF) ]; \ + then $(SHELL) $(COMPILEF); \ + else $(JAVAC) $<; fi ffi/native.o: ffi/native.c ghc -Wall -O2 -c $< -o $@ diff --git a/tests/ClassPath2.call b/tests/ClassPath2.call new file mode 100644 index 0000000..7047aa4 --- /dev/null +++ b/tests/ClassPath2.call @@ -0,0 +1 @@ +-cp .:tests/this/is/a/class diff --git a/tests/ClassPath2.compile b/tests/ClassPath2.compile new file mode 100644 index 0000000..1bdc2d3 --- /dev/null +++ b/tests/ClassPath2.compile @@ -0,0 +1,2 @@ +javac tests/this/is/a/class/path/test/ClassPath1.java +javac -classpath tests/this/is/a/class tests/ClassPath2.java diff --git a/tests/ClassPath2.java b/tests/ClassPath2.java new file mode 100644 index 0000000..e4cbc5f --- /dev/null +++ b/tests/ClassPath2.java @@ -0,0 +1,7 @@ +package tests; + +public class ClassPath2 { + public static void main(String args[]) { + path.test.ClassPath1.hello(); + } +} diff --git a/tests/ClassPath3.call b/tests/ClassPath3.call new file mode 100644 index 0000000..2b0240e --- /dev/null +++ b/tests/ClassPath3.call @@ -0,0 +1 @@ +-cp tests/this/is/a/class:. path.test.ClassPath2 diff --git a/tests/ClassPath3.compile b/tests/ClassPath3.compile new file mode 100644 index 0000000..2498b45 --- /dev/null +++ b/tests/ClassPath3.compile @@ -0,0 +1 @@ +javac tests/this/is/a/class/path/test/ClassPath2.java diff --git a/tests/ClassPath3.java b/tests/ClassPath3.java new file mode 100644 index 0000000..ad4b204 --- /dev/null +++ b/tests/ClassPath3.java @@ -0,0 +1,7 @@ +package tests; + +public class ClassPath3 { + public static void main(String args[]) { + // fake + } +} diff --git a/tests/JARUsage1.call b/tests/JARUsage1.call new file mode 100644 index 0000000..b588bde --- /dev/null +++ b/tests/JARUsage1.call @@ -0,0 +1 @@ +-cp .:tests/jar1.jar diff --git a/tests/JARUsage1.compile b/tests/JARUsage1.compile new file mode 100644 index 0000000..8473ead --- /dev/null +++ b/tests/JARUsage1.compile @@ -0,0 +1 @@ +javac -classpath tests/jar1.jar tests/JARUsage1.java diff --git a/tests/JARUsage1.java b/tests/JARUsage1.java new file mode 100644 index 0000000..8eb2dd5 --- /dev/null +++ b/tests/JARUsage1.java @@ -0,0 +1,7 @@ +package tests; + +public class JARUsage1 { + public static void main(String []args) { + javaapplication2.NewClass.OHAI(); + } +} diff --git a/tests/JARUsage2.call b/tests/JARUsage2.call new file mode 100644 index 0000000..8975e0c --- /dev/null +++ b/tests/JARUsage2.call @@ -0,0 +1 @@ +-jar tests/jar1.jar diff --git a/tests/JARUsage2.java b/tests/JARUsage2.java new file mode 100644 index 0000000..839b087 --- /dev/null +++ b/tests/JARUsage2.java @@ -0,0 +1,7 @@ +package tests; + +public class JARUsage2 { + public static void main(String []args) { + // dummy + } +} diff --git a/tests/jar1.jar b/tests/jar1.jar new file mode 100644 index 0000000000000000000000000000000000000000..3c2cd94c139d4fddeffa34580b32b5c3dbdff12f GIT binary patch literal 2084 zcmc(gTTc@~6vzMD+qUa2Qd&?%Wx)%eX^TjV0b{5HBA1pXC1_%znYIh8+3u2dtKrea zk3vi|K8Pl2O!Ncr;wLaM`s`OAp4pXlyDdJMIPL7^%>SI3IrE#H!b&hC0a4)lt9Nto zlo&$DEv#o#OZmmj;Q>%+O23hG@cG3bKS|DOl4?_$%jTCB7mDlY++vQI`leR5QyW^X zu3P4edM!PvNLkZk$?mZ7wx*Je8gHhrE7E*TW42aF-Pz^(8|leMQ`4!^)U-NYY?x|J zFW0R4Zr#?Zb#=)srzgn6VD);c!0hcARgvze=GSt$h5Y)Anq#_|a$41=x?!j#O=Xpe zR#92QwyMn5%giu#)e`+1x=~T2mcxwtm_1=^XU8CsO@p6GFOwnbF({HEwUXk`U!0QS z50Pn?H(ri@-46h~j&+m!drX)4Ob-q}eIfM}#w1#!{ul;uDvHx01|^)qkc6{1C*r(- z$SvK}?b`x^;}aVKLi1Kd6L4}>H?@4DTGDFktYna-Z`GniY_OWn-~Sjx_O@OZaACD$ z68=%mQs^pWTEM{g14o`Qn7NfH+BMzWnsvHnwJi#k=+Z1eDq4+NSzFZkSo;0Z)4YF~ z2#tvtmZ4%qK-@2q1oU#9+wofIu~xQ4jLNuxiy|(`xQv*95iapAX~rL?Elkm&jIw7n zY#Nw5Gu_G*Xj(Q+PGeP?dcx_q-At+9;i63ex5hg&;?06P*4c?;q7QZqIj=o+h^C~k z-OVmx1R_zuO8^2-6J2RXBSUwA?%^vRAnZHMC+He+j0$9WmR$i9^w3)jC(%n5?mUm6 z(-wb=KwmKU8KL(G-}{J2D^L$ffCM=w$*tcLFpfC-sEu+%*8r03)IWUv;#&_9&+9M= zj-8>8_F+zYJVv1tQ6xq5OB{R=r~eJ;L(U4c(Q%Y&4mi)X4^`!;{STrdqO=EPz6S+_ zxkGm>&&oK*x98v1)AEn+>2Vo50nXbIV={rl8S7~}UvU5; z4%!&wfVm7xgbv7y(@9?~dJdqsup$JKLF(j~6N^+-dhsjE@6AKWJ-=G6-A*v>z{}pV zt8{I;dd{=IbsG49b;-D V?3^rxm2iYRgz5K?#_+~@`whEs@X`PP literal 0 HcmV?d00001 diff --git a/tests/this/is/a/class/path/test/ClassPath1.java b/tests/this/is/a/class/path/test/ClassPath1.java new file mode 100644 index 0000000..00db0da --- /dev/null +++ b/tests/this/is/a/class/path/test/ClassPath1.java @@ -0,0 +1,11 @@ +package path.test; + +public class ClassPath1 { + public static void hello () { + System.out.printf("hello, i'm ClassPath1\n"); + } + + public static void main(String []args) { + System.out.printf("hello again\n"); + } +} diff --git a/tests/this/is/a/class/path/test/ClassPath2.java b/tests/this/is/a/class/path/test/ClassPath2.java new file mode 100644 index 0000000..8c97eec --- /dev/null +++ b/tests/this/is/a/class/path/test/ClassPath2.java @@ -0,0 +1,7 @@ +package path.test; + +public class ClassPath2 { + public static void main(String []args) { + System.out.printf("hello again\n"); + } +} -- 2.25.1