glcpp/tests/glcpp-test-cr-lf: correctly set/use srcdir/abs_builddir
Otherwise manual invokation of the script from elsewhere than `dirname $0` will fail. With these all the artefacts should be created in the correct location, and thus we can remove the old (and slighly strange) clean-local line. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Acked-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
This commit is contained in:

committed by
Emil Velikov

parent
cf77cdce83
commit
d8096b75aa
@@ -1,18 +1,21 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# The build system runs this test from a different working directory, and may
|
if [ -z "$srcdir" -o -z "$abs_builddir" ]; then
|
||||||
# be in a build directory entirely separate from the source. So if the
|
echo ""
|
||||||
# "srcdir" variable is set, we must use it to locate the test files and the
|
echo "Warning: you're invoking the script manually and things may fail."
|
||||||
# glcpp-test script.
|
echo "Attempting to determine/set srcdir and abs_builddir variables."
|
||||||
|
echo ""
|
||||||
|
|
||||||
if [ ! -z "$srcdir" ]; then
|
# Should point to `dirname Makefile.glsl.am`
|
||||||
testdir="$srcdir/glsl/glcpp/tests"
|
srcdir=./../../../
|
||||||
glcpp_test="$srcdir/glsl/glcpp/tests/glcpp-test.sh"
|
cd `dirname "$0"`
|
||||||
else
|
# Should point to `dirname Makefile` equivalent to the above.
|
||||||
testdir=.
|
abs_builddir=`pwd`/../../../
|
||||||
glcpp_test=./glcpp-test.sh
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
testdir="$srcdir/glsl/glcpp/tests"
|
||||||
|
glcpp_test="$srcdir/glsl/glcpp/tests/glcpp-test.sh"
|
||||||
|
|
||||||
total=0
|
total=0
|
||||||
pass=0
|
pass=0
|
||||||
|
|
||||||
@@ -99,7 +102,7 @@ mkdir subtest-cr
|
|||||||
for file in "$testdir"/*.c; do
|
for file in "$testdir"/*.c; do
|
||||||
base=$(basename "$file")
|
base=$(basename "$file")
|
||||||
tr "\n" "\r" < "$file" > subtest-cr/"$base"
|
tr "\n" "\r" < "$file" > subtest-cr/"$base"
|
||||||
cp `pwd`/glsl/glcpp/tests/subtest-lf/"$base".out subtest-cr/"$base".expected
|
cp $abs_builddir/glsl/glcpp/tests/subtest-lf/"$base".out subtest-cr/"$base".expected
|
||||||
done
|
done
|
||||||
|
|
||||||
run_test "${glcpp_test} --testdir=subtest-cr"
|
run_test "${glcpp_test} --testdir=subtest-cr"
|
||||||
@@ -112,7 +115,7 @@ mkdir subtest-cr-lf
|
|||||||
for file in "$testdir"/*.c; do
|
for file in "$testdir"/*.c; do
|
||||||
base=$(basename "$file")
|
base=$(basename "$file")
|
||||||
sed -e 's/$/
|
sed -e 's/$/
|
||||||
/' < "$file" > subtest-cr-lf/"$base"
|
/' < "$file" > subtest-cr-lf/"$base"
|
||||||
cp $abs_builddir/glsl/glcpp/tests/subtest-lf/"$base".out subtest-cr-lf/"$base".expected
|
cp $abs_builddir/glsl/glcpp/tests/subtest-lf/"$base".out subtest-cr-lf/"$base".expected
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -125,7 +128,7 @@ mkdir subtest-lf-cr
|
|||||||
mkdir subtest-lf-cr
|
mkdir subtest-lf-cr
|
||||||
for file in "$testdir"/*.c; do
|
for file in "$testdir"/*.c; do
|
||||||
base=$(basename "$file")
|
base=$(basename "$file")
|
||||||
sed -e 's/$/
|
sed -e 's/$/
|
||||||
/' < "$file" | tr "\n\r" "\r\n" > subtest-lf-cr/"$base"
|
/' < "$file" | tr "\n\r" "\r\n" > subtest-lf-cr/"$base"
|
||||||
cp $abs_builddir/glsl/glcpp/tests/subtest-lf/"$base".out subtest-lf-cr/"$base".expected
|
cp $abs_builddir/glsl/glcpp/tests/subtest-lf/"$base".out subtest-lf-cr/"$base".expected
|
||||||
done
|
done
|
||||||
|
Reference in New Issue
Block a user