1 This directory contains jtreg tests which are wrapper tests to execute Graal unit tests similar way they are run in Graal project.
   2 The tests use compiler.graalunit.common.GraalUnitTestLauncher helper class to run Graal unit tests where the set of tests to execute
   3 is specified by '-prefix' argument. GraalUnitTestLauncher launches ported com.oracle.mxtool.junit.MxJUnitWrapper to run Graal unit
   4 tests as it is done by "mx unittest" command from Graal project.
   5 
   6 All compiler/graalunit/*.java tests were automatically generated by generateTests.sh script which reads
   7 "testName -> testPrefix [requiresStatement]" mapping from TestPackages.txt file and generates corresponding <testName>Test.java
   8 tests. The mapping takes into account tests execution time to avoid very long test runs.
   9 
  10 Graal unit tests depends on following external jar files:
  11  asm-5.0.4.jar:
  12  https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/asm-5.0.4.jar
  13 
  14  asm-tree-5.0.4.jar:
  15  https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/asm-tree-5.0.4.jar
  16 
  17  junit-4.12.jar:
  18  https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/junit-4.12.jar
  19 
  20  hamcrest-core-1.3.jar:
  21  https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/hamcrest-core-1.3.jar
  22 
  23  java-allocation-instrumenter.jar:
  24  https://lafo.ssw.uni-linz.ac.at/pub/java-allocation-instrumenter/java-allocation-instrumenter.jar
  25 
  26 Before running the tests you need to download these jars from above locations in build/<platform>/images/test/hotspot/jtreg/graal/
  27 directory. You can use 'downloadLibs.sh' script which will try to download all these libs using wget.
  28 
  29 
  30 Then you can run Graal unit test(s) using 'make run-test':
  31 
  32 > make run-test TEST="compiler/graalunit/ApiTest.java" TEST_VM_OPTS="-server -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI"
  33 
  34 
  35 If you want to use jtreg directly you need to say jtreg where to find external jars.
  36 You can do it by passing additional option "-vmoptions:-Dgraalunit.libs=" or setting environment variable by using "-e:TEST_IMAGE_GRAAL_DIR=..."
  37 
  38 Example:
  39 > jtreg -vt -jdk:<TESTED_JDK> -vmoptions:"-server -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI"
  40         -vmoptions:"-Dgraalunit.libs=build/<platform>/images/test/hotspot/jtreg/graal"
  41         compiler/graalunit/UtilTest.java
  42 
  43 To run Graal unit tests in Graal as JIT mode pass additional -vmoptions to jtreg:
  44  -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+TieredCompilation -XX:+UseJVMCICompiler -Djvmci.Compiler=graal
  45