Permalink
Browse files

added make test ability

  • Loading branch information...
1 parent 2cdc6b4 commit 09da609fc6008a60bc9718ac1ec5eb579755938f @bmuller committed Jan 13, 2008
Showing with 8 additions and 4 deletions.
  1. +8 −1 Makefile.am
  2. +0 −2 tests/db_test.cpp
  3. +0 −1 tests/object_test.cpp
View
@@ -1,6 +1,13 @@
SUBDIRS = stactiverecord tests examples
-
HEADERDIR = stactiverecord
+TESTDIR = tests
+
nobase_include_HEADERS = $(HEADERDIR)/stactive_record.h $(HEADERDIR)/config.h $(HEADERDIR)/cud_property_register.h \
$(HEADERDIR)/exception.h $(HEADERDIR)/query.h $(HEADERDIR)/record.h $(HEADERDIR)/stactive_record.h \
$(HEADERDIR)/types.h $(HEADERDIR)/utils.h $(HEADERDIR)/storage.h $(HEADERDIR)/where.h $(HEADERDIR)/datetime.h
+
+test: all
+ cd tests
+ (test $(DBCONFIG) && (($(TESTDIR)/db_test $(DBCONFIG) && $(TESTDIR)/object_test $(DBCONFIG) && echo "Tests completed successfully") \
+ || echo "Tests failed")) || (echo You should set the DBCONFIG environment variable to "scheme://[user[:password]@host[:port]/]database". \
+ For instance: && echo make test DBCONFIG=sqlite://:memory:)
View
@@ -58,8 +58,6 @@ int main(int argc, char* argv[]) {
db->get(id, classname, dtresults);
assert(sresults == svalues, "storing/retrieving string values");
assert(iresults == ivalues, "storing/retrieving int values");
- dtresults.dumpeach();
- dtvalues.dumpeach();
assert(dtresults == dtvalues, "storing/retrieving datetime values");
// now test updates
@@ -95,7 +95,6 @@ int main(int argc, char* argv[]) {
popular.save();
ogtt = popular.getMany<TestTwo>();
- ogtt.get_ids().dump();
assert(ogtt.size() == number, "testing object relationship with lots of objects");
TestThree tthree;

0 comments on commit 09da609

Please sign in to comment.