summaryrefslogtreecommitdiff
path: root/openembedded/scripts/jtreg-test
blob: b3b601fd374da6ba7eb5453912dbb6d909c1bcd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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