summaryrefslogtreecommitdiff
path: root/openembedded/scripts/jtreg-test
diff options
context:
space:
mode:
Diffstat (limited to 'openembedded/scripts/jtreg-test')
-rwxr-xr-xopenembedded/scripts/jtreg-test71
1 files changed, 71 insertions, 0 deletions
diff --git a/openembedded/scripts/jtreg-test b/openembedded/scripts/jtreg-test
new file mode 100755
index 0000000..b3b601f
--- /dev/null
+++ b/openembedded/scripts/jtreg-test
@@ -0,0 +1,71 @@
+#!/bin/bash
+
+# JTREG jdk test harness.
+#
+# Copyright (C) 2013, Linaro Limited.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Author: Andrew McDermott <andrew.mcdermott@linaro.org>
+#
+
+if [ $# -lt 2 ]; then
+ echo "usage: $0: <test-dir> <test>" >&2
+ exit 1
+fi
+
+if [ -z "$PRODUCT_HOME" ]; then
+ echo "error: PRODUCT_HOME not set!" >&2
+ exit 1
+fi
+
+if [ -z "$JT_HOME" ]; then
+ echo "error: JT_HOME not set!" >&2
+ exit 1
+fi
+
+if [ -z "$JTREG" ]; then
+ JTREG=$JT_HOME/linux/bin/jtreg-lava
+fi
+
+set -x
+
+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
+
+lava-test-case $test_to_run \
+ --shell \
+ make -C $test_dir PRODUCT_HOME=$PRODUCT_HOME JTREG=$JTREG ALT_OUTPUTDIR=$t $test_to_run
+
+exit_code=$?
+
+[ -e $pl ] && lava-test-case-attach $test_to_run $pl
+[ -e $fl ] && lava-test-case-attach $test_to_run $fl
+
+if [ $exit_code -ne 0 ]; then
+ [ -e $archive_bundle ] && lava-test-case-attach $test_to_run $archive_bundle
+fi
+
+rm -rf $t
+
+exit $exit_code