[Mesa-dev] [PATCH 7/7] glsl/build: Build tests via the glsl Makefile

Matt Turner mattst88 at gmail.com
Wed Jan 16 15:14:16 PST 2013


---
 Makefile.am                      |    1 -
 configure.ac                     |    1 -
 src/glsl/Makefile.am             |   38 ++++++++++++++++++++++++++++++++++++--
 src/glsl/tests/Makefile.am       |   35 -----------------------------------
 src/glsl/tests/optimization-test |   10 ++++++++--
 5 files changed, 44 insertions(+), 41 deletions(-)
 delete mode 100644 src/glsl/tests/Makefile.am

diff --git a/Makefile.am b/Makefile.am
index ee73333..74f43da 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -30,7 +30,6 @@ check-local:
 	$(MAKE) -C src/mapi/glapi/tests check
 	$(MAKE) -C src/mapi/shared-glapi/tests check
 	$(MAKE) -C src/mesa/main/tests check
-	$(MAKE) -C src/glsl/tests check
 	$(MAKE) -C src/glx/tests check
 
 .PHONY: doxygen
diff --git a/configure.ac b/configure.ac
index b08c1c8..40496e7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2085,7 +2085,6 @@ AC_CONFIG_FILES([Makefile
 		src/gbm/main/gbm.pc
 		src/glsl/Makefile
 		src/glsl/builtin_compiler/Makefile
-		src/glsl/tests/Makefile
 		src/glx/Makefile
 		src/glx/tests/Makefile
 		src/gtest/Makefile
diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am
index 1962d3b..175183a 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 eaf5a3c..0000000
--- 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 363c6cc..59383f8 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
 
-- 
1.7.8.6



More information about the mesa-dev mailing list