aceunit-commit Mailing List for AceUnit (Page 7)
Status: Beta
Brought to you by:
christianhujer
You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(139) |
Nov
(77) |
Dec
(32) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(55) |
Feb
(11) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(9) |
Oct
(75) |
Nov
(57) |
Dec
(21) |
2009 |
Jan
(14) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
(24) |
Sep
(11) |
Oct
(1) |
Nov
|
Dec
|
2011 |
Jan
|
Feb
(21) |
Mar
(10) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
From: <chr...@us...> - 2008-11-12 09:13:42
|
Revision: 433 http://aceunit.svn.sourceforge.net/aceunit/?rev=433&view=rev Author: christianhujer Date: 2008-11-12 09:13:38 +0000 (Wed, 12 Nov 2008) Log Message: ----------- Unified this Makefile with the others. Modified Paths: -------------- trunk/src/native/test/exhand/Makefile Modified: trunk/src/native/test/exhand/Makefile =================================================================== --- trunk/src/native/test/exhand/Makefile 2008-11-12 08:55:32 UTC (rev 432) +++ trunk/src/native/test/exhand/Makefile 2008-11-12 09:13:38 UTC (rev 433) @@ -1,31 +1,52 @@ -ACE_UNIT_FILES=ExceptionHandling.c ExceptionHandling.h +CVERSION=c89 -ACE_UNIT_PATH=../../../ +ACE_UNIT_PATH=../../.. -all: prepare compile test +LINT=splint -clean: - rm -f $(ACE_UNIT_FILES) runTests *.gcov *.gcno *.gcda +PARTS=\ + ExceptionHandling \ + TryExceptionHandling -prepare: $(ACE_UNIT_FILES) +VPATH=$(ACE_UNIT_PATH)/native -ExceptionHandling.c: $(ACE_UNIT_PATH)/native/ExceptionHandling.c - cp $< $@ +OBJECTS=$(addsuffix .o,$(PARTS)) -ExceptionHandling.h: $(ACE_UNIT_PATH)/native/ExceptionHandling.h - cp $< $@ +LINTOUTS=$(addsuffix .ln,$(PARTS)) -compile: runTests +CPPFLAGS=-I . -I $(ACE_UNIT_PATH)/native -runTests: $(ACE_UNIT_FILES) TryExceptionHandling.c - $(CC) -fdiagnostics-show-option -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -o runTests *.c -# $(CC) -fdiagnostics-show-option -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -DACEUNIT_EMBEDDED -o runTests *.c +C_and_LD_FLAGS=-fprofile-arcs -test: runTests - ./runTests +CFLAGS=-fdiagnostics-show-option -std=$(CVERSION) -pedantic $(C_and_LD_FLAGS) -ftest-coverage -W -Wall -g -doc: $(FIXTURE_NAME).c $(FIXTURE_NAME).h $(ACE_UNIT_FILES) - doxygen +LDFLAGS=$(C_and_LD_FLAGS) +LINTFLAGS=-badflag -weak + +.PHONY : all +all: test + +TryExceptionHandling: $(OBJECTS) + +%.d: %.c + $(CPP) -M -MM -MG $(CPPFLAGS) $< | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' > $@ + coverage: test gcov *.c + +test: TryExceptionHandling + ./TryExceptionHandling + +.PHONY : clean +clean: + rm -f TryExceptionHandling *.gcov *.gcno *.gcda *.o *.d + +.PHONY : lint +lint: $(LINTOUTS) + +$(OBJECTS) $(OBJECTS:.o=.d): Makefile + +ifneq ($(MAKECMDGOALS),clean) +-include $(OBJECTS:.o=.d) +endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-12 08:55:37
|
Revision: 432 http://aceunit.svn.sourceforge.net/aceunit/?rev=432&view=rev Author: christianhujer Date: 2008-11-12 08:55:32 +0000 (Wed, 12 Nov 2008) Log Message: ----------- Added method to run multiple suites. Modified Paths: -------------- trunk/src/native/AceUnit.c Modified: trunk/src/native/AceUnit.c =================================================================== --- trunk/src/native/AceUnit.c 2008-11-12 08:50:36 UTC (rev 431) +++ trunk/src/native/AceUnit.c 2008-11-12 08:55:32 UTC (rev 432) @@ -198,5 +198,15 @@ #undef globalLog } +/** Runs all test cases from the supplied test suites. + * @param suites Test suites to run (NULL terminated). + */ +void runSuites(const TestSuite_t *const suites[]) { + while (NULL != *suites) { + runSuite(*suites); + suites++; + } +} + /* TODO: Add method to run specified test cases from a test fixture. * This should be done by a linear search through the list of test cases. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-12 08:50:42
|
Revision: 431 http://aceunit.svn.sourceforge.net/aceunit/?rev=431&view=rev Author: christianhujer Date: 2008-11-12 08:50:36 +0000 (Wed, 12 Nov 2008) Log Message: ----------- Bug in annotations.h: __STDC_VERSION__ queried was wrong. Fixed. Modified Paths: -------------- trunk/src/native/AceUnitAnnotations.h Modified: trunk/src/native/AceUnitAnnotations.h =================================================================== --- trunk/src/native/AceUnitAnnotations.h 2008-11-10 01:23:04 UTC (rev 430) +++ trunk/src/native/AceUnitAnnotations.h 2008-11-12 08:50:36 UTC (rev 431) @@ -89,7 +89,7 @@ * * The default group of a test is group 0 (zero). */ -#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 19901L) && defined(ACEUNIT_C99) +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && defined(ACEUNIT_C99) #define A_Group(...) ACEUNIT_ANNOTATION #else #define A_Group(group) @@ -101,7 +101,7 @@ * * Putting a fixture in a specific group overrides the default group for all tests in that fixture. */ -#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 19901L) && defined(ACEUNIT_C99) +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && defined(ACEUNIT_C99) #define A_FixtureGroup(...) #else #define A_FixtureGroup(group) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-10 01:23:06
|
Revision: 430 http://aceunit.svn.sourceforge.net/aceunit/?rev=430&view=rev Author: christianhujer Date: 2008-11-10 01:23:04 +0000 (Mon, 10 Nov 2008) Log Message: ----------- Improved release bash script. Modified Paths: -------------- release.sh Modified: release.sh =================================================================== --- release.sh 2008-11-09 23:06:29 UTC (rev 429) +++ release.sh 2008-11-10 01:23:04 UTC (rev 430) @@ -5,13 +5,14 @@ echo "Usage: ./release.sh <branch-name> <release-name> <email-address>" +basename=aceunit-$2 svn cp -m "Creating release tag $2 for branch $1." http://aceunit.svn.sourceforge.net/svnroot/aceunit/branches/$1 http://aceunit.svn.sourceforge.net/svnroot/aceunit/tags/$2 -svn export http://aceunit.svn.sourceforge.net/svnroot/aceunit/tags/$2 aceunit -tar cjvf aceunit-$2-src.tar.bz2 aceunit -tar czvf aceunit-$2-src.tar.gz aceunit -zip -r aceunit-$2-src.zip aceunit +svn export http://aceunit.svn.sourceforge.net/svnroot/aceunit/tags/$2 $basename +tar cjvf $basename-src.tar.bz2 aceunit +tar czvf $basename-src.tar.gz aceunit +zip -r $basename-src.zip aceunit (cd aceunit/src/java ; ant) ; mv aceunit/src/java/AceUnit.jar AceUnit-$2.jar -ftp -u ftp://anonymous:$3...@up.../incoming aceunit-$2-src.* AceUnit-$2.jar +ftp -u ftp://anonymous:$3...@up.../incoming $basename-src.* AceUnit-$2.jar echo echo "Upload done. Now create a new release at sourceforge and freshmeat, the mailing list and the forum." This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-09 23:06:32
|
Revision: 429 http://aceunit.svn.sourceforge.net/aceunit/?rev=429&view=rev Author: christianhujer Date: 2008-11-09 23:06:29 +0000 (Sun, 09 Nov 2008) Log Message: ----------- Added information about change compatibility. Modified Paths: -------------- trunk/ANOUNCEMENT Modified: trunk/ANOUNCEMENT =================================================================== --- trunk/ANOUNCEMENT 2008-11-09 23:05:06 UTC (rev 428) +++ trunk/ANOUNCEMENT 2008-11-09 23:06:29 UTC (rev 429) @@ -10,3 +10,6 @@ * The runner will optionally support ids for selecting suites, fixtures and test cases. * The group feature implementation will be completed. + +The changes will not affect tests. +The changes might affect invocations of the runner and the build environment. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-09 23:05:08
|
Revision: 428 http://aceunit.svn.sourceforge.net/aceunit/?rev=428&view=rev Author: christianhujer Date: 2008-11-09 23:05:06 +0000 (Sun, 09 Nov 2008) Log Message: ----------- Added ANOUNCEMENT information. Added Paths: ----------- trunk/ANOUNCEMENT Added: trunk/ANOUNCEMENT =================================================================== --- trunk/ANOUNCEMENT (rev 0) +++ trunk/ANOUNCEMENT 2008-11-09 23:05:06 UTC (rev 428) @@ -0,0 +1,12 @@ +ANOUNCEMENT + +In future versions of AceUnit, the following eventually incompatible changes +will be performed: +* ACEUNIT_EMBEDDED will be renamed. +* The id will change. + Old: normal id = string, ACEUNIT_EMBEDDED id = number. + New: normal id = number, ACEUNIT_EMBEDDED id = number. + The string will be separately available. +* The runner will optionally support ids for selecting suites, fixtures and + test cases. +* The group feature implementation will be completed. Property changes on: trunk/ANOUNCEMENT ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-08 00:19:22
|
Revision: 427 http://aceunit.svn.sourceforge.net/aceunit/?rev=427&view=rev Author: christianhujer Date: 2008-11-08 00:19:17 +0000 (Sat, 08 Nov 2008) Log Message: ----------- Improved splint support in tests. Modified Paths: -------------- trunk/src/native/test/Makefile trunk/src/native/test/basic/Makefile trunk/src/native/test/basicEmbedded/Makefile trunk/src/native/test/comment/Makefile trunk/src/native/test/longjmp/Makefile trunk/src/native/test/loop/Makefile trunk/src/native/test/recursive/Makefile trunk/src/native/test/twoFixtures/Makefile Modified: trunk/src/native/test/Makefile =================================================================== --- trunk/src/native/test/Makefile 2008-11-07 23:47:25 UTC (rev 426) +++ trunk/src/native/test/Makefile 2008-11-08 00:19:17 UTC (rev 427) @@ -16,6 +16,9 @@ .PHONY : clean clean: $(DIRS) +.PHONY : lint +lint: $(DIRS) + .PHONY : $(DIRS) $(DIRS): $(MAKE) -C $@ $(MAKECMDGOALS) Modified: trunk/src/native/test/basic/Makefile =================================================================== --- trunk/src/native/test/basic/Makefile 2008-11-07 23:47:25 UTC (rev 426) +++ trunk/src/native/test/basic/Makefile 2008-11-08 00:19:17 UTC (rev 427) @@ -28,7 +28,7 @@ LDFLAGS=$(C_and_LD_FLAGS) -LINTFLAGS=-badflag -nolib +LINTFLAGS=-badflag -weak .PHONY : all all: test Modified: trunk/src/native/test/basicEmbedded/Makefile =================================================================== --- trunk/src/native/test/basicEmbedded/Makefile 2008-11-07 23:47:25 UTC (rev 426) +++ trunk/src/native/test/basicEmbedded/Makefile 2008-11-08 00:19:17 UTC (rev 427) @@ -28,7 +28,7 @@ LDFLAGS=$(C_and_LD_FLAGS) -LINTFLAGS=-badflag -nolib +LINTFLAGS=-badflag -weak .PHONY : all all: test Modified: trunk/src/native/test/comment/Makefile =================================================================== --- trunk/src/native/test/comment/Makefile 2008-11-07 23:47:25 UTC (rev 426) +++ trunk/src/native/test/comment/Makefile 2008-11-08 00:19:17 UTC (rev 427) @@ -28,7 +28,7 @@ LDFLAGS=$(C_and_LD_FLAGS) -LINTFLAGS=-badflag -nolib +LINTFLAGS=-badflag -weak .PHONY : all all: test Modified: trunk/src/native/test/longjmp/Makefile =================================================================== --- trunk/src/native/test/longjmp/Makefile 2008-11-07 23:47:25 UTC (rev 426) +++ trunk/src/native/test/longjmp/Makefile 2008-11-08 00:19:17 UTC (rev 427) @@ -28,7 +28,7 @@ LDFLAGS=$(C_and_LD_FLAGS) -LINTFLAGS=-badflag -nolib +LINTFLAGS=-badflag -weak .PHONY : all all: test Modified: trunk/src/native/test/loop/Makefile =================================================================== --- trunk/src/native/test/loop/Makefile 2008-11-07 23:47:25 UTC (rev 426) +++ trunk/src/native/test/loop/Makefile 2008-11-08 00:19:17 UTC (rev 427) @@ -28,7 +28,7 @@ LDFLAGS=$(C_and_LD_FLAGS) -LINTFLAGS=-badflag -nolib +LINTFLAGS=-badflag -weak .PHONY : all all: test Modified: trunk/src/native/test/recursive/Makefile =================================================================== --- trunk/src/native/test/recursive/Makefile 2008-11-07 23:47:25 UTC (rev 426) +++ trunk/src/native/test/recursive/Makefile 2008-11-08 00:19:17 UTC (rev 427) @@ -37,7 +37,7 @@ LDFLAGS=$(C_and_LD_FLAGS) -LINTFLAGS=-badflag -nolib +LINTFLAGS=-badflag -weak .PHONY : all all: test Modified: trunk/src/native/test/twoFixtures/Makefile =================================================================== --- trunk/src/native/test/twoFixtures/Makefile 2008-11-07 23:47:25 UTC (rev 426) +++ trunk/src/native/test/twoFixtures/Makefile 2008-11-08 00:19:17 UTC (rev 427) @@ -29,7 +29,7 @@ LDFLAGS=$(C_and_LD_FLAGS) -LINTFLAGS=-badflag -nolib +LINTFLAGS=-badflag -weak .PHONY : all all: test This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-07 23:47:31
|
Revision: 426 http://aceunit.svn.sourceforge.net/aceunit/?rev=426&view=rev Author: christianhujer Date: 2008-11-07 23:47:25 +0000 (Fri, 07 Nov 2008) Log Message: ----------- Documentation about types. Modified Paths: -------------- trunk/src/native/AceUnit.h Modified: trunk/src/native/AceUnit.h =================================================================== --- trunk/src/native/AceUnit.h 2008-11-07 23:46:55 UTC (rev 425) +++ trunk/src/native/AceUnit.h 2008-11-07 23:47:25 UTC (rev 426) @@ -180,6 +180,16 @@ * You may turn <code>A_Loop</code> support on and off during compile time without having to rerun the generator. * </dd> * </dl> + * + * @warning AceUnit can define types foritself for exotic compilation environments where standard includes are not available or shall not be used. + * But though AceUnit can do that, this is strongly deprecated. + * This will certainly cause a lot of problems: + * - AceUnit "guesses" the types by assuming <code>short int</code> to be 16 bit and <code>long int</code> to be 32 bit. + * Especially about the second assumption AceUnit could be wrong. + * - Tools like lint are very picky about type definitions. + * For lint it makes a difference if a type of size 16 bit is defiend as <code>short int</code> or <code>int</code>. + * For sure lint will find something to complain about if you let AceUnit define its own types instead of providing consistent types from your compilation environment. + * * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @file AceUnit.h */ @@ -227,6 +237,11 @@ /** Replacement for stdint.h uint32_t in case stdint.h is not available. */ typedef unsigned long int uint32_t; #endif +#ifndef _SIZE_T_DEFINED +#ifndef _SIZE_T_DEFINED_ +typedef long unsigned int size_t; +#endif +#endif #ifndef NULL /** Replacement for stddef.h NULL in case stddef.h is not available. */ #if defined(__cplusplus) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-07 23:46:59
|
Revision: 425 http://aceunit.svn.sourceforge.net/aceunit/?rev=425&view=rev Author: christianhujer Date: 2008-11-07 23:46:55 +0000 (Fri, 07 Nov 2008) Log Message: ----------- Made hosted environment dependent code compile conditionally. Modified Paths: -------------- trunk/src/native/MiniRamLogger.c Modified: trunk/src/native/MiniRamLogger.c =================================================================== --- trunk/src/native/MiniRamLogger.c 2008-11-02 16:49:08 UTC (rev 424) +++ trunk/src/native/MiniRamLogger.c 2008-11-07 23:46:55 UTC (rev 425) @@ -32,16 +32,17 @@ * @file MiniRamLogger.c */ -/* TODO: Get rid of these includes. */ -#include <stdio.h> -#include <string.h> - #include "AceUnit.h" #include "AceUnitLogging.h" #ifndef ACEUNIT_EMBEDDED #error "MiniRamLogger can only be used for ACEUNIT_EMBEDDED." #endif +#ifdef ACEUNIT_MINIRAMLOGGER_SAVE +#include <stdio.h> +#include <string.h> +#endif + #ifndef ACEUNIT_MINIRAM_LOGGER_BUFSIZE /** The size of the buffer that's used for the Mini Ram Logger. */ #define ACEUNIT_MINIRAM_LOGGER_BUFSIZE 32 @@ -66,6 +67,7 @@ data[elementCount++] = *recentError; } +#ifdef ACEUNIT_MINIRAMLOGGER_SAVE /** Writes contents of the Mini Ram Logger to a file. * @param file File to write to. */ @@ -79,6 +81,7 @@ /* Now write the data. */ fwrite(data, sizeof(AssertionError_t), elementCount, file); } +#endif /** This Logger. */ AceUnitNewLogger(MiniRamLogger, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-02 16:49:15
|
Revision: 424 http://aceunit.svn.sourceforge.net/aceunit/?rev=424&view=rev Author: christianhujer Date: 2008-11-02 16:49:08 +0000 (Sun, 02 Nov 2008) Log Message: ----------- Fixed bug in fixture names from previous commit. Modified Paths: -------------- trunk/src/java/src/prj/net/sf/aceunit/Fixture.java Modified: trunk/src/java/src/prj/net/sf/aceunit/Fixture.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/Fixture.java 2008-11-02 16:47:14 UTC (rev 423) +++ trunk/src/java/src/prj/net/sf/aceunit/Fixture.java 2008-11-02 16:49:08 UTC (rev 424) @@ -161,7 +161,7 @@ public String getFixture(@NotNull final String basename) { final Formatter out = new Formatter(); out.format("/** This fixture. */%n"); - out.format("const TestFixture_t %s = {%n", fixtureName); + out.format("const TestFixture_t %sFixture = {%n", fixtureName); out.format(" A_FIXTURE_ID,%n"); out.format("#ifdef ACEUNIT_SUITES%n"); out.format(" NULL,%n"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-02 16:47:17
|
Revision: 423 http://aceunit.svn.sourceforge.net/aceunit/?rev=423&view=rev Author: christianhujer Date: 2008-11-02 16:47:14 +0000 (Sun, 02 Nov 2008) Log Message: ----------- Fixed dangling suite references to test cases. Modified Paths: -------------- trunk/src/java/src/prj/net/sf/aceunit/Fixture.java trunk/src/java/src/prj/net/sf/aceunit/Pckg.java trunk/src/java/src/prj/net/sf/aceunit/Suite.java Modified: trunk/src/java/src/prj/net/sf/aceunit/Fixture.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/Fixture.java 2008-11-01 11:46:23 UTC (rev 422) +++ trunk/src/java/src/prj/net/sf/aceunit/Fixture.java 2008-11-02 16:47:14 UTC (rev 423) @@ -71,6 +71,9 @@ /** All method lists for used methods for easy iteration. */ private final List<MethodList> usedMethodLists = Arrays.asList(testMethods, beforeMethods, afterMethods, beforeClassMethods, afterClassMethods); + /** The name of this fixture. */ + private final String fixtureName; + /** * Creates a Fixture with the specified id. * @@ -79,18 +82,9 @@ * @throws IOException In case of I/O problems. */ public Fixture(final int id, @NotNull final File file) throws IOException { - this(id, SourceFiles.readSourceWithoutComments(file)); - } - - /** - * Creates a Fixture with the specified id. - * - * @param id The id of this Fixture. - * @param sourceCode C source code for this fixture. - */ - public Fixture(final int id, @NotNull final String sourceCode) { super(id); - findMethods(sourceCode); + findMethods(SourceFiles.readSourceWithoutComments(file)); + this.fixtureName = file.getName().replaceAll("\\.c$", ""); } /** @@ -167,7 +161,7 @@ public String getFixture(@NotNull final String basename) { final Formatter out = new Formatter(); out.format("/** This fixture. */%n"); - out.format("const TestFixture_t %sFixture = {%n", basename); + out.format("const TestFixture_t %s = {%n", fixtureName); out.format(" A_FIXTURE_ID,%n"); out.format("#ifdef ACEUNIT_SUITES%n"); out.format(" NULL,%n"); @@ -201,6 +195,11 @@ return out.toString(); } + /** @inheritDoc} */ + @Override public String getGlobalVariablename() { + return fixtureName + "Fixture"; + } + /** * Returns a String with the source code for the test method ids. * Modified: trunk/src/java/src/prj/net/sf/aceunit/Pckg.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/Pckg.java 2008-11-01 11:46:23 UTC (rev 422) +++ trunk/src/java/src/prj/net/sf/aceunit/Pckg.java 2008-11-02 16:47:14 UTC (rev 423) @@ -88,12 +88,12 @@ out.format("#include \"AceUnit.h\"%n"); out.format("%n"); for (final Suite suite : suites) { - out.format("extern TestSuite_t suite%d;", suite.getId()); + out.format("extern TestSuite_t %s;", suite.getGlobalVariablename()); } out.format("%n"); out.format("const TestSuite_t *suitesOf%d[] = {%n", getId()); for (final Suite suite : suites) { - out.format(" &suite%d,%n", suite.getId()); + out.format(" &%s,%n", suite.getGlobalVariablename()); } out.format(" NULL%n"); out.format("};%n"); Modified: trunk/src/java/src/prj/net/sf/aceunit/Suite.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/Suite.java 2008-11-01 11:46:23 UTC (rev 422) +++ trunk/src/java/src/prj/net/sf/aceunit/Suite.java 2008-11-02 16:47:14 UTC (rev 423) @@ -60,6 +60,14 @@ } /** + * Returns the global variable name of this Suite. + * @return The global variable name of this Suite. + */ + public String getGlobalVariablename() { + return "suite" + getId(); + } + + /** * Returns whether this suite contains tests. * * @return <code>true</code> if this fiture contains test cases, otherwise <code>false</code>. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-01 12:22:16
|
Revision: 421 http://aceunit.svn.sourceforge.net/aceunit/?rev=421&view=rev Author: christianhujer Date: 2008-11-01 11:42:38 +0000 (Sat, 01 Nov 2008) Log Message: ----------- Fixed bug in Makefiles: generated Suite.c was not deleted in clean target. Modified Paths: -------------- trunk/src/native/test/basic/Makefile trunk/src/native/test/basicEmbedded/Makefile trunk/src/native/test/comment/Makefile trunk/src/native/test/longjmp/Makefile trunk/src/native/test/loop/Makefile trunk/src/native/test/twoFixtures/Makefile Modified: trunk/src/native/test/basic/Makefile =================================================================== --- trunk/src/native/test/basic/Makefile 2008-11-01 11:40:01 UTC (rev 420) +++ trunk/src/native/test/basic/Makefile 2008-11-01 11:42:38 UTC (rev 421) @@ -49,7 +49,7 @@ .PHONY : clean clean: - rm -f $(addsuffix .h, $(FIXTURE_NAMES)) RunTests *.gcov *.gcno *.gcda *.o *.d Suite.h + rm -f $(addsuffix .h, $(FIXTURE_NAMES)) RunTests *.gcov *.gcno *.gcda *.o *.d Suite.c .PHONY : lint lint: $(LINTOUTS) Modified: trunk/src/native/test/basicEmbedded/Makefile =================================================================== --- trunk/src/native/test/basicEmbedded/Makefile 2008-11-01 11:40:01 UTC (rev 420) +++ trunk/src/native/test/basicEmbedded/Makefile 2008-11-01 11:42:38 UTC (rev 421) @@ -49,7 +49,7 @@ .PHONY : clean clean: - rm -f $(addsuffix .h, $(FIXTURE_NAMES)) RunTests *.gcov *.gcno *.gcda *.o *.d Suite.h + rm -f $(addsuffix .h, $(FIXTURE_NAMES)) RunTests *.gcov *.gcno *.gcda *.o *.d Suite.c .PHONY : lint lint: $(LINTOUTS) Modified: trunk/src/native/test/comment/Makefile =================================================================== --- trunk/src/native/test/comment/Makefile 2008-11-01 11:40:01 UTC (rev 420) +++ trunk/src/native/test/comment/Makefile 2008-11-01 11:42:38 UTC (rev 421) @@ -49,7 +49,7 @@ .PHONY : clean clean: - rm -f $(addsuffix .h, $(FIXTURE_NAMES)) RunTests *.gcov *.gcno *.gcda *.o *.d Suite.h + rm -f $(addsuffix .h, $(FIXTURE_NAMES)) RunTests *.gcov *.gcno *.gcda *.o *.d Suite.c .PHONY : lint lint: $(LINTOUTS) Modified: trunk/src/native/test/longjmp/Makefile =================================================================== --- trunk/src/native/test/longjmp/Makefile 2008-11-01 11:40:01 UTC (rev 420) +++ trunk/src/native/test/longjmp/Makefile 2008-11-01 11:42:38 UTC (rev 421) @@ -49,7 +49,7 @@ .PHONY : clean clean: - rm -f $(addsuffix .h, $(FIXTURE_NAMES)) RunTests *.gcov *.gcno *.gcda *.o *.d Suite.h + rm -f $(addsuffix .h, $(FIXTURE_NAMES)) RunTests *.gcov *.gcno *.gcda *.o *.d Suite.c .PHONY : lint lint: $(LINTOUTS) Modified: trunk/src/native/test/loop/Makefile =================================================================== --- trunk/src/native/test/loop/Makefile 2008-11-01 11:40:01 UTC (rev 420) +++ trunk/src/native/test/loop/Makefile 2008-11-01 11:42:38 UTC (rev 421) @@ -49,7 +49,7 @@ .PHONY : clean clean: - rm -f $(addsuffix .h, $(FIXTURE_NAMES)) RunTests *.gcov *.gcno *.gcda *.o *.d Suite.h + rm -f $(addsuffix .h, $(FIXTURE_NAMES)) RunTests *.gcov *.gcno *.gcda *.o *.d Suite.c .PHONY : lint lint: $(LINTOUTS) Modified: trunk/src/native/test/twoFixtures/Makefile =================================================================== --- trunk/src/native/test/twoFixtures/Makefile 2008-11-01 11:40:01 UTC (rev 420) +++ trunk/src/native/test/twoFixtures/Makefile 2008-11-01 11:42:38 UTC (rev 421) @@ -50,7 +50,7 @@ .PHONY : clean clean: - rm -f $(addsuffix .h, $(FIXTURE_NAMES)) RunTests *.gcov *.gcno *.gcda *.o *.d Suite.h + rm -f $(addsuffix .h, $(FIXTURE_NAMES)) RunTests *.gcov *.gcno *.gcda *.o *.d Suite.c .PHONY : lint lint: $(LINTOUTS) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-01 12:03:56
|
Revision: 420 http://aceunit.svn.sourceforge.net/aceunit/?rev=420&view=rev Author: christianhujer Date: 2008-11-01 11:40:01 +0000 (Sat, 01 Nov 2008) Log Message: ----------- Improved Makefiles to make the C version explicitely configurable. Modified Paths: -------------- trunk/src/native/test/basic/Makefile trunk/src/native/test/basicEmbedded/Makefile trunk/src/native/test/comment/Makefile trunk/src/native/test/longjmp/Makefile trunk/src/native/test/loop/Makefile trunk/src/native/test/recursive/Makefile trunk/src/native/test/twoFixtures/Makefile Modified: trunk/src/native/test/basic/Makefile =================================================================== --- trunk/src/native/test/basic/Makefile 2008-10-31 21:13:28 UTC (rev 419) +++ trunk/src/native/test/basic/Makefile 2008-11-01 11:40:01 UTC (rev 420) @@ -1,5 +1,7 @@ LOGGER=FullPlainLogger FIXTURE_NAMES=AceUnitTest +CVERSION=c89 + ACE_UNIT_PATH=../../.. ACE_UNIT_JAVA_SRC=$(shell find $(ACE_UNIT_PATH)/java/src -name "*.java") $(shell java -jar $(ACE_UNIT_PATH)/java/AceUnit.jar .) @@ -22,7 +24,7 @@ C_and_LD_FLAGS=-fprofile-arcs -CFLAGS=-fdiagnostics-show-option -std=c89 -pedantic $(C_and_LD_FLAGS) -ftest-coverage -W -Wall -g +CFLAGS=-fdiagnostics-show-option -std=$(CVERSION) -pedantic $(C_and_LD_FLAGS) -ftest-coverage -W -Wall -g LDFLAGS=$(C_and_LD_FLAGS) Modified: trunk/src/native/test/basicEmbedded/Makefile =================================================================== --- trunk/src/native/test/basicEmbedded/Makefile 2008-10-31 21:13:28 UTC (rev 419) +++ trunk/src/native/test/basicEmbedded/Makefile 2008-11-01 11:40:01 UTC (rev 420) @@ -1,5 +1,7 @@ LOGGER=MiniRamLogger FIXTURE_NAMES=AceUnitTest +CVERSION=c89 + ACE_UNIT_PATH=../../.. ACE_UNIT_JAVA_SRC=$(shell find $(ACE_UNIT_PATH)/java/src -name "*.java") $(shell java -jar $(ACE_UNIT_PATH)/java/AceUnit.jar .) @@ -22,7 +24,7 @@ C_and_LD_FLAGS=-fprofile-arcs -CFLAGS=-fdiagnostics-show-option -std=c89 -pedantic $(C_and_LD_FLAGS) -ftest-coverage -W -Wall -g +CFLAGS=-fdiagnostics-show-option -std=$(CVERSION) -pedantic $(C_and_LD_FLAGS) -ftest-coverage -W -Wall -g LDFLAGS=$(C_and_LD_FLAGS) Modified: trunk/src/native/test/comment/Makefile =================================================================== --- trunk/src/native/test/comment/Makefile 2008-10-31 21:13:28 UTC (rev 419) +++ trunk/src/native/test/comment/Makefile 2008-11-01 11:40:01 UTC (rev 420) @@ -1,5 +1,7 @@ LOGGER=FullPlainLogger FIXTURE_NAMES=CommentTest +CVERSION=c99 + ACE_UNIT_PATH=../../.. ACE_UNIT_JAVA_SRC=$(shell find $(ACE_UNIT_PATH)/java/src -name "*.java") $(shell java -jar $(ACE_UNIT_PATH)/java/AceUnit.jar .) @@ -22,7 +24,7 @@ C_and_LD_FLAGS=-fprofile-arcs -CFLAGS=-fdiagnostics-show-option -std=c99 -pedantic $(C_and_LD_FLAGS) -ftest-coverage -W -Wall -g +CFLAGS=-fdiagnostics-show-option -std=$(CVERSION) -pedantic $(C_and_LD_FLAGS) -ftest-coverage -W -Wall -g LDFLAGS=$(C_and_LD_FLAGS) Modified: trunk/src/native/test/longjmp/Makefile =================================================================== --- trunk/src/native/test/longjmp/Makefile 2008-10-31 21:13:28 UTC (rev 419) +++ trunk/src/native/test/longjmp/Makefile 2008-11-01 11:40:01 UTC (rev 420) @@ -1,5 +1,7 @@ LOGGER=FullPlainLogger FIXTURE_NAMES=LongJmpTest +CVERSION=c89 + ACE_UNIT_PATH=../../.. ACE_UNIT_JAVA_SRC=$(shell find $(ACE_UNIT_PATH)/java/src -name "*.java") $(shell java -jar $(ACE_UNIT_PATH)/java/AceUnit.jar .) @@ -22,7 +24,7 @@ C_and_LD_FLAGS=-fprofile-arcs -CFLAGS=-fdiagnostics-show-option -std=c89 -pedantic $(C_and_LD_FLAGS) -ftest-coverage -W -Wall -g +CFLAGS=-fdiagnostics-show-option -std=$(CVERSION) -pedantic $(C_and_LD_FLAGS) -ftest-coverage -W -Wall -g LDFLAGS=$(C_and_LD_FLAGS) Modified: trunk/src/native/test/loop/Makefile =================================================================== --- trunk/src/native/test/loop/Makefile 2008-10-31 21:13:28 UTC (rev 419) +++ trunk/src/native/test/loop/Makefile 2008-11-01 11:40:01 UTC (rev 420) @@ -1,5 +1,7 @@ LOGGER=FullPlainLogger FIXTURE_NAMES=AceUnitLoopTest +CVERSION=c89 + ACE_UNIT_PATH=../../.. ACE_UNIT_JAVA_SRC=$(shell find $(ACE_UNIT_PATH)/java/src -name "*.java") $(shell java -jar $(ACE_UNIT_PATH)/java/AceUnit.jar .) @@ -22,7 +24,7 @@ C_and_LD_FLAGS=-fprofile-arcs -CFLAGS=-fdiagnostics-show-option -std=c89 -pedantic $(C_and_LD_FLAGS) -ftest-coverage -W -Wall -g +CFLAGS=-fdiagnostics-show-option -std=$(CVERSION) -pedantic $(C_and_LD_FLAGS) -ftest-coverage -W -Wall -g LDFLAGS=$(C_and_LD_FLAGS) Modified: trunk/src/native/test/recursive/Makefile =================================================================== --- trunk/src/native/test/recursive/Makefile 2008-10-31 21:13:28 UTC (rev 419) +++ trunk/src/native/test/recursive/Makefile 2008-11-01 11:40:01 UTC (rev 420) @@ -1,5 +1,7 @@ LOGGER=FullPlainLogger FIXTURE_NAME=. +CVERSION=c89 + ACE_UNIT_PATH=../../.. ACE_UNIT_FILES=AceUnit.c AceUnit.h AceUnitData.c AceUnitData.h AceUnitAnnotations.h AceUnitLogging.h $(LOGGER).c AceUnit.jar ACE_UNIT_JAVA_SRC=$(shell find $(ACE_UNIT_PATH)/java/src -name "*.java") @@ -22,7 +24,7 @@ C_and_LD_FLAGS=-fprofile-arcs -CFLAGS=-fdiagnostics-show-option -std=c89 -pedantic $(C_and_LD_FLAGS) -ftest-coverage -W -Wall -g +CFLAGS=-fdiagnostics-show-option -std=$(CVERSION) -pedantic $(C_and_LD_FLAGS) -ftest-coverage -W -Wall -g SOURCES=$(sort $(shell find . -name "*.c")) SUITES=$(shell find . -name "Suite.c") Modified: trunk/src/native/test/twoFixtures/Makefile =================================================================== --- trunk/src/native/test/twoFixtures/Makefile 2008-10-31 21:13:28 UTC (rev 419) +++ trunk/src/native/test/twoFixtures/Makefile 2008-11-01 11:40:01 UTC (rev 420) @@ -1,5 +1,7 @@ LOGGER=FullPlainLogger FIXTURE_NAMES=Fixture1 Fixture2 +CVERSION=c89 + ACE_UNIT_PATH=../../.. ACE_UNIT_JAVA_SRC=$(shell find $(ACE_UNIT_PATH)/java/src -name "*.java") $(shell java -jar $(ACE_UNIT_PATH)/java/AceUnit.jar .) @@ -23,7 +25,7 @@ C_and_LD_FLAGS=-fprofile-arcs -CFLAGS=-fdiagnostics-show-option -std=c89 -pedantic $(C_and_LD_FLAGS) -ftest-coverage -W -Wall -g +CFLAGS=-fdiagnostics-show-option -std=$(CVERSION) -pedantic $(C_and_LD_FLAGS) -ftest-coverage -W -Wall -g LDFLAGS=$(C_and_LD_FLAGS) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-01 12:03:48
|
Revision: 422 http://aceunit.svn.sourceforge.net/aceunit/?rev=422&view=rev Author: christianhujer Date: 2008-11-01 11:46:23 +0000 (Sat, 01 Nov 2008) Log Message: ----------- Made unfinished JUnitXmlLogger issue fewer warnings. Modified Paths: -------------- trunk/src/native/JUnitXmlLogger.c Modified: trunk/src/native/JUnitXmlLogger.c =================================================================== --- trunk/src/native/JUnitXmlLogger.c 2008-11-01 11:42:38 UTC (rev 421) +++ trunk/src/native/JUnitXmlLogger.c 2008-11-01 11:46:23 UTC (rev 422) @@ -167,11 +167,11 @@ int i; FILE *localFile; /* <testsuite errors="0" failures="0" hostname="riedquat" id="1" name="BasicCommandTest" package="test.net.sf.japi.io.args" tests="10" time="0.105" timestamp="2007-11-06T20:15:24"> */ - fprintf(globalFile, " <testsuite errors=\"%d\" failures=\"%d\" hostname=\"%s\" id=\"%d\" name=\"%s\" package=\"%s\" tests=\"%d\" time=\"%f\" timestamp=\"%s\">\n", 0/*TODO*/, 0/*TODO*/, globalInfo.hostname, 0/*TODO*/, NULL/*TODO*/, NULL/*TODO*/, 0/*TODO*/, 0.0/*TODO*/, NULL/*TODO*/); + fprintf(globalFile, " <testsuite errors=\"%d\" failures=\"%d\" hostname=\"%s\" id=\"%d\" name=\"%s\" package=\"%s\" tests=\"%d\" time=\"%f\" timestamp=\"%s\">\n", 0/*TODO*/, 0/*TODO*/, globalInfo.hostname, 0/*TODO*/, ""/*TODO*/, ""/*TODO*/, 0/*TODO*/, 0.0/*TODO*/, ""/*TODO*/); printEnvAsProperties(globalFile); for (i = 0; i < suiteInfo.tests; i++) { /*<testcase classname="test.net.sf.japi.io.args.BasicCommandTest" name="testHelp" time="0.0090" />*/ - fprintf(globalFile, " <testcase classname=\"%s\" name=\"%s\" time=\"%f\" />\n", NULL/*TODO*/, NULL/*TODO*/, 0.0/*TODO*/); + fprintf(globalFile, " <testcase classname=\"%s\" name=\"%s\" time=\"%f\" />\n", ""/*TODO*/, ""/*TODO*/, 0.0/*TODO*/); } fprintf(globalFile, " <system-out/>\n"); fprintf(globalFile, " <system-err/>\n"); @@ -181,11 +181,11 @@ localFile = fopen("TEST-test.net.sf.japi.io.args.ArgParserTest.xml", "w"); /* TODO: configure filename */ /* <testsuite errors="0" failures="0" hostname="riedquat" name="test.net.sf.japi.io.args.ArgParserTest" tests="19" time="3.463" timestamp="2007-11-06T20:15:21"> */ fprintf(localFile, "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"); - fprintf(localFile, "<testsuite errors=\"%d\" failures=\"%d\" hostname=\"%s\" name=\"%s\" tests=\"%d\" time=\"%f\" timestamp=\"%s\">\n", 0/*TODO*/, 0/*TODO*/, globalInfo.hostname, NULL/*TODO*/, 0/*TODO*/, 0.0/*TODO*/, NULL/*TODO*/); + fprintf(localFile, "<testsuite errors=\"%d\" failures=\"%d\" hostname=\"%s\" name=\"%s\" tests=\"%d\" time=\"%f\" timestamp=\"%s\">\n", 0/*TODO*/, 0/*TODO*/, globalInfo.hostname, ""/*TODO*/, 0/*TODO*/, 0.0/*TODO*/, ""/*TODO*/); fprintf(localFile, " <properties/>\n"); /* TODO: encode environment as properties? */ for (i = 0; i < suiteInfo.tests; i++) { /* <testcase classname="test.net.sf.japi.io.args.ArgParserTest" name="testSimpleParseAndRun" time="0.0080" /> */ - fprintf(localFile, " <testcase classname=\"%s\" name=\"%s\" time=\"%f\" />\n", NULL/*TODO*/, NULL/*TODO*/, 0.0/*TODO*/); + fprintf(localFile, " <testcase classname=\"%s\" name=\"%s\" time=\"%f\" />\n", ""/*TODO*/, ""/*TODO*/, 0.0/*TODO*/); } fprintf(localFile, " <system-out/>\n"); fprintf(localFile, " <system-err/>\n"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-10-31 21:13:34
|
Revision: 419 http://aceunit.svn.sourceforge.net/aceunit/?rev=419&view=rev Author: christianhujer Date: 2008-10-31 21:13:28 +0000 (Fri, 31 Oct 2008) Log Message: ----------- Changed Makefile to delete generated suite files. Modified Paths: -------------- trunk/src/native/test/recursive/Makefile Modified: trunk/src/native/test/recursive/Makefile =================================================================== --- trunk/src/native/test/recursive/Makefile 2008-10-28 07:51:02 UTC (rev 418) +++ trunk/src/native/test/recursive/Makefile 2008-10-31 21:13:28 UTC (rev 419) @@ -24,9 +24,10 @@ CFLAGS=-fdiagnostics-show-option -std=c89 -pedantic $(C_and_LD_FLAGS) -ftest-coverage -W -Wall -g -SOURCES=$(sort $(shell find . -name "*.c") $(filter %.c,$(addprefix ./,$(ACE_UNIT_FILES)))) +SOURCES=$(sort $(shell find . -name "*.c")) +SUITES=$(shell find . -name "Suite.c") OBJECTS+=$(patsubst %.c,%.o,$(SOURCES)) -HEADERS=$(patsubst %.c,%.h,$(shell find . -name "*.c")) $(shell find . -name "Suite.h") +HEADERS=$(SOURCES:.c=.h) DEPENDS=$(patsubst %.o,%.d,$(OBJECTS)) GCOV=$(patsubst %.o,%.gcov,$(OBJECTS)) GCNO=$(patsubst %.o,%.gcno,$(OBJECTS)) @@ -55,7 +56,7 @@ .PHONY : clean clean: - rm -f $(OBJECTS) $(HEADERS) $(DEPENDS) RunTests $(GCOV) $(GCNO) $(GCDA) + rm -f $(OBJECTS) $(HEADERS) $(DEPENDS) RunTests $(GCOV) $(GCNO) $(GCDA) $(SUITES) .PHONY : lint lint: $(LINTOUTS) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-10-28 07:51:07
|
Revision: 418 http://aceunit.svn.sourceforge.net/aceunit/?rev=418&view=rev Author: christianhujer Date: 2008-10-28 07:51:02 +0000 (Tue, 28 Oct 2008) Log Message: ----------- Made Suite.c compilable. Modified Paths: -------------- trunk/src/java/src/prj/net/sf/aceunit/Pckg.java Modified: trunk/src/java/src/prj/net/sf/aceunit/Pckg.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/Pckg.java 2008-10-28 07:50:42 UTC (rev 417) +++ trunk/src/java/src/prj/net/sf/aceunit/Pckg.java 2008-10-28 07:51:02 UTC (rev 418) @@ -81,10 +81,21 @@ out.format(" * @file %s.h%n", basename); out.format(" */%n"); out.format("%n"); - out.format("const TestSuite_t *suites = {%n"); + out.format("#ifdef ACEUNIT_CONFIG_FILE%n"); + out.format("#include ACEUNIT_CONFIG_FILE%n"); + out.format("#endif%n"); + out.format("%n"); + out.format("#include \"AceUnit.h\"%n"); + out.format("%n"); for (final Suite suite : suites) { - out.format(" suite%d,%n", suite.getId()); + out.format("extern TestSuite_t suite%d;", suite.getId()); } + out.format("%n"); + out.format("const TestSuite_t *suitesOf%d[] = {%n", getId()); + for (final Suite suite : suites) { + out.format(" &suite%d,%n", suite.getId()); + } + out.format(" NULL%n"); out.format("};%n"); out.format("%n"); out.format("const TestSuite_t suite%d = {%n", getId()); @@ -93,7 +104,7 @@ out.format("#else%n"); out.format(" \"%s\",%n", basename); out.format("#endif%n"); - out.format(" suites%n"); + out.format(" suitesOf%d%n", getId()); out.format("};%n"); return out.toString(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-10-28 07:50:47
|
Revision: 417 http://aceunit.svn.sourceforge.net/aceunit/?rev=417&view=rev Author: christianhujer Date: 2008-10-28 07:50:42 +0000 (Tue, 28 Oct 2008) Log Message: ----------- Change auto suite file from Suite.h to Suite.c. Modified Paths: -------------- trunk/src/java/src/prj/net/sf/aceunit/GenTest.java Modified: trunk/src/java/src/prj/net/sf/aceunit/GenTest.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/GenTest.java 2008-10-27 08:29:16 UTC (rev 416) +++ trunk/src/java/src/prj/net/sf/aceunit/GenTest.java 2008-10-28 07:50:42 UTC (rev 417) @@ -145,7 +145,7 @@ containedFixture |= performFixture(base, pckg, fixtureFile); } if (containedFixture) { - final File hFile = new File(pckgDir, "Suite.h"); + final File hFile = new File(pckgDir, "Suite.c"); final String hSource = pckg.getCode("foo"); SourceFiles.writeIfChanged(hFile, hSource, force); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-10-27 08:31:57
|
Revision: 416 http://aceunit.svn.sourceforge.net/aceunit/?rev=416&view=rev Author: christianhujer Date: 2008-10-27 08:29:16 +0000 (Mon, 27 Oct 2008) Log Message: ----------- Improved verification - now the number of executed tests is verified. Modified Paths: -------------- trunk/src/native/test/recursive/RunTests.c Modified: trunk/src/native/test/recursive/RunTests.c =================================================================== --- trunk/src/native/test/recursive/RunTests.c 2008-10-27 07:43:58 UTC (rev 415) +++ trunk/src/native/test/recursive/RunTests.c 2008-10-27 08:29:16 UTC (rev 416) @@ -53,6 +53,11 @@ NULL }; +/** The number of test cases contained in this fixture. + * This is used to verify that the number of executed test cases is correct. + */ +#define TEST_CASES_FOR_VERIFICATION 8 + /** The number of failed test cases. */ extern uint16_t testCaseFailureCount; @@ -73,5 +78,9 @@ fprintf(stderr, "Error: %d test cases failed.\n", (int) runnerData->testCaseFailureCount); retVal = 1; } + if (runnerData->testCaseCount != TEST_CASES_FOR_VERIFICATION) { + fprintf(stderr, "Test Cases: %d but expected %d\n", runnerData->testCaseCount, TEST_CASES_FOR_VERIFICATION); + retVal = 1; + } return retVal; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-10-27 07:44:02
|
Revision: 415 http://aceunit.svn.sourceforge.net/aceunit/?rev=415&view=rev Author: christianhujer Date: 2008-10-27 07:43:58 +0000 (Mon, 27 Oct 2008) Log Message: ----------- Improved test complexity. Modified Paths: -------------- trunk/src/native/test/recursive/RunTests.c Added Paths: ----------- trunk/src/native/test/recursive/C2/C2Mod1.c trunk/src/native/test/recursive/C2/C2Mod2.c trunk/src/native/test/recursive/C2/tests/Mod1/ trunk/src/native/test/recursive/C2/tests/Mod1/C2Mod1Test.c trunk/src/native/test/recursive/C2/tests/Mod2/ trunk/src/native/test/recursive/C2/tests/Mod2/C2Mod2Test.c Removed Paths: ------------- trunk/src/native/test/recursive/C2/tests/Mod1/C1Mod1Test.c trunk/src/native/test/recursive/C2/tests/Mod2/C1Mod2Test.c Copied: trunk/src/native/test/recursive/C2/C2Mod1.c (from rev 414, trunk/src/native/test/recursive/C1/C1Mod1.c) =================================================================== --- trunk/src/native/test/recursive/C2/C2Mod1.c (rev 0) +++ trunk/src/native/test/recursive/C2/C2Mod1.c 2008-10-27 07:43:58 UTC (rev 415) @@ -0,0 +1,41 @@ +/* Copyright (c) 2007, Christian Hujer + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the AceUnit developers nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** Recursive AceUnit Test, Testling 1 or C1. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @file C1Mod1.c + */ + +#include <stdio.h> + +void C2Mod1Function1() { + printf("Expected message: C2Mod1Function1.\n"); +} + +void C2Mod1Function2() { + printf("Expected message: C2Mod1Function2.\n"); +} Property changes on: trunk/src/native/test/recursive/C2/C2Mod1.c ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:mergeinfo + Added: svn:eol-style + native Copied: trunk/src/native/test/recursive/C2/C2Mod2.c (from rev 414, trunk/src/native/test/recursive/C1/C1Mod2.c) =================================================================== --- trunk/src/native/test/recursive/C2/C2Mod2.c (rev 0) +++ trunk/src/native/test/recursive/C2/C2Mod2.c 2008-10-27 07:43:58 UTC (rev 415) @@ -0,0 +1,41 @@ +/* Copyright (c) 2007, Christian Hujer + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the AceUnit developers nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** Recursive AceUnit Test, Testling 1 or C1. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @file C1Mod2.c + */ + +#include <stdio.h> + +void C2Mod2Function1() { + printf("Expected message: C2Mod2Function1.\n"); +} + +void C2Mod2Function2() { + printf("Expected message: C2Mod2Function2.\n"); +} Property changes on: trunk/src/native/test/recursive/C2/C2Mod2.c ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:mergeinfo + Added: svn:eol-style + native Property changes on: trunk/src/native/test/recursive/C2/tests/Mod1 ___________________________________________________________________ Added: svn:mergeinfo + Deleted: trunk/src/native/test/recursive/C2/tests/Mod1/C1Mod1Test.c =================================================================== --- trunk/src/native/test/recursive/C1/tests/Mod1/C1Mod1Test.c 2008-10-19 22:25:02 UTC (rev 414) +++ trunk/src/native/test/recursive/C2/tests/Mod1/C1Mod1Test.c 2008-10-27 07:43:58 UTC (rev 415) @@ -1,43 +0,0 @@ -/* Copyright (c) 2007, Christian Hujer - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the AceUnit developers nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** Recursive AceUnit Test, Test C1Mod1Test. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @file C1Mod1Test.c - */ - -#include "C1/tests/Mod1/C1Mod1Test.h" - -A_Test void testC1Mod1Function1() { - extern void C1Mod1Function1(); - C1Mod1Function1(); -} - -A_Test void testC1Mod1Function2() { - extern void C1Mod1Function2(); - C1Mod1Function2(); -} Copied: trunk/src/native/test/recursive/C2/tests/Mod1/C2Mod1Test.c (from rev 414, trunk/src/native/test/recursive/C1/tests/Mod1/C1Mod1Test.c) =================================================================== --- trunk/src/native/test/recursive/C2/tests/Mod1/C2Mod1Test.c (rev 0) +++ trunk/src/native/test/recursive/C2/tests/Mod1/C2Mod1Test.c 2008-10-27 07:43:58 UTC (rev 415) @@ -0,0 +1,43 @@ +/* Copyright (c) 2007, Christian Hujer + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the AceUnit developers nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** Recursive AceUnit Test, Test C1Mod1Test. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @file C1Mod1Test.c + */ + +#include "C2/tests/Mod1/C2Mod1Test.h" + +A_Test void testC2Mod1Function1() { + extern void C2Mod1Function1(); + C2Mod1Function1(); +} + +A_Test void testC2Mod1Function2() { + extern void C2Mod1Function2(); + C2Mod1Function2(); +} Property changes on: trunk/src/native/test/recursive/C2/tests/Mod1/C2Mod1Test.c ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:mergeinfo + Added: svn:eol-style + native Property changes on: trunk/src/native/test/recursive/C2/tests/Mod2 ___________________________________________________________________ Added: svn:mergeinfo + Deleted: trunk/src/native/test/recursive/C2/tests/Mod2/C1Mod2Test.c =================================================================== --- trunk/src/native/test/recursive/C1/tests/Mod2/C1Mod2Test.c 2008-10-19 22:25:02 UTC (rev 414) +++ trunk/src/native/test/recursive/C2/tests/Mod2/C1Mod2Test.c 2008-10-27 07:43:58 UTC (rev 415) @@ -1,43 +0,0 @@ -/* Copyright (c) 2007, Christian Hujer - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the AceUnit developers nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** Recursive AceUnit Test, Test C1Mod1Test. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @file C1Mod1Test.c - */ - -#include "C1/tests/Mod2/C1Mod2Test.h" - -A_Test void testC1Mod2Function1() { - extern void C1Mod2Function1(); - C1Mod2Function1(); -} - -A_Test void testC1Mod2Function2() { - extern void C1Mod2Function2(); - C1Mod2Function2(); -} Copied: trunk/src/native/test/recursive/C2/tests/Mod2/C2Mod2Test.c (from rev 414, trunk/src/native/test/recursive/C1/tests/Mod2/C1Mod2Test.c) =================================================================== --- trunk/src/native/test/recursive/C2/tests/Mod2/C2Mod2Test.c (rev 0) +++ trunk/src/native/test/recursive/C2/tests/Mod2/C2Mod2Test.c 2008-10-27 07:43:58 UTC (rev 415) @@ -0,0 +1,43 @@ +/* Copyright (c) 2007, Christian Hujer + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the AceUnit developers nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** Recursive AceUnit Test, Test C1Mod1Test. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @file C1Mod1Test.c + */ + +#include "C2/tests/Mod2/C2Mod2Test.h" + +A_Test void testC2Mod2Function1() { + extern void C2Mod2Function1(); + C2Mod2Function1(); +} + +A_Test void testC2Mod2Function2() { + extern void C2Mod2Function2(); + C2Mod2Function2(); +} Property changes on: trunk/src/native/test/recursive/C2/tests/Mod2/C2Mod2Test.c ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:mergeinfo + Added: svn:eol-style + native Modified: trunk/src/native/test/recursive/RunTests.c =================================================================== --- trunk/src/native/test/recursive/RunTests.c 2008-10-19 22:25:02 UTC (rev 414) +++ trunk/src/native/test/recursive/RunTests.c 2008-10-27 07:43:58 UTC (rev 415) @@ -39,9 +39,17 @@ /** The fixtures. */ extern const TestFixture_t C1Mod2TestFixture; +/** The fixtures. */ +extern const TestFixture_t C2Mod1TestFixture; + +/** The fixtures. */ +extern const TestFixture_t C2Mod2TestFixture; + const TestFixture_t *const fixtures[] = { &C1Mod1TestFixture, &C1Mod2TestFixture, + &C2Mod1TestFixture, + &C2Mod2TestFixture, NULL }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-10-19 22:25:07
|
Revision: 414 http://aceunit.svn.sourceforge.net/aceunit/?rev=414&view=rev Author: christianhujer Date: 2008-10-19 22:25:02 +0000 (Sun, 19 Oct 2008) Log Message: ----------- Improved test makefile - no shell required for looping now. Modified Paths: -------------- trunk/src/native/test/Makefile Modified: trunk/src/native/test/Makefile =================================================================== --- trunk/src/native/test/Makefile 2008-10-19 22:11:39 UTC (rev 413) +++ trunk/src/native/test/Makefile 2008-10-19 22:25:02 UTC (rev 414) @@ -10,8 +10,12 @@ xmlLog \ # printf \ -all: - @for dir in $(DIRS) ; do (cd $$dir ; make) || exit 1 ; done +.PHONY : all +all: $(DIRS) -clean: - @for dir in $(DIRS) ; do (cd $$dir ; make clean) || exit 1 ; done +.PHONY : clean +clean: $(DIRS) + +.PHONY : $(DIRS) +$(DIRS): + $(MAKE) -C $@ $(MAKECMDGOALS) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-10-19 22:11:44
|
Revision: 413 http://aceunit.svn.sourceforge.net/aceunit/?rev=413&view=rev Author: christianhujer Date: 2008-10-19 22:11:39 +0000 (Sun, 19 Oct 2008) Log Message: ----------- Improved makefile of recursive example. Modified Paths: -------------- trunk/src/native/test/recursive/Makefile Modified: trunk/src/native/test/recursive/Makefile =================================================================== --- trunk/src/native/test/recursive/Makefile 2008-10-19 21:52:01 UTC (rev 412) +++ trunk/src/native/test/recursive/Makefile 2008-10-19 22:11:39 UTC (rev 413) @@ -1,73 +1,67 @@ LOGGER=FullPlainLogger -#LOGGER=MiniRamLogger - +FIXTURE_NAME=. +ACE_UNIT_PATH=../../.. ACE_UNIT_FILES=AceUnit.c AceUnit.h AceUnitData.c AceUnitData.h AceUnitAnnotations.h AceUnitLogging.h $(LOGGER).c AceUnit.jar - -ACE_UNIT_PATH=../../../ - ACE_UNIT_JAVA_SRC=$(shell find $(ACE_UNIT_PATH)/java/src -name "*.java") +$(shell java -jar $(ACE_UNIT_PATH)/java/AceUnit.jar .) -FIXTURE_NAME=. +LINT=splint -CFLAGS=-DACEUNIT_CONFIG_FILE=\"AceUnitConfig.h\" +PARTS=\ + AceUnit \ + AceUnitData \ + $(LOGGER) \ -SOURCES=$(sort $(shell find . -name "*.c") $(filter %.c,$(addprefix ./,$(ACE_UNIT_FILES)))) -OBJECTS=$(patsubst %.c,%.o,$(SOURCES)) -HEADERS=$(patsubst %.c,%.h,$(shell find . -name "*.c")) -GCOV=$(patsubst %.c,%.gcov,$(SOURCES)) -GCNO=$(patsubst %.c,%.gcno,$(SOURCES)) -GCDA=$(patsubst %.c,%.gcda,$(SOURCES)) +VPATH=$(ACE_UNIT_PATH)/native -all: prepare generateHeaders compile test +OBJECTS=$(addsuffix .o,$(PARTS)) -clean: - rm -f $(ACE_UNIT_FILES) $(OBJECTS) $(HEADERS) runTests $(GCOV) $(GCNO) $(GCDA) +LINTOUTS=$(addsuffix .ln,$(PARTS)) -prepare: $(ACE_UNIT_FILES) +CPPFLAGS=-DACEUNIT_CONFIG_FILE=\"AceUnitConfig.h\" -I . -I $(ACE_UNIT_PATH)/native -AceUnit.c: $(ACE_UNIT_PATH)/native/AceUnit.c - cp $< $@ +C_and_LD_FLAGS=-fprofile-arcs -AceUnit.h: $(ACE_UNIT_PATH)/native/AceUnit.h - cp $< $@ +CFLAGS=-fdiagnostics-show-option -std=c89 -pedantic $(C_and_LD_FLAGS) -ftest-coverage -W -Wall -g -AceUnitData.c: $(ACE_UNIT_PATH)/native/AceUnitData.c - cp $< $@ +SOURCES=$(sort $(shell find . -name "*.c") $(filter %.c,$(addprefix ./,$(ACE_UNIT_FILES)))) +OBJECTS+=$(patsubst %.c,%.o,$(SOURCES)) +HEADERS=$(patsubst %.c,%.h,$(shell find . -name "*.c")) $(shell find . -name "Suite.h") +DEPENDS=$(patsubst %.o,%.d,$(OBJECTS)) +GCOV=$(patsubst %.o,%.gcov,$(OBJECTS)) +GCNO=$(patsubst %.o,%.gcno,$(OBJECTS)) +GCDA=$(patsubst %.o,%.gcda,$(OBJECTS)) -AceUnitData.h: $(ACE_UNIT_PATH)/native/AceUnitData.h - cp $< $@ +LDFLAGS=$(C_and_LD_FLAGS) -AceUnitAnnotations.h: $(ACE_UNIT_PATH)/native/AceUnitAnnotations.h - cp $< $@ +LINTFLAGS=-badflag -nolib -AceUnitLogging.h: $(ACE_UNIT_PATH)/native/AceUnitLogging.h - cp $< $@ +.PHONY : all +all: test -$(LOGGER).c: $(ACE_UNIT_PATH)/native/$(LOGGER).c - cp $< $@ +RunTests: $(OBJECTS) -AceUnit.jar: $(ACE_UNIT_PATH)/java/AceUnit.jar - cp $(ACE_UNIT_PATH)/java/AceUnit.jar $@ - $(ACE_UNIT_PATH)/java/AceUnit.jar: $(ACE_UNIT_JAVA_SRC) ant -f $(ACE_UNIT_PATH)/java/build.xml -compile: runTests +%.d: %.c + $(CPP) -M -MM -MG $(CPPFLAGS) $< | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' > $@ -generateHeaders: - java -jar AceUnit.jar $(FIXTURE_NAME) +coverage: test + gcov *.c -%.o: %.c - $(CC) $(CFLAGS) -fdiagnostics-show-option -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -c -o $@ -I. $< +test: RunTests + ./RunTests -runTests: $(ACE_UNIT_FILES) $(OBJECTS) - $(CC) -fdiagnostics-show-option -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -o $@ $(OBJECTS) +.PHONY : clean +clean: + rm -f $(OBJECTS) $(HEADERS) $(DEPENDS) RunTests $(GCOV) $(GCNO) $(GCDA) -test: runTests - ./runTests +.PHONY : lint +lint: $(LINTOUTS) -doc: $(ACE_UNIT_FILES) - doxygen +$(OBJECTS) $(OBJECTS:.o=.d): Makefile -coverage: test - gcov *.c +ifneq ($(MAKECMDGOALS),clean) +-include $(OBJECTS:.o=.d) +endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-10-19 21:52:03
|
Revision: 412 http://aceunit.svn.sourceforge.net/aceunit/?rev=412&view=rev Author: christianhujer Date: 2008-10-19 21:52:01 +0000 (Sun, 19 Oct 2008) Log Message: ----------- Extracted main() from XmlLogTest into new RunTests. Modified Paths: -------------- trunk/src/native/test/xmlLog/XmlLogTest.c Added Paths: ----------- trunk/src/native/test/xmlLog/RunTests.c Added: trunk/src/native/test/xmlLog/RunTests.c =================================================================== --- trunk/src/native/test/xmlLog/RunTests.c (rev 0) +++ trunk/src/native/test/xmlLog/RunTests.c 2008-10-19 21:52:01 UTC (rev 412) @@ -0,0 +1,62 @@ +/* Copyright (c) 2008, Christian Hujer + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the AceUnit developers nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** Unit Test for AceUnit's XML Logger. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @file + */ + +#include <stdbool.h> +#include <stdio.h> + +#include "AceUnitData.h" +#include "AceUnitLogging.h" + +/** The Logger. */ +extern TestLogger_t *globalLogger; + +extern TestFixture_t XmlLogTestFixture; + +/** Run the tests. + * @note This is only here temporarily. + * @note Command line arguments currently are ignored. + * In future versions, this part will be auto-generated. + * @return Exit status. + * @retval 0 if all tests ran successfully. + * @retval 1 if there were test errors or failures. + */ +int main(void) { + int retVal = 0; + globalLogger->runnerStarted(); + runFixture(&XmlLogTestFixture); + globalLogger->runnerEnded(); + if (runnerData->testCaseFailureCount != 1) { + fprintf(stderr, "Test Cases: %d Expected Errors: 1 Errors: %d\n", runnerData->testCaseCount, runnerData->testCaseFailureCount); + retVal = 1; + } + return retVal; +} Property changes on: trunk/src/native/test/xmlLog/RunTests.c ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/src/native/test/xmlLog/XmlLogTest.c =================================================================== --- trunk/src/native/test/xmlLog/XmlLogTest.c 2008-10-19 21:48:20 UTC (rev 411) +++ trunk/src/native/test/xmlLog/XmlLogTest.c 2008-10-19 21:52:01 UTC (rev 412) @@ -41,26 +41,3 @@ A_Test void test1() { fail("Intentional failure for testing the XML Logger."); } - -/** The Logger. */ -extern TestLogger_t *globalLogger; - -/** Run the tests. - * @note This is only here temporarily. - * @note Command line arguments currently are ignored. - * In future versions, this part will be auto-generated. - * @return Exit status. - * @retval 0 if all tests ran successfully. - * @retval 1 if there were test errors or failures. - */ -int main(void) { - int retVal = 0; - globalLogger->runnerStarted(); - runFixture(&XmlLogTestFixture); - globalLogger->runnerEnded(); - if (runnerData->testCaseFailureCount != 1) { - fprintf(stderr, "Test Cases: %d Expected Errors: 1 Errors: %d\n", runnerData->testCaseCount, runnerData->testCaseFailureCount); - retVal = 1; - } - return retVal; -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-10-19 21:48:27
|
Revision: 411 http://aceunit.svn.sourceforge.net/aceunit/?rev=411&view=rev Author: christianhujer Date: 2008-10-19 21:48:20 +0000 (Sun, 19 Oct 2008) Log Message: ----------- Renamed TestMain to RunTests so it's consistent with other tests. Added Paths: ----------- trunk/src/native/test/recursive/RunTests.c Removed Paths: ------------- trunk/src/native/test/recursive/TestMain.c Copied: trunk/src/native/test/recursive/RunTests.c (from rev 408, trunk/src/native/test/recursive/TestMain.c) =================================================================== --- trunk/src/native/test/recursive/RunTests.c (rev 0) +++ trunk/src/native/test/recursive/RunTests.c 2008-10-19 21:48:20 UTC (rev 411) @@ -0,0 +1,69 @@ +/* Copyright (c) 2007, Christian Hujer + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the AceUnit developers nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** Main program for testing AceUnit's recursive behaviour. + * @file TestMain.c + */ + +#include "AceUnit.h" +#include "AceUnitData.h" +#include <stdio.h> + +/** The fixtures. */ +extern const TestFixture_t C1Mod1TestFixture; + +/** The fixtures. */ +extern const TestFixture_t C1Mod2TestFixture; + +const TestFixture_t *const fixtures[] = { + &C1Mod1TestFixture, + &C1Mod2TestFixture, + NULL +}; + +/** The number of failed test cases. */ +extern uint16_t testCaseFailureCount; + +/** Prototype for running all fixtures in a list. + * @param fixtures Fixtures to run (terminate with NULL) + */ +extern void runFixtures(const TestFixture_t *const fixtures[]); + +/** Main program. + * @return Exit status. + * @retval 0 if all tests ran successfully. + * @retval 1 if there were test errors or failures. + */ +int main(void) { + int retVal = 0; + runFixtures(fixtures); + if (runnerData->testCaseFailureCount != 0) { + fprintf(stderr, "Error: %d test cases failed.\n", (int) runnerData->testCaseFailureCount); + retVal = 1; + } + return retVal; +} Property changes on: trunk/src/native/test/recursive/RunTests.c ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:mergeinfo + Added: svn:eol-style + native Deleted: trunk/src/native/test/recursive/TestMain.c =================================================================== --- trunk/src/native/test/recursive/TestMain.c 2008-10-19 21:00:18 UTC (rev 410) +++ trunk/src/native/test/recursive/TestMain.c 2008-10-19 21:48:20 UTC (rev 411) @@ -1,69 +0,0 @@ -/* Copyright (c) 2007, Christian Hujer - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the AceUnit developers nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** Main program for testing AceUnit's recursive behaviour. - * @file TestMain.c - */ - -#include "AceUnit.h" -#include "AceUnitData.h" -#include <stdio.h> - -/** The fixtures. */ -extern const TestFixture_t C1Mod1TestFixture; - -/** The fixtures. */ -extern const TestFixture_t C1Mod2TestFixture; - -const TestFixture_t *const fixtures[] = { - &C1Mod1TestFixture, - &C1Mod2TestFixture, - NULL -}; - -/** The number of failed test cases. */ -extern uint16_t testCaseFailureCount; - -/** Prototype for running all fixtures in a list. - * @param fixtures Fixtures to run (terminate with NULL) - */ -extern void runFixtures(const TestFixture_t *const fixtures[]); - -/** Main program. - * @return Exit status. - * @retval 0 if all tests ran successfully. - * @retval 1 if there were test errors or failures. - */ -int main(void) { - int retVal = 0; - runFixtures(fixtures); - if (runnerData->testCaseFailureCount != 0) { - fprintf(stderr, "Error: %d test cases failed.\n", (int) runnerData->testCaseFailureCount); - retVal = 1; - } - return retVal; -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-10-19 21:00:31
|
Revision: 410 http://aceunit.svn.sourceforge.net/aceunit/?rev=410&view=rev Author: christianhujer Date: 2008-10-19 21:00:18 +0000 (Sun, 19 Oct 2008) Log Message: ----------- Unified longjmp test with others. Modified Paths: -------------- trunk/src/native/test/longjmp/AceUnitConfig.h trunk/src/native/test/longjmp/LongJmpTest.c trunk/src/native/test/longjmp/Makefile Added Paths: ----------- trunk/src/native/test/longjmp/RunTests.c Modified: trunk/src/native/test/longjmp/AceUnitConfig.h =================================================================== --- trunk/src/native/test/longjmp/AceUnitConfig.h 2008-10-19 13:33:20 UTC (rev 409) +++ trunk/src/native/test/longjmp/AceUnitConfig.h 2008-10-19 21:00:18 UTC (rev 410) @@ -1,2 +1,5 @@ +/** Use setjmp()/longjmp() for exiting failed test cases. */ +#define ACEUNIT_ASSERTION_STYLE ACEUNIT_ASSERTION_STYLE_LONGJMP + /** Let AceUnit use its own C99 definitions. */ #define ACEUNIT_INTERNAL_ISO_TYPES Modified: trunk/src/native/test/longjmp/LongJmpTest.c =================================================================== --- trunk/src/native/test/longjmp/LongJmpTest.c 2008-10-19 13:33:20 UTC (rev 409) +++ trunk/src/native/test/longjmp/LongJmpTest.c 2008-10-19 21:00:18 UTC (rev 410) @@ -34,8 +34,6 @@ #include <stdbool.h> #include <stdio.h> -#define ACEUNIT_ASSERTION_STYLE ACEUNIT_ASSERTION_STYLE_LONGJMP - #include "LongJmpTest.h" #include "AceUnitData.h" @@ -54,21 +52,3 @@ A_Test void testAssertDoesLongjmp2() { helper(); } - -/** Run the tests. - * @note This is only here temporarily. - * @note Command line arguments currently are ignored. - * In future versions, this part will be auto-generated. - * @return Exit status. - * @retval 0 if all tests ran successfully. - * @retval 1 if there were test errors or failures. - */ -int main(void) { - int retVal = 0; - runFixture(&LongJmpTestFixture); - if (runnerData->testCaseFailureCount != 2) { - fprintf(stderr, "Test Cases: %d Errors: %d (expecting 2)\n", runnerData->testCaseCount, runnerData->testCaseFailureCount); - retVal = 1; - } - return retVal; -} Modified: trunk/src/native/test/longjmp/Makefile =================================================================== --- trunk/src/native/test/longjmp/Makefile 2008-10-19 13:33:20 UTC (rev 409) +++ trunk/src/native/test/longjmp/Makefile 2008-10-19 21:00:18 UTC (rev 410) @@ -1,64 +1,59 @@ LOGGER=FullPlainLogger -#LOGGER=MiniRamLogger - -ACE_UNIT_FILES=AceUnit.c AceUnit.h AceUnitData.c AceUnitData.h AceUnitAnnotations.h AceUnitLogging.h $(LOGGER).c AceUnit.jar - -ACE_UNIT_PATH=../../../ - +FIXTURE_NAMES=LongJmpTest +ACE_UNIT_PATH=../../.. ACE_UNIT_JAVA_SRC=$(shell find $(ACE_UNIT_PATH)/java/src -name "*.java") +$(shell java -jar $(ACE_UNIT_PATH)/java/AceUnit.jar .) -FIXTURE_NAME=LongJmpTest +LINT=splint -CFLAGS=-DACEUNIT_CONFIG_FILE=\"AceUnitConfig.h\" +PARTS=\ + AceUnit \ + AceUnitData \ + $(LOGGER) \ + $(FIXTURE_NAMES) -all: prepare compile test +VPATH=$(ACE_UNIT_PATH)/native -clean: - rm -f $(ACE_UNIT_FILES) $(FIXTURE_NAME).h runTests *.gcov *.gcno *.gcda +OBJECTS=$(addsuffix .o,$(PARTS)) -prepare: $(ACE_UNIT_FILES) +LINTOUTS=$(addsuffix .ln,$(PARTS)) -AceUnit.c: $(ACE_UNIT_PATH)/native/AceUnit.c - cp $< $@ +CPPFLAGS=-DACEUNIT_CONFIG_FILE=\"AceUnitConfig.h\" -I . -I $(ACE_UNIT_PATH)/native -AceUnit.h: $(ACE_UNIT_PATH)/native/AceUnit.h - cp $< $@ +C_and_LD_FLAGS=-fprofile-arcs -AceUnitData.c: $(ACE_UNIT_PATH)/native/AceUnitData.c - cp $< $@ +CFLAGS=-fdiagnostics-show-option -std=c89 -pedantic $(C_and_LD_FLAGS) -ftest-coverage -W -Wall -g -AceUnitData.h: $(ACE_UNIT_PATH)/native/AceUnitData.h - cp $< $@ +LDFLAGS=$(C_and_LD_FLAGS) -AceUnitAnnotations.h: $(ACE_UNIT_PATH)/native/AceUnitAnnotations.h - cp $< $@ +LINTFLAGS=-badflag -nolib -AceUnitLogging.h: $(ACE_UNIT_PATH)/native/AceUnitLogging.h - cp $< $@ +.PHONY : all +all: test -$(LOGGER).c: $(ACE_UNIT_PATH)/native/$(LOGGER).c - cp $< $@ +RunTests: $(OBJECTS) -AceUnit.jar: $(ACE_UNIT_PATH)/java/AceUnit.jar - cp $(ACE_UNIT_PATH)/java/AceUnit.jar $@ - $(ACE_UNIT_PATH)/java/AceUnit.jar: $(ACE_UNIT_JAVA_SRC) ant -f $(ACE_UNIT_PATH)/java/build.xml -compile: runTests +%.d: %.c + $(CPP) -M -MM -MG $(CPPFLAGS) $< | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' > $@ -$(FIXTURE_NAME).h: AceUnit.jar $(FIXTURE_NAME).c - java -jar AceUnit.jar $(FIXTURE_NAME) +coverage: test + gcov *.c -runTests: $(FIXTURE_NAME).c $(FIXTURE_NAME).h $(ACE_UNIT_FILES) - $(CC) $(CFLAGS) -fdiagnostics-show-option -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -o runTests *.c -# $(CC) $(CFLAGS) -fdiagnostics-show-option -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -DACEUNIT_EMBEDDED -o runTests *.c +test: RunTests + ./RunTests -test: runTests - ./runTests +.PHONY : clean +clean: + rm -f $(addsuffix .h, $(FIXTURE_NAMES)) RunTests *.gcov *.gcno *.gcda *.o *.d Suite.h -doc: $(FIXTURE_NAME).c $(FIXTURE_NAME).h $(ACE_UNIT_FILES) - doxygen +.PHONY : lint +lint: $(LINTOUTS) -coverage: test - gcov *.c +$(OBJECTS) $(OBJECTS:.o=.d): Makefile + +ifneq ($(MAKECMDGOALS),clean) +-include $(OBJECTS:.o=.d) +endif Added: trunk/src/native/test/longjmp/RunTests.c =================================================================== --- trunk/src/native/test/longjmp/RunTests.c (rev 0) +++ trunk/src/native/test/longjmp/RunTests.c 2008-10-19 21:00:18 UTC (rev 410) @@ -0,0 +1,51 @@ +/* Copyright (c) 2008, Christian Hujer + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the AceUnit developers nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include <stdbool.h> +#include <stdio.h> + +#include "AceUnitData.h" + +extern TestFixture_t LongJmpTestFixture; + +/** Run the tests. + * @note This is only here temporarily. + * @note Command line arguments currently are ignored. + * In future versions, this part will be auto-generated. + * @return Exit status. + * @retval 0 if all tests ran successfully. + * @retval 1 if there were test errors or failures. + */ +int main(void) { + int retVal = 0; + runFixture(&LongJmpTestFixture); + if (runnerData->testCaseFailureCount != 2) { + fprintf(stderr, "Test Cases: %d Errors: %d (expecting 2)\n", runnerData->testCaseCount, runnerData->testCaseFailureCount); + retVal = 1; + } + return retVal; +} Property changes on: trunk/src/native/test/longjmp/RunTests.c ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-10-19 13:33:29
|
Revision: 409 http://aceunit.svn.sourceforge.net/aceunit/?rev=409&view=rev Author: christianhujer Date: 2008-10-19 13:33:20 +0000 (Sun, 19 Oct 2008) Log Message: ----------- Unified loop test with others. Modified Paths: -------------- trunk/src/native/test/loop/AceUnitConfig.h trunk/src/native/test/loop/AceUnitLoopTest.c trunk/src/native/test/loop/Makefile Added Paths: ----------- trunk/src/native/test/loop/RunTests.c Modified: trunk/src/native/test/loop/AceUnitConfig.h =================================================================== --- trunk/src/native/test/loop/AceUnitConfig.h 2008-10-19 13:16:08 UTC (rev 408) +++ trunk/src/native/test/loop/AceUnitConfig.h 2008-10-19 13:33:20 UTC (rev 409) @@ -1,3 +1,6 @@ +/** Use return to exit failed test cases. */ +#define ACEUNIT_ASSERTION_STYLE ACEUNIT_ASSERTION_STYLE_RETURN + /** Let AceUnit use its own C99 definitions. */ #define ACEUNIT_INTERNAL_ISO_TYPES Modified: trunk/src/native/test/loop/AceUnitLoopTest.c =================================================================== --- trunk/src/native/test/loop/AceUnitLoopTest.c 2008-10-19 13:16:08 UTC (rev 408) +++ trunk/src/native/test/loop/AceUnitLoopTest.c 2008-10-19 13:33:20 UTC (rev 409) @@ -33,19 +33,17 @@ #include <stdbool.h> #include <stdio.h> -#define ACEUNIT_ASSERTION_STYLE ACEUNIT_ASSERTION_STYLE_RETURN - #include "AceUnitData.h" #include "AceUnitLoopTest.h" /** First loop count, used for a looping test. */ -static int loopCount1 = 0; +int loopCount1 = 0; /** Second loop count, used for another looping test. */ -static int loopCount2 = 0; +int loopCount2 = 0; /** Third loop count, used for non-looping tests. */ -static int loopCount3 = 0; +int loopCount3 = 0; /** Normal test, does not loop. */ A_Test void dummy1() { @@ -71,28 +69,3 @@ A_Test void dummy3() { loopCount3++; } - -/** Main program. -* @return Return value, 0 if the test is successful, other value if wrong. - */ -int main(void) { - int retVal = 0; - runFixture(&AceUnitLoopTestFixture); - if (runnerData->testCaseFailureCount != 0) { - fprintf(stderr, "Test Cases: %d Errors: %d\n", runnerData->testCaseCount, runnerData->testCaseFailureCount); - retVal = 1; - } - if (loopCount1 != 5) { - fprintf(stderr, "Loops #1 expected: 5, loops actual: %d\n", loopCount1); - retVal = 1; - } - if (loopCount2 != 10) { - fprintf(stderr, "Loops #2 expected: 10, loops actual: %d\n", loopCount2); - retVal = 1; - } - if (loopCount3 != 3) { - fprintf(stderr, "Loops #3 expected: 3, loops actual: %d\n", loopCount3); - retVal = 1; - } - return retVal; -} Modified: trunk/src/native/test/loop/Makefile =================================================================== --- trunk/src/native/test/loop/Makefile 2008-10-19 13:16:08 UTC (rev 408) +++ trunk/src/native/test/loop/Makefile 2008-10-19 13:33:20 UTC (rev 409) @@ -1,62 +1,59 @@ LOGGER=FullPlainLogger - -ACE_UNIT_FILES=AceUnit.c AceUnit.h AceUnitData.c AceUnitData.h AceUnitAnnotations.h AceUnitLogging.h $(LOGGER).c AceUnit.jar - -ACE_UNIT_PATH=../../../ - +FIXTURE_NAMES=AceUnitLoopTest +ACE_UNIT_PATH=../../.. ACE_UNIT_JAVA_SRC=$(shell find $(ACE_UNIT_PATH)/java/src -name "*.java") +$(shell java -jar $(ACE_UNIT_PATH)/java/AceUnit.jar .) -FIXTURE_NAME=AceUnitLoopTest +LINT=splint -CFLAGS=-DACEUNIT_CONFIG_FILE=\"AceUnitConfig.h\" +PARTS=\ + AceUnit \ + AceUnitData \ + $(LOGGER) \ + $(FIXTURE_NAMES) -all: prepare compile test +VPATH=$(ACE_UNIT_PATH)/native -clean: - rm -f $(ACE_UNIT_FILES) $(FIXTURE_NAME).h runTests *.gcov *.gcno *.gcda +OBJECTS=$(addsuffix .o,$(PARTS)) -prepare: $(ACE_UNIT_FILES) +LINTOUTS=$(addsuffix .ln,$(PARTS)) -AceUnit.c: $(ACE_UNIT_PATH)/native/AceUnit.c - cp $< $@ +CPPFLAGS=-DACEUNIT_CONFIG_FILE=\"AceUnitConfig.h\" -I . -I $(ACE_UNIT_PATH)/native -AceUnit.h: $(ACE_UNIT_PATH)/native/AceUnit.h - cp $< $@ +C_and_LD_FLAGS=-fprofile-arcs -AceUnitData.c: $(ACE_UNIT_PATH)/native/AceUnitData.c - cp $< $@ +CFLAGS=-fdiagnostics-show-option -std=c89 -pedantic $(C_and_LD_FLAGS) -ftest-coverage -W -Wall -g -AceUnitData.h: $(ACE_UNIT_PATH)/native/AceUnitData.h - cp $< $@ +LDFLAGS=$(C_and_LD_FLAGS) -AceUnitAnnotations.h: $(ACE_UNIT_PATH)/native/AceUnitAnnotations.h - cp $< $@ +LINTFLAGS=-badflag -nolib -AceUnitLogging.h: $(ACE_UNIT_PATH)/native/AceUnitLogging.h - cp $< $@ +.PHONY : all +all: test -$(LOGGER).c: $(ACE_UNIT_PATH)/native/$(LOGGER).c - cp $< $@ +RunTests: $(OBJECTS) -AceUnit.jar: $(ACE_UNIT_PATH)/java/AceUnit.jar - cp $(ACE_UNIT_PATH)/java/AceUnit.jar $@ - $(ACE_UNIT_PATH)/java/AceUnit.jar: $(ACE_UNIT_JAVA_SRC) ant -f $(ACE_UNIT_PATH)/java/build.xml -compile: runTests +%.d: %.c + $(CPP) -M -MM -MG $(CPPFLAGS) $< | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' > $@ -$(FIXTURE_NAME).h: AceUnit.jar $(FIXTURE_NAME).c - java -jar AceUnit.jar $(FIXTURE_NAME) +coverage: test + gcov *.c -runTests: $(FIXTURE_NAME).c $(FIXTURE_NAME).h $(ACE_UNIT_FILES) - $(CC) $(CFLAGS) -fdiagnostics-show-option -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -o runTests *.c +test: RunTests + ./RunTests -test: runTests - ./runTests +.PHONY : clean +clean: + rm -f $(addsuffix .h, $(FIXTURE_NAMES)) RunTests *.gcov *.gcno *.gcda *.o *.d Suite.h -doc: $(FIXTURE_NAME).c $(FIXTURE_NAME).h $(ACE_UNIT_FILES) - doxygen +.PHONY : lint +lint: $(LINTOUTS) -coverage: test - gcov *.c +$(OBJECTS) $(OBJECTS:.o=.d): Makefile + +ifneq ($(MAKECMDGOALS),clean) +-include $(OBJECTS:.o=.d) +endif Added: trunk/src/native/test/loop/RunTests.c =================================================================== --- trunk/src/native/test/loop/RunTests.c (rev 0) +++ trunk/src/native/test/loop/RunTests.c 2008-10-19 13:33:20 UTC (rev 409) @@ -0,0 +1,66 @@ +/* Copyright (c) 2008, Christian Hujer + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the AceUnit developers nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** Unit Test for AceUnit's Loop feature. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @file AceUnitLoopTest.c + */ + +#include <stdbool.h> +#include <stdio.h> + +#include "AceUnitData.h" + +extern TestFixture_t AceUnitLoopTestFixture; +extern int loopCount1; +extern int loopCount2; +extern int loopCount3; + +/** Main program. +* @return Return value, 0 if the test is successful, other value if wrong. + */ +int main(void) { + int retVal = 0; + runFixture(&AceUnitLoopTestFixture); + if (runnerData->testCaseFailureCount != 0) { + fprintf(stderr, "Test Cases: %d Errors: %d\n", runnerData->testCaseCount, runnerData->testCaseFailureCount); + retVal = 1; + } + if (loopCount1 != 5) { + fprintf(stderr, "Loops #1 expected: 5, loops actual: %d\n", loopCount1); + retVal = 1; + } + if (loopCount2 != 10) { + fprintf(stderr, "Loops #2 expected: 10, loops actual: %d\n", loopCount2); + retVal = 1; + } + if (loopCount3 != 3) { + fprintf(stderr, "Loops #3 expected: 3, loops actual: %d\n", loopCount3); + retVal = 1; + } + return retVal; +} Property changes on: trunk/src/native/test/loop/RunTests.c ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |