Jacks:java compatibility test Open Source Path

Source: Internet
Author: User

What is Jacks?

The Jacks test suite checks whether the Java compiler conforms to the JLS (Java language Specification). It consists of a large number of small test cases, each focused on a specific part of the JLS. Eric Blake has made a great contribution to the Jacks project, and he describes the benefits of this type of testing from a detail-oriented field. "By generating a small test case with the specified compilation behavior, and then automating the execution of each case, the compiler author or debugger can quickly identify the problems that exist in Java source code to bytecode conversion. ”

The idea behind development jacks is to simplify the tests that run on multiple-compiler or multiple-compiler configurations (for example, a set of tests for JDK 1.3 distributions from the two release versions of Jikes and Javac). If you do this manually, you must set the environment variables repeatedly, and then check the test results based on the desired results. By using jacks, you only need to change to the directory where the test is stored, call the Jacks Framework, and then indicate which compiler configuration you should use.

Sun's failure to fulfill a commitment to Java developers inspired the Jikes team to set up and run the Jacks project. Sun has repeatedly stated that it will hand Java, jck (Java compatibility Kit) and related Java technologies to a standard subject. But since this has not yet been achieved, developers working on Java projects cannot use JCK to perform regression testing of their day-to-day development. When faced with an artificially low code due to unreasonable license restrictions, they tend to replace old systems with newer, more sophisticated systems. This is the story that happened on the jacks. (Although Jacks is hosted by DeveloperWorks, it is governed by the GPL rather than IBM public License.) )

Using jacks

Jacks is written in Tcl and needs to be ensured to have TCL 8.3. (requires version 8.3来 to ensure tcltest extensions and Unicode support, both of which are necessary for jacks). You can download the installer for Windows and the RPM for Red Hat x86, or you can build from your source code more easily. If you don't know where to download, see the Resources section later in this article; If you are using Red Hat 7, you probably have TCL 8.3 installed.

After installing TCL, you need to remove jacks from CVS. The jacks is then configured by including the compiler pathname in the Jacks _setup configuration file of the compiler to be tested. A _setup file is required for each configuration that you want to support. For example, jacks with Javac_setup files. You need to edit the file to set the path for Javac. "The hardest part is determining how to test jikes, because I have jikespath in the environment," says Eric Blake. But I figured out what to change in the Jikes_setup configuration file, and everything went well. ”

Remove Jacks source code from the CVS module

setenv cvsroot:p Server:anoncvs@oss.software.ibm.com:/usr/cvs/jikes

CVS Login

PASWSD Anoncvs

CVS Checkout Jacks

You can use jacks for an unlimited number of compiler or compiler configurations. To remove a compiler's configuration, you only need to delete its _setup file.

When you remove the source code from CVS, you need to include the top-level jacks directory in the path to run the Jacks shell script. To be cautious, you should initially run the shell script without any arguments to ensure that each item is configured correctly.

% Jacks

If everything works, you will see a list of command-line options accepted by the Jacks script. If you receive an error, check to see if the executable file tclsh8.3 is found in the path. Windows users need to run tclsh83 directly and pass the JACKS.TCL argument to it before the generic flag. You should also consider installing the Cygwin UNIX compatibility layer so that, like a UNIX user, you can use the provided shell script to run jacks. The following instructions assume that you are using a shell script.

For test examples, you need to use the Jikes compiler to run all tests in a given subdirectory, as follows:

% CD Tests/jls/packages/package-declarations/unnamed-packages

% Jacks Jikes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.