#!/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 # 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 -Xint HarnessLinaro -vm $javavm -vmarg -Xint $excludes $java_pkg "$@"