diff options
author | Andrew McDermott <andrew.mcdermott@linaro.org> | 2013-09-03 21:22:39 +0100 |
---|---|---|
committer | Andrew McDermott <andrew.mcdermott@linaro.org> | 2013-09-04 15:31:06 +0100 |
commit | 5f668f19d462c01f6f2315f19710d772f3d34020 (patch) | |
tree | b69c068cb414b9d74d6048c3252d95391c590402 /openembedded | |
parent | 94456ab90b4cf202e0a4474e92001c0627ff4216 (diff) |
jtreg: accomodate differences between jdk and hotspot tests
Also attach ARCHIVE_BUNDLE.zip, if available. It also turns out that if
you test jdk_beans then the underlying JDK makefiles actually tests
jdk_beans{1,2} and {1,2} become the directory names and, as a result,
the test results don't get appended correctly. Updated the script to
glob on the test name so that we don't have to peak too much into the
JDK test machinations.
Signed-off-by: Andrew McDermott <andrew.mcdermott@linaro.org>
Diffstat (limited to 'openembedded')
-rw-r--r-- | openembedded/jtreg.yaml | 12 | ||||
-rwxr-xr-x | openembedded/scripts/jtreg-test | 72 |
2 files changed, 65 insertions, 19 deletions
diff --git a/openembedded/jtreg.yaml b/openembedded/jtreg.yaml index 6c1840f..47352d0 100644 --- a/openembedded/jtreg.yaml +++ b/openembedded/jtreg.yaml @@ -42,9 +42,9 @@ run: - './jtreg-test $JDK_TEST_DIR jdk_text' - './jtreg-test $JDK_TEST_DIR jdk_time' - './jtreg-test $JDK_TEST_DIR jdk_util' - - './jtreg-test $HOTSPOT_TEST_DIR sanity' - - './jtreg-test $HOTSPOT_TEST_DIR compiler' - - './jtreg-test $HOTSPOT_TEST_DIR gc' - - './jtreg-test $HOTSPOT_TEST_DIR runtime' - - './jtreg-test $HOTSPOT_TEST_DIR serviceability' - - './jtreg-test $HOTSPOT_TEST_DIR testlibrary' + - 'TESTDIRS=sanity ./jtreg-test $HOTSPOT_TEST_DIR sanity' + - 'TESTDIRS=compiler ./jtreg-test $HOTSPOT_TEST_DIR compiler' + - 'TESTDIRS=gc ./jtreg-test $HOTSPOT_TEST_DIR gc' + - 'TESTDIRS=runtime ./jtreg-test $HOTSPOT_TEST_DIR runtime' + - 'TESTDIRS=serviceability ./jtreg-test $HOTSPOT_TEST_DIR serviceability' + - 'TESTDIRS=testlibrary ./jtreg-test $HOTSPOT_TEST_DIR testlibrary' diff --git a/openembedded/scripts/jtreg-test b/openembedded/scripts/jtreg-test index b3b601f..1d62ee6 100755 --- a/openembedded/scripts/jtreg-test +++ b/openembedded/scripts/jtreg-test @@ -1,6 +1,6 @@ #!/bin/bash -# JTREG jdk test harness. +# JTREG LAVA test harness. # # Copyright (C) 2013, Linaro Limited. # @@ -42,28 +42,74 @@ fi set -x +uniq_pathname() { + local name=$1 + name=${name#$to/} + name=${name////-} + echo $to/$name +} + test_dir=$1 test_to_run=$2 t=/tmp/jtreg/$test_to_run.$$ rm -rf $t mkdir -p $t -d=$t/testoutput/$test_to_run -pl=$d/passlist.txt -fl=$d/faillist.txt -archive_bundle=$d/ARCHIVE_BUNDLE.zip +to=$t/testoutput + +# Accommodate differences between jdk tests and hotspot tests. +# +# The hotspot tests need to be invoked with TESTDIRS set and they also +# put the output one directory deeper and the output content (and +# location) is different to the jdk tests. +# +if [ -n "$TESTDIRS" ]; then + lava-test-case $test_to_run \ + --shell \ + make -C $test_dir PRODUCT_HOME=$PRODUCT_HOME JTREG=$JTREG JT_HOME=$JT_HOME ALT_OUTPUTDIR=$t TESTDIRS=$TESTDIRS + + exit_code=$? + to=`ls -1d $t/*/testoutput` + zip --quiet -d $to/ARCHIVE_BUNDLE.zip 'JTwork/classes/*' + mv $to/ARCHIVE_BUNDLE.zip $to/${test_to_run}-ARCHIVE_BUNDLE.zip + lava-test-case-attach $test_to_run $to/${test_to_run}-ARCHIVE_BUNDLE.zip + shopt -s nullglob + for i in $to/JTwork/scratch/hs*.log; do + lava-test-case-attach $test_to_run $i + done +else + lava-test-case $test_to_run \ + --shell \ + make -C $test_dir PRODUCT_HOME=$PRODUCT_HOME JTREG=$JTREG JT_HOME=$JT_HOME ALT_OUTPUTDIR=$t $test_to_run + + exit_code=$? + + shopt -s nullglob -lava-test-case $test_to_run \ - --shell \ - make -C $test_dir PRODUCT_HOME=$PRODUCT_HOME JTREG=$JTREG ALT_OUTPUTDIR=$t $test_to_run + for i in $to/${test_to_run}*/*.txt; do + name=$(uniq_pathname $i) + cp $i $name + if [ -s $name ]; then + lava-test-case-attach $test_to_run $name + fi + done -exit_code=$? + for i in $to/${test_to_run}*/JTwork/scratch/hs*.log; do + lava-test-case-attach $test_to_run $i + done -[ -e $pl ] && lava-test-case-attach $test_to_run $pl -[ -e $fl ] && lava-test-case-attach $test_to_run $fl + for i in $to/${test_to_run}*/ARCHIVE_BUNDLE.zip; do + zip --quiet -d $i 'JTwork/classes/*' + name=$(uniq_pathname $i) + cp $i $name + if [ -s $name ]; then + lava-test-case-attach $test_to_run $name + fi + done -if [ $exit_code -ne 0 ]; then - [ -e $archive_bundle ] && lava-test-case-attach $test_to_run $archive_bundle + for i in $to/${test_to_run}*/Stats.txt; do + cat $i + done fi rm -rf $t |