summaryrefslogtreecommitdiff
path: root/openembedded/scripts/mauve-test-pkg
blob: caef9b805cfc4b15068e90ca16f0bcbf1274df27 (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
#!/bin/bash

# Lava Mauve 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>
#

function generate_exclude_list() {
    local file="$1"
    local excludes=

    while read -r line; do
        [[ "$line" =~ ^#.*$ ]] && continue
        [[ "$line" =~ ^$    ]] && continue
        excludes="${excludes} -exclude ${line}"
    done < "$file"

    echo "${excludes}"
}

script=$(readlink -f $0)
scriptpath=$(dirname $script)
java_pkg=$1; shift
java_pkg=${java_pkg//\//.}
blacklist_file="$scriptpath/../mauve/blacklist.d/${java_pkg}"
javavm=$(which java)

if [[ -z "$javavm" ]]; then
    echo "No Java virtual machine found"
    exit 1
fi

excludes=

if [[ -f ${blacklist_file} ]]; then
   excludes=$(generate_exclude_list $blacklist_file)
   while read -r line; do
       [[ "$line" =~ ^#.*$ ]] && continue
       [[ "$line" =~ ^$    ]] && continue
       echo "SKIP: $line"
   done < "$blacklist_file"
fi

$javavm HarnessLinaro -vm $javavm -vmarg -Xmixed $excludes $java_pkg "$@"