[Mesa-dev] [PATCH 14/17] intel/compiler: automake: rename test_eu_compact and link against gtest
Emil Velikov
emil.l.velikov at gmail.com
Wed Mar 8 17:16:05 UTC 2017
From: Emil Velikov <emil.velikov at collabora.com>
We'd want to rewrite the test to be like the rest, but until then this
gets rid of nice hunk of boilderplate.
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
src/intel/Makefile.compiler.am | 38 +++++++---------------
.../{test_eu_compact.c => test_eu_compact.cpp} | 2 +-
2 files changed, 13 insertions(+), 27 deletions(-)
rename src/intel/compiler/{test_eu_compact.c => test_eu_compact.cpp} (98%)
diff --git a/src/intel/Makefile.compiler.am b/src/intel/Makefile.compiler.am
index c5e5b11ffc..9c8df3adb1 100644
--- a/src/intel/Makefile.compiler.am
+++ b/src/intel/Makefile.compiler.am
@@ -40,6 +40,7 @@ EXTRA_DIST += \
# ----------------------------------------------------------------------------
TEST_LIBS = \
+ $(top_builddir)/src/gtest/libgtest.la \
compiler/libintel_compiler.la \
common/libintel_common.la \
$(top_builddir)/src/compiler/nir/libnir.la \
@@ -64,53 +65,38 @@ check_PROGRAMS += $(COMPILER_TESTS)
compiler_test_fs_cmod_propagation_SOURCES = \
compiler/test_fs_cmod_propagation.cpp
-compiler_test_fs_cmod_propagation_LDADD = \
- $(top_builddir)/src/gtest/libgtest.la \
- $(TEST_LIBS)
+compiler_test_fs_cmod_propagation_LDADD = $(TEST_LIBS)
compiler_test_fs_copy_propagation_SOURCES = \
compiler/test_fs_copy_propagation.cpp
-compiler_test_fs_copy_propagation_LDADD = \
- $(top_builddir)/src/gtest/libgtest.la \
- $(TEST_LIBS)
+compiler_test_fs_copy_propagation_LDADD = $(TEST_LIBS)
compiler_test_fs_saturate_propagation_SOURCES = \
compiler/test_fs_saturate_propagation.cpp
-compiler_test_fs_saturate_propagation_LDADD = \
- $(top_builddir)/src/gtest/libgtest.la \
- $(TEST_LIBS)
+compiler_test_fs_saturate_propagation_LDADD = $(TEST_LIBS)
compiler_test_vf_float_conversions_SOURCES = \
compiler/test_vf_float_conversions.cpp
-compiler_test_vf_float_conversions_LDADD = \
- $(top_builddir)/src/gtest/libgtest.la \
- $(TEST_LIBS)
+compiler_test_vf_float_conversions_LDADD = $(TEST_LIBS)
compiler_test_vec4_register_coalesce_SOURCES = \
compiler/test_vec4_register_coalesce.cpp
-compiler_test_vec4_register_coalesce_LDADD = \
- $(top_builddir)/src/gtest/libgtest.la \
- $(TEST_LIBS)
+compiler_test_vec4_register_coalesce_LDADD = $(TEST_LIBS)
compiler_test_vec4_copy_propagation_SOURCES = \
compiler/test_vec4_copy_propagation.cpp
-compiler_test_vec4_copy_propagation_LDADD = \
- $(top_builddir)/src/gtest/libgtest.la \
- $(TEST_LIBS)
+compiler_test_vec4_copy_propagation_LDADD = $(TEST_LIBS)
compiler_test_vec4_cmod_propagation_SOURCES = \
compiler/test_vec4_cmod_propagation.cpp
-compiler_test_vec4_cmod_propagation_LDADD = \
- $(top_builddir)/src/gtest/libgtest.la \
- $(TEST_LIBS)
+compiler_test_vec4_cmod_propagation_LDADD = $(TEST_LIBS)
+# Strictly speaking this is neither a C++ test nor using gtest - we can address
+# address that at a later point. Until then, this allows us a to simplify things.
compiler_test_eu_compact_SOURCES = \
- compiler/test_eu_compact.c
-nodist_EXTRA_compiler_test_eu_compact_SOURCES = dummy.cpp
+ compiler/test_eu_compact.cpp
compiler_test_eu_compact_LDADD = $(TEST_LIBS)
compiler_test_eu_validate_SOURCES = \
compiler/test_eu_validate.cpp
-compiler_test_eu_validate_LDADD = \
- $(top_builddir)/src/gtest/libgtest.la \
- $(TEST_LIBS)
+compiler_test_eu_validate_LDADD = $(TEST_LIBS)
diff --git a/src/intel/compiler/test_eu_compact.c b/src/intel/compiler/test_eu_compact.cpp
similarity index 98%
rename from src/intel/compiler/test_eu_compact.c
rename to src/intel/compiler/test_eu_compact.cpp
index d7453613b6..d1f6822f94 100644
--- a/src/intel/compiler/test_eu_compact.c
+++ b/src/intel/compiler/test_eu_compact.cpp
@@ -287,7 +287,7 @@ run_tests(const struct gen_device_info *devinfo)
int
main(int argc, char **argv)
{
- struct gen_device_info *devinfo = calloc(1, sizeof(*devinfo));
+ struct gen_device_info *devinfo = (struct gen_device_info *)calloc(1, sizeof(*devinfo));
devinfo->gen = 6;
bool fail = false;
--
2.11.1
More information about the mesa-dev
mailing list