Browse Source

Add possibility to pass jvm target compilation parameters and clean up if no problem is detected

Pierre Muller 3 years ago
parent
commit
140fe74efb
1 changed files with 15 additions and 1 deletions
  1. 15 1
      tests/test/jvm/testall.sh

+ 15 - 1
tests/test/jvm/testall.sh

@@ -8,9 +8,16 @@ if [ $# -eq 0 ]; then
   PPC=ppcjvm
   PPC=ppcjvm
 else
 else
   PPC="$1"
   PPC="$1"
-  if [ $# -eq 2 ]; then
+  if [ $# -ge 2 ]; then
     RTLDIR="$2"
     RTLDIR="$2"
   fi
   fi
+  if [ $# -ge 3 ]; then
+    TEST_JVM_OPT="$3"
+  fi
+fi
+
+if [ -n "${TEST_JVM_OPT:-}" ] ; then
+  PPC="$PPC $TEST_JVM_OPT"
 fi
 fi
 
 
 rm -rf org
 rm -rf org
@@ -193,3 +200,10 @@ $PPC -O2 -g -B -Sa tw29585
 java -Dfile.encoding=UTF-8 -cp ../../../rtl/units/$RTLDIR:. tw29585
 java -Dfile.encoding=UTF-8 -cp ../../../rtl/units/$RTLDIR:. tw29585
 $PPC -O2 -g -B -Sa tstring
 $PPC -O2 -g -B -Sa tstring
 java -Dfile.encoding=UTF-8 -cp ../../../rtl/units/$RTLDIR:. tstring
 java -Dfile.encoding=UTF-8 -cp ../../../rtl/units/$RTLDIR:. tstring
+
+set +e
+# Arriving here means that all is OK
+# Do some cleaning in that case
+echo "No problem detected in testing jvm using PPC=\"$PPC\" and RTLDIR=\"$RTLDIR\""
+rm -Rf *.class
+rm -Rf org