Support for CUnit 2.1-3

James Cassell fedoraproject at cyberpear.com
Fri Oct 3 16:41:35 EDT 2014


Hello,

I have a patch to allow support of CUnit 2.1-3 using autoconf to
determine whether the change needs to be made.

V/r,
James Cassell


The following changes since commit
facf3b8a92989fe2a46fa7363f8be50a9fe21319:

  Bug#3848 lib/charset/aliases.txt: add latin1 as alias of iso-9959-1
  (2014-09-03 16:17:37 +0000)

are available in the git repository at:

  https://github.com/cyberpear/cyrus-imapd.git CUnit_2.1-3

for you to fetch changes up to 43e4ee785aad46969b571036069128148d3b3b4b:

  [cunit] cunit.pl: fix init of CU_SuiteInfo type for CUnit 2.1-3
  (2014-10-02 18:37:02 -0400)

----------------------------------------------------------------
James Cassell (1):
      [cunit] cunit.pl: fix init of CU_SuiteInfo type for CUnit 2.1-3

 configure.ac   |  4 ++++
 cunit/cunit.pl | 11 +++++++++++
 2 files changed, 15 insertions(+)

diff --git a/configure.ac b/configure.ac
index 2417cb6..176c904 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1362,6 +1362,10 @@ if test "$enable_unit_tests" = "yes" ; then
 	AC_MSG_NOTICE([Disabling unit tests because the required CUnit
 	library is not installed])
 	enable_unit_tests=no
     fi
+    AC_CHECK_HEADER([CUnit/Basic.h],
+       AC_CHECK_TYPE([CU_SetUpFunc],AC_DEFINE(HAVE_CU_SETUPFUNC,[],[Do
we have CU_SetUpFunc?]),,
+           [#include <CUnit/Basic.h>])
+       ,)
 fi
 if test "$enable_unit_tests" = "yes" ; then
     dnl Valgrind is an amazingly useful tool for running tests.  It
     doesn't
diff --git a/cunit/cunit.pl b/cunit/cunit.pl
index 65e617a..e5317f5 100755
--- a/cunit/cunit.pl
+++ b/cunit/cunit.pl
@@ -700,6 +700,7 @@ sub suite_generate_wrap($)
 	or die "Cannot open $file for writing: $!";
     print WRAP "/* Automatically generated by cunit.pl, do not edit
     */\n";
     print WRAP "#include \"$suite->{relpath}\"\n";
+    print WRAP "#include <config.h>\n";
 
     if (scalar @{$suite->{params}})
     {
@@ -745,8 +746,18 @@ sub suite_generate_wrap($)
     }
     print WRAP "    CU_TEST_INFO_NULL\n};\n";
 
+    print WRAP "#ifdef HAVE_CU_SETUPFUNC\n";
+
+    print WRAP "const CU_SuiteInfo $suite->{suitevar} = {" .
+              "\"$suite->{name}\", NULL, NULL, NULL, NULL, _tests};\n";
+
+    print WRAP "#else\n";
+
     print WRAP "const CU_SuiteInfo $suite->{suitevar} = {" .
 	       "\"$suite->{name}\", NULL, NULL, _tests};\n";
+
+    print WRAP "#endif\n";
+
     close WRAP;
 
     atomic_rewrite_end($suite->{wrap});


More information about the Cyrus-devel mailing list