diff options
author | Emil Velikov <[email protected]> | 2017-02-26 20:17:00 +0000 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2017-03-28 15:31:23 +0100 |
commit | 86a937d2644adcd724dae58c5212de5358326e9c (patch) | |
tree | de734b83e8bcd90b0ed5b790c0073aa8af3261ae /src/compiler/glsl/tests/optimization-test.sh | |
parent | a7d9f0a361c4fd5d7e223cac61eca180c309cdc1 (diff) |
glsl/tests/optimization-test: correctly manage srcdir/builddir
At the moment we look for generator script(s) in builddir while they
are in srcdir, and we proceed to generate the tests and expected output
in srcdir, which is not allowed.
To untangle:
- look for the generator script in the correct place
- generate the files in builddir, by extending create_test_cases.py to
use --outdir
With this in place the test passes `make check' for OOT builds - would
that be as standalone or part of `make distcheck'
Signed-off-by: Emil Velikov <[email protected]>
Acked-by: Kenneth Graunke <[email protected]>
Reviewed-by: Eric Engestrom <[email protected]>
Diffstat (limited to 'src/compiler/glsl/tests/optimization-test.sh')
-rwxr-xr-x | src/compiler/glsl/tests/optimization-test.sh | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/compiler/glsl/tests/optimization-test.sh b/src/compiler/glsl/tests/optimization-test.sh index 47970c6be29..1113cb1f17c 100755 --- a/src/compiler/glsl/tests/optimization-test.sh +++ b/src/compiler/glsl/tests/optimization-test.sh @@ -28,13 +28,19 @@ compare_ir=$srcdir/glsl/tests/compare_ir.py total=0 pass=0 +# Store our location before we start diving into subdirectories. +ORIGDIR=`pwd` echo "====== Generating tests ======" -for dir in tests/*/; do +for dir in $srcdir/glsl/tests/*/; do if [ -e "${dir}create_test_cases.py" ]; then - cd $dir; $PYTHON2 create_test_cases.py; cd .. + # construct the correct builddir + completedir="$abs_builddir/glsl/tests/`echo ${dir} | sed 's|.*/glsl/tests/||g'`" + mkdir -p $completedir + cd $dir; $PYTHON2 create_test_cases.py --outdir $completedir; cd .. fi echo "$dir" done +cd "$ORIGDIR" if [ ! -f "$compare_ir" ]; then echo "Could not find compare_ir. Make sure that srcdir variable is correctly set." |