aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordaichi <daichi@FreeBSD.org>2012-04-25 11:21:24 +0800
committerdaichi <daichi@FreeBSD.org>2012-04-25 11:21:24 +0800
commite5d3a9bd722c68f72beb7a4e8a4ab61a5c85af55 (patch)
treee676ed6c7a6f794959e06ad48974b10ed0b709a8
parent24f6ebe64e2c6e14f5bbc7f7135930cbdeba3773 (diff)
downloadfreebsd-ports-gnome-e5d3a9bd722c68f72beb7a4e8a4ab61a5c85af55.tar.gz
freebsd-ports-gnome-e5d3a9bd722c68f72beb7a4e8a4ab61a5c85af55.tar.zst
freebsd-ports-gnome-e5d3a9bd722c68f72beb7a4e8a4ab61a5c85af55.zip
Add a new port deve/c-unit, A unit testing framework for C
Submitted by: Takanori Sawada <tak.swd@gmail.com>
-rw-r--r--devel/Makefile1
-rw-r--r--devel/c-unit/Makefile102
-rw-r--r--devel/c-unit/distinfo2
-rw-r--r--devel/c-unit/files/patch-c-unit-Sources-Automated-Automated.c30
-rw-r--r--devel/c-unit/files/patch-c-unit-Sources-Framework-MyMem.c13
-rw-r--r--devel/c-unit/pkg-descr5
-rw-r--r--devel/c-unit/pkg-plist24
7 files changed, 177 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile
index d07934b0713b..1ade5a76c1b1 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -159,6 +159,7 @@
SUBDIR += bzr-svn
SUBDIR += bzr-upload
SUBDIR += bzrtools
+ SUBDIR += c-unit
SUBDIR += c4
SUBDIR += calibrator
SUBDIR += cbind
diff --git a/devel/c-unit/Makefile b/devel/c-unit/Makefile
new file mode 100644
index 000000000000..3d12f8c6a00a
--- /dev/null
+++ b/devel/c-unit/Makefile
@@ -0,0 +1,102 @@
+# New ports collection makefile for: c-unit
+# Date created: 14 Apr 2012
+# Whom: Takanori Sawada <tak.swd@gmail.com>
+#
+# $FreeBSD$
+
+PORTNAME= c-unit
+DISTVERSION= 1.1.1
+CATEGORIES= devel
+MASTER_SITES= ${MASTER_SITE_GOOGLE_CODE}
+
+MAINTAINER= tak.swd@gmail.com
+COMMENT= A unit testing framework for C
+
+CONFLICTS= cunit-[0-9]*
+
+GNU_CONFIGURE= yes
+USE_GMAKE= yes
+USE_AUTOTOOLS= autoheader
+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
+# DEP "Enable use of deprecated v1.1 names" Off
+
+post-patch:
+ @${REINPLACE_CMD} \
+ 's|/@PACKAGE@/Examples/Automated|/examples/@PACKAGE@/Automated|g' \
+ ${WRKSRC}/Examples/AutomatedTest/Makefile.in
+ @${REINPLACE_CMD} \
+ 's|/@PACKAGE@/Examples/Basic|/examples/@PACKAGE@/Basic|g' \
+ ${WRKSRC}/Examples/BasicTest/Makefile.in
+ @${REINPLACE_CMD} \
+ 's|/@PACKAGE@/Examples/Console|/examples/@PACKAGE@/Console|g' \
+ ${WRKSRC}/Examples/ConsoleTest/Makefile.in
+ @${REINPLACE_CMD} \
+ 's|/@PACKAGE@/Examples/Curses|/examples/@PACKAGE@/Curses|g' \
+ ${WRKSRC}/Examples/CursesTest/Makefile.in
+
+.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
+#.if defined(WITH_DEP)
+#CONFIGURE_ARGS+= --enable-deprecated
+#.endif
+
+.include <bsd.port.post.mk>
diff --git a/devel/c-unit/distinfo b/devel/c-unit/distinfo
new file mode 100644
index 000000000000..f940489f6ee2
--- /dev/null
+++ b/devel/c-unit/distinfo
@@ -0,0 +1,2 @@
+SHA256 (c-unit-1.1.1.tar.gz) = 5cd910177ce8fd306a2cfe63cdf7997a5ca32d824f89cb206d245208fdd44d6b
+SIZE (c-unit-1.1.1.tar.gz) = 1216206
diff --git a/devel/c-unit/files/patch-c-unit-Sources-Automated-Automated.c b/devel/c-unit/files/patch-c-unit-Sources-Automated-Automated.c
new file mode 100644
index 000000000000..bac82171db8c
--- /dev/null
+++ b/devel/c-unit/files/patch-c-unit-Sources-Automated-Automated.c
@@ -0,0 +1,30 @@
+--- CUnit/Sources/Automated/Automated.c.orig 2009-06-11 03:50:52.000000000 +0900
++++ CUnit/Sources/Automated/Automated.c 2012-04-14 02:08:39.000000000 +0900
+@@ -227,13 +227,13 @@
+ if (bJUnitXmlOutput == CU_TRUE) {
+ fprintf(f_pTestResultFile,
+ "<?xml version=\"1.0\" ?> \n"
+- "<?xml-stylesheet type=\"text/xsl\" href=\"CUnit-Run.xsl\" ?> \n"
++ "<?xml-stylesheet type=\"text/xsl\" href=\"/usr/local/share/CUnit/CUnit-Run.xsl\" ?> \n"
+ " <cunit_testsuites> \n");
+ } else {
+ 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");
+ }
+@@ -616,8 +616,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");
diff --git a/devel/c-unit/files/patch-c-unit-Sources-Framework-MyMem.c b/devel/c-unit/files/patch-c-unit-Sources-Framework-MyMem.c
new file mode 100644
index 000000000000..01bcf6d76b7d
--- /dev/null
+++ b/devel/c-unit/files/patch-c-unit-Sources-Framework-MyMem.c
@@ -0,0 +1,13 @@
+--- CUnit/Sources/Framework/MyMem.c.orig 2009-06-11 03:50:53.000000000 +0900
++++ CUnit/Sources/Framework/MyMem.c 2012-04-14 02:08:51.000000000 +0900
+@@ -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>");
diff --git a/devel/c-unit/pkg-descr b/devel/c-unit/pkg-descr
new file mode 100644
index 000000000000..926088c3521e
--- /dev/null
+++ b/devel/c-unit/pkg-descr
@@ -0,0 +1,5 @@
+CUnit is a system for writing, administering, and running
+unit tests in C. It is built as a static library which is
+linked with the user's testing code.
+
+WWW: http://code.google.com/p/c-unit/
diff --git a/devel/c-unit/pkg-plist b/devel/c-unit/pkg-plist
new file mode 100644
index 000000000000..82cd8234ddc3
--- /dev/null
+++ b/devel/c-unit/pkg-plist
@@ -0,0 +1,24 @@
+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
+@dirrmtry share/examples/CUnit/Curses
+@dirrmtry share/examples/CUnit/Console
+@dirrmtry share/examples/CUnit/Basic
+@dirrmtry share/examples/CUnit/Automated
+@dirrmtry share/examples/CUnit
+@dirrmtry share/CUnit/Test
+@dirrm share/CUnit
+@dirrm include/CUnit