View Issue Details

IDProjectCategoryView StatusLast Update
0001617SOGoBackend Generalpublic2012-10-25 14:14
Reporterdekkers Assigned Towsourdeau 
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Version1.3.11 
Fixed in Version2.0.2 
Summary0001617: Support running "make check"
Description

This is the patch I'm using to run the test suite during the debian package build. It makes it possible to use "make check" to run the test suite, by building a sogo-tests that is also executable from the build directory by make (using -rpath), running sogo-tests and failing if sogo-tests returns non-zero. I also define the number of expected failures in the sogo testrunner and compare that to the number of failures. I'm not really sure that's the best way to do it, it feels a bit dirty but it does get the job done. I'm open for suggestions on how to implement that in a better way.

TagsNo tags attached.

Activities

2012-02-06 16:43

 

0002-make-check.patch (2,901 bytes)   
From: Jeroen Dekkers <jeroen@dekkers.ch>
Date: Wed, 7 Dec 2011 21:11:45 +0100
Subject: make-check

---
 GNUmakefile                       |    4 +++-
 Tests/Unit/GNUmakefile            |   12 +++++++++---
 Tests/Unit/SOGoTestRunner.m       |    4 +++-
 UI/Templates/GNUmakefile          |    2 ++
 UI/WebServerResources/GNUmakefile |    2 ++
 5 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/GNUmakefile b/GNUmakefile
index af8be35..9571607 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -10,6 +10,8 @@ SUBPROJECTS = \
 	SoObjects	\
 	Main		\
 	UI		\
-	Tools
+	Tools		\
+	Tests/Unit	\
+
 
 include $(GNUSTEP_MAKEFILES)/aggregate.make
diff --git a/Tests/Unit/GNUmakefile b/Tests/Unit/GNUmakefile
index 5b22f55..2b36a42 100644
--- a/Tests/Unit/GNUmakefile
+++ b/Tests/Unit/GNUmakefile
@@ -27,11 +27,17 @@ $(TEST_TOOL)_OBJC_FILES += \
 
 TEST_TOOL_NAME = $(TEST_TOOL)
 
-TEST_TOOL_CPPFLAGS += \
-	-Wall -D_GNU_SOURCE -I../SOPE/ -I../SoObjects/ -I../UI/
+$(TEST_TOOL)_CPPFLAGS += \
+	-Wall -D_GNU_SOURCE -I../../SOPE/ -I../../SoObjects/ -I../../UI/
 
 ADDITIONAL_LIB_DIRS += \
-	-L../SoObjects/SOGo -lSOGo -lNGMime -lNGCards -lGDLContentStore -lNGExtensions -lSBJson -lobjc -L/usr/local/lib  -lSaxObjC
+	-L../../SoObjects/SOGo/SOGo.framework/Versions/Current -L../../SOPE/NGCards/obj -L../../SOPE/GDLContentStore/obj -lSOGo -lNGMime -lNGCards -lGDLContentStore -lNGExtensions -lSBJson -lobjc \
+	-L/usr/local/lib  -lSaxObjC \
+	-Wl,-rpath,../../SoObjects/SOGo/SOGo.framework/Versions/Current -Wl,-rpath,../../SOPE/NGCards/obj -Wl,-rpath,../../SOPE/GDLContentStore/obj -Wl,-rpath,../../OGoContentStore/obj
+
+
+check ::
+	./obj/sogo-tests
 
 -include GNUmakefile.preamble
 include $(GNUSTEP_MAKEFILES)/test-tool.make
diff --git a/Tests/Unit/SOGoTestRunner.m b/Tests/Unit/SOGoTestRunner.m
index 2dcaebd..5d3c49a 100644
--- a/Tests/Unit/SOGoTestRunner.m
+++ b/Tests/Unit/SOGoTestRunner.m
@@ -31,6 +31,8 @@
 
 #import "SOGoTestRunner.h"
 
+#define EXPECTED_FAILURES 3
+
 @implementation SOGoTestRunner
 
 + (SOGoTestRunner *) testRunner
@@ -92,7 +94,7 @@
   [allTestClasses autorelease];
   [self autorelease];
 
-  return rc;
+  return (failuresCount + errorsCount != EXPECTED_FAILURES);
 }
 
 - (void) incrementTestCounter: (SOGoTestFailureCode) failureCode
diff --git a/UI/Templates/GNUmakefile b/UI/Templates/GNUmakefile
index f96e836..304843c 100644
--- a/UI/Templates/GNUmakefile
+++ b/UI/Templates/GNUmakefile
@@ -35,6 +35,8 @@ install ::
 	  tar cf - $(WOXS) | ( cd $(SOGO_TEMPLATESDIR); tar xf -) ;\
 	fi
 
+check ::
+
 clean ::
 
 distclean :: clean
diff --git a/UI/WebServerResources/GNUmakefile b/UI/WebServerResources/GNUmakefile
index 2d49a69..21e9922 100644
--- a/UI/WebServerResources/GNUmakefile
+++ b/UI/WebServerResources/GNUmakefile
@@ -17,6 +17,8 @@ install ::
 	  cp -r scriptaculous $(SOGO_WEBSERVERRESOURCESDIR)/; \
 	fi
 
+check ::
+
 clean ::
 
 distclean :: clean
-- 
0002-make-check.patch (2,901 bytes)   

2012-04-04 12:05

 

0002-make-check.patch2 (2,937 bytes)
dekkers

dekkers

2012-04-04 12:06

reporter   ~0003686

New patch fixes linking on Ubuntu, because they use -Wl,as-needed by default.

Issue History

Date Modified Username Field Change
2012-02-06 16:43 dekkers New Issue
2012-02-06 16:43 dekkers File Added: 0002-make-check.patch
2012-04-04 12:05 dekkers File Added: 0002-make-check.patch2
2012-04-04 12:06 dekkers Note Added: 0003686
2012-10-25 14:14 wsourdeau Status new => resolved
2012-10-25 14:14 wsourdeau Fixed in Version => 2.0.2
2012-10-25 14:14 wsourdeau Resolution open => fixed
2012-10-25 14:14 wsourdeau Assigned To => wsourdeau