Skip to content

Quick guide on running OpenJDK tests for testing OpenJ9

Nazim Bhuiyan edited this page Nov 7, 2018 · 4 revisions

Assuming you just built OpenJDK with OpenJ9...

Prereqs

Ensure you have the following prerequisites: source

  • ant 1.7.1 or above with ant-contrib.jar
  • make 3.81 or above (recommend make 4.1 or above on windows)
  • perl 5.10.1 or above with JSON and Text::CSV module installed (on Ubuntu 18.04: apt-get install perl libjson-perl libtext-csv-perl)
  • curl 7.20.0 or above (needs -J/--remote-header-name support)

Test set up:

  1. Clone the test repo somewhere: git clone https://github.com/AdoptOpenJDK/openjdk-tests.git
  2. cd openjdk-tests
  3. ./get.sh --testdir $PWD --platform x64_linux --jdk_impl openj9
    1. Note: Other valid platform options: x64_linux | x64_mac | s390x_linux | ppc64le_linux | aarch64_linux | ppc64_aix
  4. cd TestConfig
  5. Set necessary environment variables (assuming your OpenJ9-JDK repo was cloned in your home directory, and you are using JDK9):
    1. export JAVA_BIN=~/openj9-openjdk-jdk9/build/linux-x86_64-normal-server-release/images/jdk/bin
    2. export JDK_VERSION=9
    3. JDK_IMPL=openj9
    4. export SPEC=linux_x86-64_cmprssptrs (default SPEC for x86-64 Linux openj9 builds)
    5. optional: export BUILD_LIST=functional to restrict to functional test group only. By default, all test groups are enabled. Other options include system, openjdk, external, perf, jck. You can specify multiple options using commas (eg BUILD_LIST=functional,system,...)
  6. make -f run_configure.mk
  7. make compile
  8. Now you are ready to execute the tests. There are 2 levels of tests: sanity and extended. Every test target needs to be prepended with an underscore. Here are some ways of executing the tests:
    1. To run all sanity level tests in all enabled groups: make _sanity
    2. To run all sanity/extended level tests in functional group: make _functional
    3. To run all extended level tests in functional group: make _extended.functional
    4. To run a specific test: make _<test_name>
    5. To run tests in a specific directory: make -C ../functional/JIT_Test/ -f autoGen.mk _sanity
  9. If any test targets fail, failed.mk will be generated. This gives you the opportunity to try and fix the issue in OpenJ9, rebuilding the images, and rerunning the failing tests using make _failed.
Clone this wiki locally