Add test condition check for filter file
@@ -4,6 +4,23 @@ NUM=0
INFOLIST=""
ENVVARS=""
+#######################################
+# Check for existence of filter files
+#######################################
+check_filter_existence() {
+ declare -a default_filter_loc=(
+ "/usr/lib/appscope/scope_filter"
+ "/tmp/scope_filter"
+ )
+ for filter_loc in "${default_filter_loc[@]}"
+ do
+ if [ -f "$filter_loc" ]; then
+ echo "filter file $filter_loc exists to run AppScope tests. Please remove the $filter_loc file"
+ exit 1
+ fi
+ done
+}
+
accumulate_coverage() {
# This function accumulates coverage info (gcda files) from test
# to test. It merges new coverage info (current dir) into coverage
@@ -41,6 +58,9 @@ run_test() {
CWD="$(pwd)"
+# verify the test environment
+check_filter_existence
+
if [ -d $CWD/coverage ]; then
rm -rf $CWD/coverage
fi
