glsl/build: Build tests via the glsl Makefile
authorMatt Turner <mattst88@gmail.com>
Tue, 15 Jan 2013 19:45:40 +0000 (11:45 -0800)
committerMatt Turner <mattst88@gmail.com>
Tue, 22 Jan 2013 22:33:24 +0000 (14:33 -0800)
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
Makefile.am
configure.ac
src/glsl/Makefile.am
src/glsl/tests/Makefile.am [deleted file]
src/glsl/tests/optimization-test

index c6fc06248529338004366ceb688e16feaa639e7b..0e61a55d5e16d036733c6bcafcc1807fd09b229e 100644 (file)
@@ -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/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
        $(MAKE) -C src/glx/tests check
 
 .PHONY: doxygen
index 002fedc2402a15b4e519ebf348df5b2d9f1762bd..f338e20c7e5e3a665149daca7a18bfbfd0d5bbce 100644 (file)
@@ -2082,7 +2082,6 @@ AC_CONFIG_FILES([Makefile
                src/gbm/main/gbm.pc
                src/glsl/Makefile
                src/glsl/builtin_compiler/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
                src/glx/Makefile
                src/glx/tests/Makefile
                src/gtest/Makefile
index 2e297f1570e0602e405646db82a8cc36556e9ffd..f97dc2152c8bb685b1cfe7e97e09080bc6c3a1da 100644 (file)
@@ -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/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)
        $(DEFINES) \
        $(API_DEFINES)
 AM_CFLAGS = $(VISIBILITY_CFLAGS)
@@ -35,10 +36,43 @@ AM_CXXFLAGS = $(VISIBILITY_CXXFLAGS)
 
 include Makefile.sources
 
 
 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
 
 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                               \
 
 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 (file)
index eaf5a3c..0000000
+++ /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)
index 363c6ccda564a316d18e2f0279407b2063ffa78a..59383f8f912e3d95611a25626f38017ccdf36c61 100755 (executable)
@@ -1,5 +1,11 @@
 #!/bin/bash
 
 #!/bin/bash
 
+if [ ! -z "$srcdir" ]; then
+   compare_ir=`pwd`/tests/compare_ir
+else
+   compare_ir=./compare_ir
+fi
+
 total=0
 pass=0
 
 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))
     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"
         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
 
     fi
 done