summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2009-08-30 21:12:17 -0700
committerJoshua Haberman <joshua@reverberate.org>2009-08-30 21:12:17 -0700
commit46fac0f58d169555cd0d53f8acb7fbe83a45a191 (patch)
tree08bad325af3d5c9975b26c87d96fa10153dd43d7 /Makefile
parentd05eac2890195e0d929263b4a1b28b813bd09e85 (diff)
Tests use valgrind, chdir in test.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 16 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 282e3a3..3f2d8c7 100644
--- a/Makefile
+++ b/Makefile
@@ -73,31 +73,42 @@ python: $(LIBUPB_PIC)
# Tests
tests: tests/tests \
+ tests/test_table \
tests/t.test_vs_proto2.googlemessage1 \
tests/t.test_vs_proto2.googlemessage2
-test: tests/tests
- ./tests/tests
+test: tests
+ @echo Running all tests under valgrind.
+ valgrind --leak-check=full --error-exitcode=1 ./tests/tests
+# Needs to be rewritten to separate the benchmark.
+# valgrind --error-exitcode=1 ./tests/test_table
+ @for test in tests/t.* ; do \
+ echo valgrind --leak-check=full --error-exitcode=1 ./$$test; \
+ valgrind --leak-check=full --error-exitcode=1 ./$$test; \
+ done;
tests/t.test_vs_proto2.googlemessage1 \
tests/t.test_vs_proto2.googlemessage2: \
tests/test_vs_proto2.cc $(LIBUPB) benchmarks/google_messages.proto.pb \
benchmarks/google_messages.pb.cc
- $(CXX) $(CXXFLAGS) $(CPPFLAGS) -o tests/test_vs_proto2.googlemessage1 $< \
+ $(CXX) $(CXXFLAGS) $(CPPFLAGS) -o tests/t.test_vs_proto2.googlemessage1 $< \
-DMESSAGE_NAME=\"benchmarks.SpeedMessage1\" \
-DMESSAGE_DESCRIPTOR_FILE=\"../benchmarks/google_messages.proto.pb\" \
-DMESSAGE_FILE=\"../benchmarks/google_message1.dat\" \
-DMESSAGE_CIDENT="benchmarks::SpeedMessage1" \
-DMESSAGE_HFILE=\"../benchmarks/google_messages.pb.h\" \
benchmarks/google_messages.pb.cc -lprotobuf -lpthread $(LIBUPB)
- $(CXX) $(CXXFLAGS) $(CPPFLAGS) -o tests/test_vs_proto2.googlemessage2 $< \
+ $(CXX) $(CXXFLAGS) $(CPPFLAGS) -o tests/t.test_vs_proto2.googlemessage2 $< \
-DMESSAGE_NAME=\"benchmarks.SpeedMessage2\" \
-DMESSAGE_DESCRIPTOR_FILE=\"../benchmarks/google_messages.proto.pb\" \
-DMESSAGE_FILE=\"../benchmarks/google_message2.dat\" \
-DMESSAGE_CIDENT="benchmarks::SpeedMessage2" \
-DMESSAGE_HFILE=\"../benchmarks/google_messages.pb.h\" \
benchmarks/google_messages.pb.cc -lprotobuf -lpthread $(LIBUPB)
-tests/test_table: src/libupb.a
+tests/test_table: tests/test_table.cc
+ # Includes <hash_set> which is a deprecated header.
+ $(CXX) $(CXXFLAGS) $(CPPFLAGS) -Wno-deprecated -o $@ $< $(LIBUPB)
+
tests/tests: src/libupb.a
# Tools
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback