summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/Makefile.am38
-rw-r--r--src/glsl/tests/Makefile.am35
-rwxr-xr-xsrc/glsl/tests/optimization-test10
3 files changed, 44 insertions, 39 deletions
diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am
index 2e297f1570e..f97dc2152c8 100644
--- a/src/glsl/Makefile.am
+++ b/src/glsl/Makefile.am
@@ -28,6 +28,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/src/mapi \
-I$(top_srcdir)/src/mesa/ \
-I$(top_srcdir)/src/glsl/glcpp \
+ -I$(top_srcdir)/src/gtest/include \
$(DEFINES) \
$(API_DEFINES)
AM_CFLAGS = $(VISIBILITY_CFLAGS)
@@ -35,10 +36,43 @@ AM_CXXFLAGS = $(VISIBILITY_CXXFLAGS)
include Makefile.sources
-TESTS = glcpp/tests/glcpp-test
+TESTS = glcpp/tests/glcpp-test \
+ tests/optimization-test \
+ tests/ralloc-test \
+ tests/uniform-initializer-test
+
+TESTS_ENVIRONMENT= \
+ export PYTHON2=$(PYTHON2); \
+ export PYTHON_FLAGS=$(PYTHON_FLAGS);
noinst_LTLIBRARIES = libglcpp.la libglsl.la
-check_PROGRAMS = glcpp/glcpp glsl_test
+check_PROGRAMS = \
+ glcpp/glcpp \
+ glsl_test \
+ tests/ralloc-test \
+ tests/uniform-initializer-test
+
+tests_uniform_initializer_test_SOURCES = \
+ $(top_srcdir)/src/mesa/main/hash_table.c \
+ $(top_srcdir)/src/mesa/program/prog_hash_table.c\
+ $(top_srcdir)/src/mesa/program/symbol_table.c \
+ tests/copy_constant_to_storage_tests.cpp \
+ tests/set_uniform_initializer_tests.cpp \
+ tests/uniform_initializer_utils.cpp
+tests_uniform_initializer_test_CFLAGS = \
+ $(PTHREAD_CFLAGS)
+tests_uniform_initializer_test_LDADD = \
+ $(top_builddir)/src/gtest/libgtest.la \
+ $(top_builddir)/src/glsl/libglsl.la \
+ $(PTHREAD_LIBS)
+
+tests_ralloc_test_SOURCES = \
+ tests/ralloc_test.cpp \
+ $(top_builddir)/src/glsl/ralloc.c
+tests_ralloc_test_CFLAGS = $(PTHREAD_CFLAGS)
+tests_ralloc_test_LDADD = \
+ $(top_builddir)/src/gtest/libgtest.la \
+ $(PTHREAD_LIBS)
libglcpp_la_SOURCES = \
glcpp/glcpp-lex.c \
diff --git a/src/glsl/tests/Makefile.am b/src/glsl/tests/Makefile.am
deleted file mode 100644
index eaf5a3c0ac1..00000000000
--- a/src/glsl/tests/Makefile.am
+++ /dev/null
@@ -1,35 +0,0 @@
-AM_CPPFLAGS = \
- -I$(top_srcdir)/src/gtest/include \
- -I$(top_srcdir)/src/mesa \
- -I$(top_srcdir)/src/mapi \
- -I$(top_srcdir)/src/glsl \
- -I$(top_srcdir)/include
-
-TESTS_ENVIRONMENT= \
- export PYTHON2=$(PYTHON2); \
- export PYTHON_FLAGS=$(PYTHON_FLAGS);
-
-TESTS = \
- optimization-test \
- ralloc-test \
- uniform-initializer-test
-
-check_PROGRAMS = \
- ralloc-test \
- uniform-initializer-test
-
-uniform_initializer_test_SOURCES = \
- copy_constant_to_storage_tests.cpp \
- set_uniform_initializer_tests.cpp \
- uniform_initializer_utils.cpp
-uniform_initializer_test_CFLAGS = \
- $(PTHREAD_CFLAGS)
-uniform_initializer_test_LDADD = \
- $(top_builddir)/src/gtest/libgtest.la \
- $(top_builddir)/src/glsl/libglsl.la \
- $(top_builddir)/src/mesa/libmesa.la \
- $(PTHREAD_LIBS)
-
-ralloc_test_SOURCES = ralloc_test.cpp $(top_builddir)/src/glsl/ralloc.c
-ralloc_test_CFLAGS = $(PTHREAD_CFLAGS)
-ralloc_test_LDADD = $(top_builddir)/src/gtest/libgtest.la $(PTHREAD_LIBS)
diff --git a/src/glsl/tests/optimization-test b/src/glsl/tests/optimization-test
index 363c6ccda56..59383f8f912 100755
--- a/src/glsl/tests/optimization-test
+++ b/src/glsl/tests/optimization-test
@@ -1,5 +1,11 @@
#!/bin/bash
+if [ ! -z "$srcdir" ]; then
+ compare_ir=`pwd`/tests/compare_ir
+else
+ compare_ir=./compare_ir
+fi
+
total=0
pass=0
@@ -8,12 +14,12 @@ for test in `find . -iname '*.opt_test'`; do
echo -n "Testing $test..."
(cd `dirname "$test"`; ./`basename "$test"`) > "$test.out" 2>&1
total=$((total+1))
- if $PYTHON2 $PYTHON_FLAGS ./compare_ir "$test.expected" "$test.out" >/dev/null 2>&1; then
+ if $PYTHON2 $PYTHON_FLAGS $compare_ir "$test.expected" "$test.out" >/dev/null 2>&1; then
echo "PASS"
pass=$((pass+1))
else
echo "FAIL"
- $PYTHON2 $PYTHON_FLAGS ./compare_ir "$test.expected" "$test.out"
+ $PYTHON2 $PYTHON_FLAGS $compare_ir "$test.expected" "$test.out"
fi
done