sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) # For access to sexps.py, which is in parent dir
from sexps import *
+runner = ":"
outdir = "."
def make_test_case(f_name, ret_type, body):
"""Create a simple optimization test case consisting of a single
'do_lower_jumps({0:d}, {1:d}, {2:d}, {3:d}, {4:d})'.format(
pull_out_jumps, lower_sub_return, lower_main_return,
lower_continue, lower_break))
- args = ['../../glsl_test', 'optpass', '--quiet', '--input-ir', optimization]
+ args = [runner, 'optpass', '--quiet', '--input-ir', optimization]
test_file = os.path.join(outdir, '{0}.opt_test'.format(test_name))
with open(test_file, 'w') as f:
f.write('#!/usr/bin/env bash\n#\n# This file was generated by create_test_cases.py.\n#\n')
if __name__ == '__main__':
parser = argparse.ArgumentParser()
+ parser.add_argument('--runner',
+ help='The glsl_test runner',
+ required=True)
parser.add_argument('--outdir',
help='Directory to put the generated files in',
required=True)
args = parser.parse_args()
+ runner = args.runner
outdir = args.outdir
test_lower_returns_main()
completedir="$abs_builddir/glsl/tests/`echo ${dir} | sed 's|.*/glsl/tests/||g'`"
mkdir -p $completedir
cd $dir;
- $PYTHON2 create_test_cases.py --outdir $completedir;
+ $PYTHON2 create_test_cases.py --runner $abs_builddir/glsl/glsl_test --outdir $completedir;
if [ $? -eq 0 ]; then
has_tests=1
fi
echo "====== Testing optimization passes ======"
for test in `find . -iname '*.opt_test'`; do
echo -n "Testing $test..."
- (cd `dirname "$test"`; ./`basename "$test"`) > "$test.out" 2>&1
+ ./$test > "$test.out" 2>&1
total=$((total+1))
if $PYTHON2 $PYTHON_FLAGS $compare_ir "$test.expected" "$test.out" >/dev/null 2>&1; then
echo "PASS"