Code Monkey home page Code Monkey logo

jtreg's Introduction

Building The Regression Test Harness for the OpenJDK platform: jtreg

(This information is also available at http://openjdk.java.net/jtreg/build.html)

jtreg depends on a number of external components: JT Harness, TestNG, JUnit, AsmTools, Ant, and JCov.

The fundamental way to build jtreg is with GNU make, specifying where to find those external components, but a script is also available that will download appropriate copies of those components before building jtreg.

Building jtreg with the build.sh script

This is the recommended way to build jtreg, for those that want a simple, basic way to build jtreg.

Note: The build.sh script supersedes the earlier build-all.sh script.

The script is intended to be run in a Unix-like shell, such as bash on Linux or Mac OS X, or with Cygwin or WSL on Windows. At a minimum, you must either set the JAVA_HOME environment variable or specify the location of the JDK to be used to build jtreg with the --jdk command-line option. It must be JDK 8 or later.

% cd jtreg-root-directory
% sh make/build.sh --jdk JDK-directory

The script will create a build sub-directory, download and build dependencies, and finally build jtreg itself. The resulting image will be in build/images/jtreg.

If you have access to the public Internet, no environment variables need to be specified to get a standard build of jtreg. However, you can set environment variables used to define the location of dependencies to be downloaded. These are documented in make/build.sh and normally specified in make/build-support/version-numbers and make/build-support/*/version-numbers.

Building jtreg with GNU Make

The Makefile is in make/Makefile, and creates deliverables in the build/ directory, similar to OpenJDK. By default, the build file just builds an image for jtreg. You can build jtreg from a Unix-like command shell with the following commands:

% cd <jtreg-root-directory>
% make -C make

Dependencies

jtreg has a number of build dependencies. These can be set with values on the make command line or with values in make/Defs.gmk. You can also include the appropriate license files in the jtreg image, by setting the appropriate make variables.

The following dependencies are optional.

  • JCov: See https://wiki.openjdk.java.net/display/CodeTools/jcov. Set JCOV_HOME to the installed copy of the version of JCov to be used. It should be version 3.0-b07 or better.

  • JDK 1.5: This is used when running some of the tests. Set JDK5HOME to run these tests. It need not be set if you are just building jtreg.

  • JDK 1.6: This is used when running some of the tests. Set JDK6HOME to run these tests. It need not be set if you are just building jtreg.

  • JDK 1.7: This is used when running some of the tests. Set JDK7HOME to run these tests. It need not be set if you are just building jtreg.

  • JDK 1.8: This is used when running some of the tests. Set JDK8HOME to run these tests. It need not be set if you are just building jtreg.

  • JDK 9: This is used when running some of the tests. Set JDK9HOME to run these tests. It need not be set if you are just building jtreg.

  • JDK 14: This is used when running some of the tests. Set JDK14HOME to run these tests. It need not be set if you are just building jtreg.

Running jtreg Self-Tests

The tests can be invoked with individual make targets, or collectively via the test target.

Some of the tests need to pop up windows while they execute. No interaction with these windows is normally required. Since this can be a problem on a headless server machine, and an annoyance on a personal workstation, the tests will attempt to use VNC to create a dummy X-server for use by the tests while they are running. Various implementations of VNC are available, such as from http://www.realvnc.com/. Using VNC is optional; it is not required in order to run the tests.

By default, VNC will be used if vncserver is found on your execution path, or if VNC_HOME points to an installed copy of VNC. To explicitly disable the use of VNC, set the VNC environment variable to one of false, off, no, or 0. Unless explicitly disabled, the tests will check the following:

  • You must have a password set in $HOME/.vnc/passwd. This is the standard location used by the vncserver command.
  • If you set the environment variable VNC_HOME, it will be prepended to your execution path to find vncserver.
  • vncserver must be on your execution path, after VNC_HOME has been added, if set.

If the tests find any issue with using VNC, it will not be used. If VNC is used to create a dummy X server, the server will be terminated when the test is complete.

The logic for using VNC is encapsulated within the script make/display.sh.

Building jtreg with Ant

It is possible to build jtreg with Ant, but this is primarily intended as a convenience while working on the jtreg source code. If you are building jtreg to run OpenJDK tests, it is recommended that you build jtreg using the Makefile, perhaps via the build.sh wrapper script.

The build file is in make/build.xml; it creates intermediate files in the build/ directory and deliverables in the dist/ directory. By default, the build file just builds jtreg, but does not run any tests. You can build jtreg from a Unix-like command shell with the following commands:

% cd jtreg-root-directory
% ant -f make/build.xml

You can also use this build file when creating a NetBeans free form project with an existing build file.

Dependencies

Some of the tasks that are used are listed as Optional Tasks in the Ant manual. You may need to make sure that these tasks are available for use by Ant. For example, on Ubuntu Linux these tasks are in the ant-optional package.

Running Tests

Some of the tests can be invoked with individual targets beginning -jtreg-test-, or collectively via the jtreg-test target. (The use of jtreg-test rather than test is to protect against interactions with JUnit in older versions of NetBeans.)

Using the IntelliJ IDE

The jtreg repo also contains a plugin for the IntelliJ IDE. This is a convenience plugin which adds jtreg capabilities to the IntelliJ IDE. With this plugin, OpenJDK developers can write, run, and debug jtreg tests without leaving their IDE environment. For more details, see the file plugins/idea/README.md in this repo.

jtreg's People

Contributors

andrewluotechnologies avatar bondolo avatar bulasevich avatar christhalinger avatar cl4es avatar cnqpzhang avatar dongbohe avatar edvbld avatar goelin avatar iignatev avatar jonathan-gibbons avatar judovana avatar jwgish avatar kusrinivasan avatar lahodaj avatar mcimadamore avatar qudongfang avatar realclanger avatar rogerriggs avatar simonis avatar sparkoo avatar tstuefe avatar wangweij avatar zosrothko avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.