5.14. My test does tricky things that are not supported by jtreg. Can I still write a regression test?

Yes. Most tests can be written using a series of main, clean, build, applet, and compile actions. However, there have been a few tests that need to do things like run a specific application or access specific environment variables. The shell action allows a user to invoke a Bourne shell-script which can run arbitrary commands, including running java and javac.

Warning! All tests, including shell-script tests, may be run on multiple platforms including Linux, Solaris, Windows and Mac OS X. The shell-script should be written to with this in mind. The following code fragment may be useful in defining various platform-dependent variables.

                        OS=`uname -s`
                        case "$OS" in
                            SunOS | Linux | *BSD | Darwin )
                                NULL=/dev/null
                                PATHSEP=":"
                                FILESEP="/"
                                TMP=/tmp
                                ;;
                            CYGWIN* )
                                NULL=/dev/null
                                PATHSEP=";"
                                FILESEP="/"
                                TMP=/tmp
                                ;;
                            Windows* )
                                NULL=NUL
                                PATHSEP=";"
                                FILESEP="\\"
                                TMP=$TEMP
                                ;;
                            * )
                                echo "Unrecognized system!"
                                exit 1;
                                ;;
                        esac
                    

If the shell action still does not provide the flexibility needed to write the regression test, then use the ignore action. It is also advisable to include a comment with sufficient detail to allow a person to run the test and verify its behavior.