[Midnightbsd-cvs] mports: mports/devel: add cunit, a unit testing framework for C under
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sun Feb 8 18:08:39 EST 2009
Log Message:
-----------
add cunit, a unit testing framework for C under lgpl
Modified Files:
--------------
mports/devel:
Makefile (r1.272 -> r1.273)
Added Files:
-----------
mports/devel/cunit:
Makefile (r1.1)
distinfo (r1.1)
pkg-descr (r1.1)
pkg-plist (r1.1)
mports/devel/cunit/files:
patch-CUnit-Sources-Automated-Automated.c (r1.1)
patch-CUnit-Sources-Framework-MyMem.c (r1.1)
-------------- next part --------------
--- /dev/null
+++ devel/cunit/pkg-descr
@@ -0,0 +1,9 @@
+CUnit is a lightweight system for writing, administering, and running
+unit tests in C. It provides C programmers a basic testing functionality
+with a flexible variety of user interfaces. CUnit is built as a static
+library which is linked with the user's testing code. It uses a simple
+framework for building test structures, and provides a rich set of
+assertions for testing common data types. In addition, several different
+interfaces are provided for running tests and reporting results.
+
+WWW: http://cunit.sourceforge.net/
--- /dev/null
+++ devel/cunit/pkg-plist
@@ -0,0 +1,47 @@
+include/CUnit/CUError.h
+include/CUnit/CUnit.h
+include/CUnit/MyMem.h
+include/CUnit/TestDB.h
+include/CUnit/TestRun.h
+include/CUnit/Util.h
+lib/libcunit.a
+lib/libcunit.la
+lib/libcunit.so
+lib/libcunit.so.1
+share/CUnit/CUnit-List.dtd
+share/CUnit/CUnit-List.xsl
+share/CUnit/CUnit-Run.dtd
+share/CUnit/CUnit-Run.xsl
+share/CUnit/Memory-Dump.dtd
+share/CUnit/Memory-Dump.xsl
+%%PORTDOCS%%%%DOCSDIR%%/CUnit_doc.css
+%%PORTDOCS%%%%DOCSDIR%%/error_handling.html
+%%PORTDOCS%%%%DOCSDIR%%/fdl.html
+%%PORTDOCS%%%%DOCSDIR%%/headers/Automated.h
+%%PORTDOCS%%%%DOCSDIR%%/headers/Basic.h
+%%PORTDOCS%%%%DOCSDIR%%/headers/CUCurses.h
+%%PORTDOCS%%%%DOCSDIR%%/headers/CUError.h
+%%PORTDOCS%%%%DOCSDIR%%/headers/CUnit.h
+%%PORTDOCS%%%%DOCSDIR%%/headers/Console.h
+%%PORTDOCS%%%%DOCSDIR%%/headers/MyMem.h
+%%PORTDOCS%%%%DOCSDIR%%/headers/TestDB.h
+%%PORTDOCS%%%%DOCSDIR%%/headers/TestRun.h
+%%PORTDOCS%%%%DOCSDIR%%/headers/Util.h
+%%PORTDOCS%%%%DOCSDIR%%/headers/Win.h
+%%PORTDOCS%%%%DOCSDIR%%/index.html
+%%PORTDOCS%%%%DOCSDIR%%/introduction.html
+%%PORTDOCS%%%%DOCSDIR%%/managing_tests.html
+%%PORTDOCS%%%%DOCSDIR%%/running_tests.html
+%%PORTDOCS%%%%DOCSDIR%%/test_registry.html
+%%PORTDOCS%%%%DOCSDIR%%/writing_tests.html
+ at dirrmtry share/examples/CUnit/Curses
+ at dirrmtry share/examples/CUnit/Console
+ at dirrmtry share/examples/CUnit/Basic
+ at dirrmtry share/examples/CUnit/Automated
+ at dirrmtry share/examples/CUnit
+ at dirrmtry share/CUnit/Test
+%%PORTDOCS%%@dirrm %%DOCSDIR%%/headers
+%%PORTDOCS%%@dirrm %%DOCSDIR%%
+%%PORTDOCS%%@dirrmtry share/doc
+ at dirrm share/CUnit
+ at dirrm include/CUnit
--- /dev/null
+++ devel/cunit/Makefile
@@ -0,0 +1,94 @@
+# $MidnightBSD: mports/devel/cunit/Makefile,v 1.1 2009/02/08 23:08:37 laffer1 Exp $
+
+PORTNAME= cunit
+DISTVERSION= 2.1-0
+CATEGORIES= devel
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
+MASTER_SITE_SUBDIR= ${PORTNAME}
+DISTNAME= ${PORTNAME:S/^cu/CU/}-${DISTVERSION}-src
+
+MAINTAINER= ports at MidnightBSD.org
+COMMENT= An automated unit testing framework for C
+LICENSE= lgpl
+
+WRKSRC= ${WRKDIR}/${PORTNAME:S/^cu/CU/}-${DISTVERSION}
+DOCSDIR= ${PREFIX}/share/doc/CUnit
+GNU_CONFIGURE= yes
+USE_GMAKE= yes
+USE_AUTOTOOLS= autoheader:262
+USE_LDCONFIG= yes
+
+MAN3= CUnit.3
+
+OPTIONS= DEB "Enable debug interface" Off \
+ AUT "Enable automated(XML) interface" On \
+ BAS "Enable basic interface" On \
+ CON "Enable console interface" On \
+ CUR "Enable curses interface" Off \
+ EXA "Compile example programs" Off \
+ ITE "Compile internal test program" Off \
+ MEM "Enable internal memory tracking" Off
+
+post-patch:
+ @${REINPLACE_CMD} -e 's|/doc/@PACKAGE@|/share/doc/@PACKAGE@|g' ${WRKSRC}/doc/Makefile.in
+ @${REINPLACE_CMD} -e 's|/doc/@PACKAGE@|/share/doc/@PACKAGE@|g' ${WRKSRC}/doc/headers/Makefile.in
+ @${REINPLACE_CMD} -e 's|/@PACKAGE@/Examples/Automated|/examples/@PACKAGE@/Automated|g' ${WRKSRC}/Examples/AutomatedTest/Makefile.in
+ @${REINPLACE_CMD} -e 's|/@PACKAGE@/Examples/Basic|/examples/@PACKAGE@/Basic|g' ${WRKSRC}/Examples/BasicTest/Makefile.in
+ @${REINPLACE_CMD} -e 's|/@PACKAGE@/Examples/Console|/examples/@PACKAGE@/Console|g' ${WRKSRC}/Examples/ConsoleTest/Makefile.in
+ @${REINPLACE_CMD} -e 's|/@PACKAGE@/Examples/Curses|/examples/@PACKAGE@/Curses|g' ${WRKSRC}/Examples/CursesTest/Makefile.in
+.if defined(NOPORTDOCS)
+ ${REINPLACE_CMD} -e 's|CUnit doc Man Share|CUnit Man Share|g' ${WRKSRC}/Makefile.in
+.endif
+
+.include <bsd.port.pre.mk>
+
+.if defined(WITH_DEB)
+CONFIGURE_ARGS+= --enable-debug
+.endif
+.if defined(WITHOUT_AUT)
+CONFIGURE_ARGS+= --disable-automated
+.else
+PLIST_FILES+= include/CUnit/Automated.h
+.endif
+.if defined(WITHOUT_BAS)
+CONFIGURE_ARGS+= --disable-basic
+.else
+PLIST_FILES+= include/CUnit/Basic.h
+.endif
+.if defined(WITHOUT_CON)
+CONFIGURE_ARGS+= --disable-console
+.else
+PLIST_FILES+= include/CUnit/Console.h
+.endif
+.if defined(WITH_CUR)
+CONFIGURE_ARGS+= --enable-curses
+PLIST_FILES+= include/CUnit/CUCurses.h
+.endif
+.if defined(WITH_EXA)
+CONFIGURE_ARGS+= --enable-examples
+.if defined(WITH_AUT)
+PLIST_FILES+= share/examples/CUnit/Automated/AutomatedTest \
+ share/examples/CUnit/Automated/README
+.endif
+.if defined(WITH_BAS)
+PLIST_FILES+= share/examples/CUnit/Basic/BasicTest \
+ share/examples/CUnit/Basic/README
+.endif
+.if defined(WITH_CON)
+PLIST_FILES+= share/examples/CUnit/Console/ConsoleTest \
+ share/examples/CUnit/Console/README
+.endif
+.if defined(WITH_CUR)
+PLIST_FILES+= share/examples/CUnit/Curses/CursesTest \
+ share/examples/CUnit/Curses/README
+.endif
+.endif
+.if defined(WITH_ITE)
+CONFIGURE_ARGS+= --enable-test
+PLIST_FILES+= share/CUnit/Test/test_cunit
+.endif
+.if defined(WITH_MEM)
+CONFIGURE_ARGS+= --enable-memtrace
+.endif
+
+.include <bsd.port.post.mk>
--- /dev/null
+++ devel/cunit/distinfo
@@ -0,0 +1,3 @@
+MD5 (CUnit-2.1-0-src.tar.gz) = f4f53d2c41e9315a91b4f14a1706fe4f
+SHA256 (CUnit-2.1-0-src.tar.gz) = b5fc0ab0f03e8d287a3f65935c7e36fabfdcd9f926ee6f50ac621ea6ab6fa8c6
+SIZE (CUnit-2.1-0-src.tar.gz) = 628767
Index: Makefile
===================================================================
RCS file: /home/cvs/mports/devel/Makefile,v
retrieving revision 1.272
retrieving revision 1.273
diff -L devel/Makefile -L devel/Makefile -u -r1.272 -r1.273
--- devel/Makefile
+++ devel/Makefile
@@ -41,6 +41,7 @@
SUBDIR += cmake
SUBDIR += cscope
SUBDIR += ctags
+ SUBDIR += cunit
SUBDIR += cvs2svn
SUBDIR += cvsbook
SUBDIR += cvschangelogbuilder
--- /dev/null
+++ devel/cunit/files/patch-CUnit-Sources-Automated-Automated.c
@@ -0,0 +1,24 @@
+--- CUnit/Sources/Automated/Automated.c.orig Wed Jul 25 09:07:09 2007
++++ CUnit/Sources/Automated/Automated.c Wed Jul 25 16:45:43 2007
+@@ -222,8 +222,8 @@
+
+ fprintf(f_pTestResultFile,
+ "<?xml version=\"1.0\" ?> \n"
+- "<?xml-stylesheet type=\"text/xsl\" href=\"CUnit-Run.xsl\" ?> \n"
+- "<!DOCTYPE CUNIT_TEST_RUN_REPORT SYSTEM \"CUnit-Run.dtd\"> \n"
++ "<?xml-stylesheet type=\"text/xsl\" href=\"/usr/local/share/CUnit/CUnit-Run.xsl\" ?> \n"
++ "<!DOCTYPE CUNIT_TEST_RUN_REPORT SYSTEM \"/usr/local/share/CUnit/CUnit-Run.dtd\"> \n"
+ "<CUNIT_TEST_RUN_REPORT> \n"
+ " <CUNIT_HEADER/> \n");
+ }
+@@ -509,8 +509,8 @@
+
+ fprintf(pTestListFile,
+ "<?xml version=\"1.0\" ?> \n"
+- "<?xml-stylesheet type=\"text/xsl\" href=\"CUnit-List.xsl\" ?> \n"
+- "<!DOCTYPE CUNIT_TEST_LIST_REPORT SYSTEM \"CUnit-List.dtd\"> \n"
++ "<?xml-stylesheet type=\"text/xsl\" href=\"/usr/local/share/CUnit/CUnit-List.xsl\" ?> \n"
++ "<!DOCTYPE CUNIT_TEST_LIST_REPORT SYSTEM \"/usr/local/share/CUnit/CUnit-List.dtd\"> \n"
+ "<CUNIT_TEST_LIST_REPORT> \n"
+ " <CUNIT_HEADER/> \n"
+ " <CUNIT_LIST_TOTAL_SUMMARY> \n");
--- /dev/null
+++ devel/cunit/files/patch-CUnit-Sources-Framework-MyMem.c
@@ -0,0 +1,13 @@
+--- CUnit/Sources/Framework/MyMem.c.orig Wed Jul 25 16:47:05 2007
++++ CUnit/Sources/Framework/MyMem.c Wed Jul 25 16:47:40 2007
+@@ -340,8 +340,8 @@
+ setvbuf(pFile, NULL, _IONBF, 0);
+
+ fprintf(pFile, "<\?xml version=\"1.0\" \?>");
+- fprintf(pFile, "\n<\?xml-stylesheet type=\"text/xsl\" href=\"Memory-Dump.xsl\" \?>");
+- fprintf(pFile, "\n<!DOCTYPE MEMORY_DUMP_REPORT SYSTEM \"Memory-Dump.dtd\">");
++ fprintf(pFile, "\n<\?xml-stylesheet type=\"text/xsl\" href=\"/usr/local/share/CUnit/Memory-Dump.xsl\" \?>");
++ fprintf(pFile, "\n<!DOCTYPE MEMORY_DUMP_REPORT SYSTEM \"/usr/local/share/CUnit/Memory-Dump.dtd\">");
+ fprintf(pFile, "\n<MEMORY_DUMP_REPORT>");
+ fprintf(pFile, "\n <MD_HEADER/>");
+ fprintf(pFile, "\n <MD_RUN_LISTING>");
More information about the Midnightbsd-cvs
mailing list