Patch for jigsaw tests to run on all platforms
Mandy Chung
mandy.chung at oracle.com
Mon Mar 14 14:39:11 PDT 2011
On 3/14/11 1:06 PM, mark.reinhold at oracle.com wrote:
> 2011/3/12 18:13 -0800, mandy.chung at oracle.com:
>> This patch fixes the jigsaw tests to run on all platforms and also
>> replace calls to the java.io.File.renameTo method with
>> java.nio.file.Files.move method since on windows File.renameTo
>> fails if the target file exists.
>>
>> Webrev at:
>> http://cr.openjdk.java.net/~mchung/jigsaw/webrevs/jigsaw-tests.00/
> Thanks for working on these.
>
> In several of the test scripts you've removed "|| exit" constructs that
> were inserted to ensure an error exit if an intermediate step fails.
I added the "|| exit" constructs when I turned on verbose (i.e. use
"set -x" rather than "set -e") when I added those tests. The "|| exit"
constructs are not needed as the shell tests have "-e" set.
> In
> module-annotation.sh, e.g.:
>
> @@ -272,23 +272,23 @@
> mkdir z.modules.$ver
>
> $BIN/javac -d z.modules.$ver -modulepath z.modules.$ver -L z.lib \
> - $(find z.src.$ver -name '*.java') \
> - $(find z.src/test -name '*.java') || exit 10
> + `find z.src.$ver -name '*.java'` \
> + `find z.src/test -name '*.java'`
>
> - $BIN/jmod -P z.lib -L $lib create || exit 11
> - $BIN/jmod -L $lib install z.modules.$ver test.foo.bar test || exit 12
> - $BIN/java -L $lib -m test $lib || exit 13
> + $BIN/jmod -L $lib -P z.lib create
> + $BIN/jmod -L $lib install z.modules.$ver test.foo.bar test
> + $BIN/java -L $lib -m test $lib
> }
>
> #
> # Create z.lib with foo and bar modules
> $BIN/javac -d z.modules -modulepath z.modules \
> - $(find z.src/bar -name '*.java') \
> - $(find z.src/foo -name '*.java') || exit 1
> + `find z.src/bar -name '*.java'` \
> + `find z.src/foo -name '*.java'`
>
> -$BIN/jmod -L z.lib create || exit 2
> -$BIN/jmod -L z.lib install z.modules foo bar || exit 3
> -$BIN/java -L z.lib -m foo || exit 4
> +$BIN/jmod -L z.lib create
> +$BIN/jmod -L z.lib install z.modules foo bar
> +$BIN/java -L z.lib -m foo
>
> # Test ScalarTypes and ArrayTypes with default values
> run v1
>
> If one of the JPRT machine's shell rejects this construct then the
> behavior should somehow be preserved, perhaps with a full if statement:
>
> if ! $BIN/jmod -L z.zlib install z.modules foo bar; then exit 3; fi
>
> More verbose, sadly, but at least behavior-preserving.
Removing "|| exit" construct is cleanup of my previous work. "set -e"
seems doing the right thing and I'll check again to make sure.
> In hello-native.sh you changed "set -e" to "set -x", but these are
> different.
I caught that after sending out the webrev. I temporarily changed it
just for my testing purpose (I should have changed it to "set -ex"
to turn on verbose.)
> In tester.sh you have a leftover "# set -x" line.
I'll take out the leftover commented line. I removed "set -e" since
a command could fail as the test expects it; for example, in resolver.sh,
: trivial2 fail compile
In this case, javac will exit with an error but the test should pass
as it's an expected behavior.
> In tester.sh, why is it necessary to use the "\\" file separator on MKS?
> Doesn't MKS accept forward slashes as well?
>
It does.
I highly suspect that the system("mkdir") command invoked from MKS awk is
the dos mkdir command (not the MKS mkdir). Thus it doesn't accept -p and
doesn't work with forward slashes.
system("which mkdir") shows "c:/mks/mksnt/mkdir.exe"
SHELL env. variable is not set though
PATH=C:\\Documents and Settings\\mchung\\bin;c:\\mks\\mksnt
I can't find a way to confirm this - anyone knows how to?
Mandy
More information about the jigsaw-dev
mailing list