#! /bin/bash # INPUT # test_name -> name of the test # Get directory name test_dir=`echo $test_name |sed -e 's/\..*//'` test_sub=`echo $test_name |sed -e 's/[^\.]*//'` test_path="$gl_testdir/$test_dir" # Check if test directory does exist if test "x$test_dir" = "x" || test ! -d "$test_path"; then echo 1>&2 "'$test_dir' directory ($test_path) for '$test_name' does not seem to exist" exit 3 fi # Build complete path for the test file gen_file="$test_path/data/gen" parse_file="$test_path/data/parse" test_file="$test_path/data/test" help_file="$test_path/data/help" if test "x$test_sub" != "x"; then test_file="${test_file}${test_sub}" parse_file="${parse_file}${test_sub}" help_file="${help_file}${test_sub}" gen_file="${gen_file}${test_sub}" fi # Verify test file does exist if test ! -r "$test_file"; then echo 1>&2 "'$test_file' for '$test_name' does not seem to be readable" exit 3 fi