aceunit-commit Mailing List for AceUnit (Page 6)
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-22 09:42:53
|
Revision: 458 http://aceunit.svn.sourceforge.net/aceunit/?rev=458&view=rev Author: christianhujer Date: 2008-11-22 09:42:47 +0000 (Sat, 22 Nov 2008) Log Message: ----------- Updated release script to auto-delete uploads and auto-create branch. Modified Paths: -------------- release.sh Modified: release.sh =================================================================== --- release.sh 2008-11-22 09:30:33 UTC (rev 457) +++ release.sh 2008-11-22 09:42:47 UTC (rev 458) @@ -13,10 +13,31 @@ releasename=$2 sfusername=$3 +svnbaseurl=$(svn info | grep URL | sed 's/URL: //') +echo $svnbaseurl +svntrunkurl=$svnrepopath/trunk +svnbranchurl=$svnrepopath/branches/$branchname +svntagurl=$svnrepopath/tags/$releasename + +if [ -d uploads ] +then + echo deleting existing uploads + rm -rf uploads +fi + +svn up + +if [ ! -d branches/$branchname ] +then + echo branch $branchname does not already exist + svn cp -m "Creating branch for $branchname." $svntrunkurl $svnbranchurl +fi + mkdir -p uploads/ + basename=aceunit-$releasename -svn cp -m "Creating release tag $releasename for branch $branchname." https://aceunit.svn.sourceforge.net/svnroot/aceunit/branches/$branchname https://aceunit.svn.sourceforge.net/svnroot/aceunit/tags/$releasename -svn export http://aceunit.svn.sourceforge.net/svnroot/aceunit/tags/$releasename $basename +svn cp -m "Creating release tag $releasename for branch $branchname." $svnbranchurl $svntagurl +svn export $svntagurl $basename tar cjvf uploads/$basename-src.tar.bz2 $basename tar czvf uploads/$basename-src.tar.gz $basename zip -r uploads/$basename-src.zip $basename This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-22 09:30:38
|
Revision: 457 http://aceunit.svn.sourceforge.net/aceunit/?rev=457&view=rev Author: christianhujer Date: 2008-11-22 09:30:33 +0000 (Sat, 22 Nov 2008) Log Message: ----------- #2325920 Testcase cplusplus should reference CXX instead of g++ Modified Paths: -------------- branches/0.9/src/native/test/cplusplus/Makefile trunk/src/native/test/cplusplus/Makefile Modified: branches/0.9/src/native/test/cplusplus/Makefile =================================================================== --- branches/0.9/src/native/test/cplusplus/Makefile 2008-11-22 00:14:06 UTC (rev 456) +++ branches/0.9/src/native/test/cplusplus/Makefile 2008-11-22 09:30:33 UTC (rev 457) @@ -1,7 +1,7 @@ LOGGER=FullPlainLogger -# It looks strange defining CC to a CXX compiler, but that's intentional: +# It looks strange defining CC to a C++ compiler, but that's intentional: # This testcase tests if AceUnit also works fine if somebody uses a C++ compiler to compile AceUnit C code. -CC=g++ +CC=$(CXX) ACE_UNIT_PATH=../../.. ACE_UNIT_JAVA_SRC=$(shell find $(ACE_UNIT_PATH)/java/src -name "*.java") Modified: trunk/src/native/test/cplusplus/Makefile =================================================================== --- trunk/src/native/test/cplusplus/Makefile 2008-11-22 00:14:06 UTC (rev 456) +++ trunk/src/native/test/cplusplus/Makefile 2008-11-22 09:30:33 UTC (rev 457) @@ -1,7 +1,7 @@ LOGGER=FullPlainLogger -# It looks strange defining CC to a CXX compiler, but that's intentional: +# It looks strange defining CC to a C++ compiler, but that's intentional: # This testcase tests if AceUnit also works fine if somebody uses a C++ compiler to compile AceUnit C code. -CC=g++ +CC=$(CXX) ACE_UNIT_PATH=../../.. ACE_UNIT_JAVA_SRC=$(shell find $(ACE_UNIT_PATH)/java/src -name "*.java") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-22 00:14:13
|
Revision: 456 http://aceunit.svn.sourceforge.net/aceunit/?rev=456&view=rev Author: christianhujer Date: 2008-11-22 00:14:06 +0000 (Sat, 22 Nov 2008) Log Message: ----------- Update information about the latest release version. Modified Paths: -------------- trunk/src/doc/start.xhtml Modified: trunk/src/doc/start.xhtml =================================================================== --- trunk/src/doc/start.xhtml 2008-11-22 00:05:36 UTC (rev 455) +++ trunk/src/doc/start.xhtml 2008-11-22 00:14:06 UTC (rev 456) @@ -20,7 +20,7 @@ </div> --> <p> - Latest release version: <strong>aceunit-0.7.0</strong> + Latest release version: <strong>aceunit-0.9.0</strong> </p> <h2>What is AceUnit?</h2> <!-- The description must match the project description at http://sourceforge.net/projects/aceunit/ --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-22 00:05:40
|
Revision: 455 http://aceunit.svn.sourceforge.net/aceunit/?rev=455&view=rev Author: christianhujer Date: 2008-11-22 00:05:36 +0000 (Sat, 22 Nov 2008) Log Message: ----------- Creating release tag 0.9.0 for branch 0.9. Added Paths: ----------- tags/0.9.0/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-22 00:03:41
|
Revision: 454 http://aceunit.svn.sourceforge.net/aceunit/?rev=454&view=rev Author: christianhujer Date: 2008-11-22 00:03:37 +0000 (Sat, 22 Nov 2008) Log Message: ----------- Creating branch for 0.9. Added Paths: ----------- branches/0.9/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-21 23:55:25
|
Revision: 453 http://aceunit.svn.sourceforge.net/aceunit/?rev=453&view=rev Author: christianhujer Date: 2008-11-21 23:55:20 +0000 (Fri, 21 Nov 2008) Log Message: ----------- #2321200 const TestFixture_t needs to be extern Modified Paths: -------------- trunk/src/java/src/prj/net/sf/aceunit/Fixture.java trunk/src/java/src/prj/net/sf/aceunit/Pckg.java trunk/src/native/test/Makefile Added Paths: ----------- trunk/src/native/test/cplusplus/ trunk/src/native/test/cplusplus/AceUnitConfig.h trunk/src/native/test/cplusplus/AceUnitTest.c trunk/src/native/test/cplusplus/Makefile trunk/src/native/test/cplusplus/RunTests.c Modified: trunk/src/java/src/prj/net/sf/aceunit/Fixture.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/Fixture.java 2008-11-21 23:17:58 UTC (rev 452) +++ trunk/src/java/src/prj/net/sf/aceunit/Fixture.java 2008-11-21 23:55:20 UTC (rev 453) @@ -175,6 +175,9 @@ public String getFixture(@NotNull final String basename) { final Formatter out = new Formatter(); out.format("/** This fixture. */%n"); + out.format("#if defined __cplusplus%n"); + out.format("extern%n"); + out.format("#endif%n"); out.format("const TestFixture_t %sFixture = {%n", fixtureName); out.format(" %d,%n", getId()); out.format("#ifndef ACEUNIT_EMBEDDED%n"); Modified: trunk/src/java/src/prj/net/sf/aceunit/Pckg.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/Pckg.java 2008-11-21 23:17:58 UTC (rev 452) +++ trunk/src/java/src/prj/net/sf/aceunit/Pckg.java 2008-11-21 23:55:20 UTC (rev 453) @@ -98,6 +98,9 @@ out.format(" NULL%n"); out.format("};%n"); out.format("%n"); + out.format("#if defined __cplusplus%n"); + out.format("extern%n"); + out.format("#endif%n"); out.format("const TestSuite_t suite%d = {%n", getId()); out.format(" %d,%n", getId()); out.format("#ifndef ACEUNIT_EMBEDDED%n"); Modified: trunk/src/native/test/Makefile =================================================================== --- trunk/src/native/test/Makefile 2008-11-21 23:17:58 UTC (rev 452) +++ trunk/src/native/test/Makefile 2008-11-21 23:55:20 UTC (rev 453) @@ -2,6 +2,7 @@ basic \ basicEmbedded \ comment \ + cplusplus \ exhand \ group \ longjmp \ Added: trunk/src/native/test/cplusplus/AceUnitConfig.h =================================================================== --- trunk/src/native/test/cplusplus/AceUnitConfig.h (rev 0) +++ trunk/src/native/test/cplusplus/AceUnitConfig.h 2008-11-21 23:55:20 UTC (rev 453) @@ -0,0 +1,2 @@ +/** Use return to exit a test case with a failed assertion. */ +#define ACEUNIT_ASSERTION_STYLE ACEUNIT_ASSERTION_STYLE_RETURN Property changes on: trunk/src/native/test/cplusplus/AceUnitConfig.h ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/src/native/test/cplusplus/AceUnitTest.c =================================================================== --- trunk/src/native/test/cplusplus/AceUnitTest.c (rev 0) +++ trunk/src/native/test/cplusplus/AceUnitTest.c 2008-11-21 23:55:20 UTC (rev 453) @@ -0,0 +1,254 @@ +/* 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. + */ + +/** Unit Test for AceUnit. + * Yes, AceUnit can be tested using itself. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @file AceUnitTest.c + */ + +#include <stdbool.h> +#include <stdio.h> + +#include "AceUnitData.h" +#include "AceUnitTest.h" + +/** The number of test cases that were executed. + * This looks redundant with runnerData->testCaseCount but actually it is not. + * It might be the case that the runner mistakenly executes the wrong methods, e.g. when the generator finds the wrong methods. + */ +int myTestCaseCount = 0; + +/** Clears the current recent error. */ +void clearRecentError() { + if (runnerData->recentError != NULL) { + runnerData->recentError = NULL; + } +} + +/** Holds whether or not the code continued after an assertion. */ +static bool assertionContinued = false; + +/** Helper method that asserts something that's then verified by a test case. + * @param c Assertion case. + */ +void helper(int c) { + assertionContinued = false; + switch (c) { + case 0: + assertTrue("assertTrue(msg, true) MUST NOT set recentError.", true); + break; + case 1: + assertTrue("Test assertion, expected to fail.", false); + break; + case 2: + assertTrue("Test assertion, expected to fail.", false); + break; + case 3: + assertFalse("assertFalse(msg, false) MUST continue the test case.", false); + break; + case 4: + assertFalse("Test assertion, expected to fail.", true); + break; + case 5: + assertFalse("Test assertion, expected to fail.", true); + break; + case 6: + { + int val1 = 10; + int val2 = val1; + assertEquals("assertEquals(msg, val, val) MUST continue the test case.", val1, val2); + } + break; + case 7: + { + int val1 = 10; + int val2 = 20; + assertEquals("assertEquals(msg, val1, val2) MUST NOT continue the test case.", val1, val2); + } + break; + case 8: + { + int val1 = 10; + int val2 = 20; + assertEquals("Test assertion, expected to fail.", val1, val2); + } + break; + } + assertionContinued = true; +} + +/** Tests that {@link #assertTrue()} with a true condition continues a test case. */ +A_Test void testAssertTrueWithTrueContinues() { + myTestCaseCount++; + helper(0); + clearRecentError(); + if (!assertionContinued) { + fail("Expected assertTrue(msg, true) to continue."); + } +} + +/** Tests that {@link #assertTrue()} with a false condition does not continue a test case. */ +A_Test void testAssertTrueWithFalseReturns() { + myTestCaseCount++; + helper(1); + clearRecentError(); + if (assertionContinued) { + fail("Expected assertTrue(msg, false) to not continue."); + } +} + +/** Tests that {@link #assertTrue()} with a true condition does not set recentError. */ +A_Test void testAssertTrueWithTrueNoRecentError() { + myTestCaseCount++; + clearRecentError(); + assertTrue("assertTrue(msg, true) MUST NOT set recentError.", true); + if (runnerData->recentError != NULL) { + clearRecentError(); + fail("Expected assertTrue(msg, true) to not set recentError."); + } +} + +/** Tests that {@link #assertTrue()} with a false condition sets recentError. */ +A_Test void testAssertTrueWithFalseSetsRecentError() { + bool recentErrorSet = false; + + myTestCaseCount++; + clearRecentError(); + helper(2); + if (runnerData->recentError != NULL) { + recentErrorSet = true; + } + clearRecentError(); + if (!recentErrorSet) { + fail("Expected assertTrue(msg, false) to set recentError."); + } +} + +/** Tests that {@link #assertFalse()} with a true condition continues a test case. */ +A_Test void testAssertFalseWithFalseContinues() { + myTestCaseCount++; + helper(3); + clearRecentError(); + if (!assertionContinued) { + fail("Expected assertion to continue."); + } +} + +/** Tests that {@link #assertFalse()} with a false condition does not continue a test case. */ +A_Test void testAssertFalseWithTrueReturns() { + myTestCaseCount++; + helper(4); + clearRecentError(); + if (assertionContinued) { + fail("Expected assertion to not continue."); + } +} + +/** Tests that {@link #assertFalse()} with a true condition does not set recentError. */ +A_Test void testAssertFalseWithFalseNoRecentError() { + myTestCaseCount++; + clearRecentError(); + assertFalse("assertFalse(msg, false) MUST NOT set recentError.", false); + if (runnerData->recentError != NULL) { + clearRecentError(); + fail("Expected recentError to be NULL."); + } +} + +/** Tests that {@link #assertFalse()} with a false condition sets recentError. */ +A_Test void testAssertFalseWithTrueSetsRecentError() { + bool recentErrorSet = false; + + myTestCaseCount++; + clearRecentError(); + helper(5); + if (runnerData->recentError != NULL) { + recentErrorSet = true; + } + clearRecentError(); + if (!recentErrorSet) { + fail("Expected recentError to be set."); + } +} + +/** Tests that {@link #assertEquals()} with equal values continues a test case. */ +A_Test void testAssertEqualsWithEqualContinues() { + myTestCaseCount++; + helper(6); + clearRecentError(); + if (!assertionContinued) { + fail("Expected assertion to continue."); + } +} + +/** Tests that {@link #assertEquals()} with unequal values does not continue a test case. */ +A_Test void testAssertEqualsWithUnequalReturns() { + myTestCaseCount++; + helper(7); + clearRecentError(); + if (assertionContinued) { + fail("Expected assertion to not continue."); + } +} + +/** Tests that {@link #assertEquals()} with equal values does not set recentError. */ +A_Test void testAssertEqualsWithEqualNoRecentError() { + int val1 = 10; + int val2 = val1; + + myTestCaseCount++; + clearRecentError(); + assertEquals("assertEquals(msg, val1, val2) MUST NOT set recentError.", val1, val2); + if (runnerData->recentError != NULL) { + clearRecentError(); + fail("Expected recentError to be NULL."); + } +} + +/** Tests that {@link #assertEquals()} with unequal values sets recentError. + * The strange formatting is intentional for <a href="https://sourceforge.net/tracker/index.php?func=detail&aid=1887942&group_id=207094&atid=1000227">[ 1887942 ] Java Generator does not detect wrongly formatted test source</a> + */ +A_Test +void +testAssertEqualsWithUnequalSetsRecentError + + +() { + bool recentErrorSet = false; + + myTestCaseCount++; + clearRecentError(); + helper(8); + if (runnerData->recentError != NULL) { + recentErrorSet = true; + } + clearRecentError(); + if (!recentErrorSet) { + fail("Expected recentError to be set."); + } +} Property changes on: trunk/src/native/test/cplusplus/AceUnitTest.c ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/src/native/test/cplusplus/Makefile =================================================================== --- trunk/src/native/test/cplusplus/Makefile (rev 0) +++ trunk/src/native/test/cplusplus/Makefile 2008-11-21 23:55:20 UTC (rev 453) @@ -0,0 +1,70 @@ +LOGGER=FullPlainLogger +# It looks strange defining CC to a CXX compiler, but that's intentional: +# This testcase tests if AceUnit also works fine if somebody uses a C++ compiler to compile AceUnit C code. +CC=g++ + +ACE_UNIT_PATH=../../.. +ACE_UNIT_JAVA_SRC=$(shell find $(ACE_UNIT_PATH)/java/src -name "*.java") + +LINT=splint + +PARTS=\ + AceUnit \ + AceUnitData \ + $(LOGGER) \ + +VPATH=$(ACE_UNIT_PATH)/native + +OBJECTS=$(addsuffix .o,$(PARTS)) + +LINTOUTS=$(addsuffix .ln,$(PARTS)) + +CPPFLAGS=-DACEUNIT_CONFIG_FILE=\"AceUnitConfig.h\" -I . -I $(ACE_UNIT_PATH)/native + +C_and_LD_FLAGS=-fprofile-arcs + +CFLAGS=-fdiagnostics-show-option -pedantic $(C_and_LD_FLAGS) -ftest-coverage -W -Wall -g + +SOURCES=$(sort $(shell find . -name "*.c")) +SUITES:=$(shell java -jar $(ACE_UNIT_PATH)/java/AceUnit.jar .) +SOURCES+=$(SUITES) +OBJECTS+=$(patsubst %.c,%.o,$(SOURCES)) +HEADERS=$(SOURCES:.c=.h) +DEPENDS=$(patsubst %.o,%.d,$(OBJECTS)) +GCOV=$(patsubst %.o,%.gcov,$(OBJECTS)) +GCNO=$(patsubst %.o,%.gcno,$(OBJECTS)) +GCDA=$(patsubst %.o,%.gcda,$(OBJECTS)) + +LDFLAGS=$(C_and_LD_FLAGS) + +LINTFLAGS=-badflag -weak + +.PHONY : all +all: test + +RunTests: $(OBJECTS) + +$(ACE_UNIT_PATH)/java/AceUnit.jar: $(ACE_UNIT_JAVA_SRC) + ant -f $(ACE_UNIT_PATH)/java/build.xml + +%.d: %.c + $(CPP) -M -MM -MG $(CPPFLAGS) $< | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' > $@ + +coverage: test + gcov *.c + +test: RunTests + ./RunTests + +.PHONY : clean +clean: + rm -f $(OBJECTS) $(HEADERS) $(DEPENDS) RunTests $(GCOV) $(GCNO) $(GCDA) $(SUITES) + +.PHONY : lint +lint: $(LINTOUTS) + +$(OBJECTS) $(OBJECTS:.o=.d): Makefile + +ifneq ($(MAKECMDGOALS),clean) +-include $(OBJECTS:.o=.d) +endif Property changes on: trunk/src/native/test/cplusplus/Makefile ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/src/native/test/cplusplus/RunTests.c =================================================================== --- trunk/src/native/test/cplusplus/RunTests.c (rev 0) +++ trunk/src/native/test/cplusplus/RunTests.c 2008-11-21 23:55:20 UTC (rev 453) @@ -0,0 +1,75 @@ +/* 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. + */ + +/** Test executor for AceUnit unit test "basicEmbedded". + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @file + */ + +#include <stdbool.h> +#include <stdio.h> + +#include "AceUnitData.h" + +extern const TestFixture_t AceUnitTestFixture; + +/** 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 12 + +/** The number of test cases that were executed. + * This looks redundant with runnerData->testCaseCount but actually it is not. + * It might be the case that the runner mistakenly executes the wrong methods, e.g. when the generator finds the wrong methods. + */ +extern int myTestCaseCount; + +/** 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(&AceUnitTestFixture); + if (runnerData->testCaseFailureCount != 0) { + fprintf(stderr, "Test Cases: %d Errors: %d\n", runnerData->testCaseCount, 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; + } + if (myTestCaseCount != TEST_CASES_FOR_VERIFICATION) { + fprintf(stderr, "Test Cases really executed: %d but expected %d\n", myTestCaseCount, TEST_CASES_FOR_VERIFICATION); + retVal = 1; + } + return retVal; +} Property changes on: trunk/src/native/test/cplusplus/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-11-21 23:18:02
|
Revision: 452 http://aceunit.svn.sourceforge.net/aceunit/?rev=452&view=rev Author: christianhujer Date: 2008-11-21 23:17:58 +0000 (Fri, 21 Nov 2008) Log Message: ----------- #2321207 Suite.c should have distinguishable name Modified Paths: -------------- trunk/src/java/src/prj/net/sf/aceunit/GenTest.java trunk/src/native/test/basic/Makefile trunk/src/native/test/basicEmbedded/Makefile trunk/src/native/test/comment/Makefile trunk/src/native/test/group/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 trunk/src/native/test/xmlLog/Makefile Modified: trunk/src/java/src/prj/net/sf/aceunit/GenTest.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/GenTest.java 2008-11-14 01:21:32 UTC (rev 451) +++ trunk/src/java/src/prj/net/sf/aceunit/GenTest.java 2008-11-21 23:17:58 UTC (rev 452) @@ -147,7 +147,8 @@ containedFixture |= performFixture(base, pckg, fixtureFile); } if (containedFixture) { - final File hFile = new File(pckgDir, "Suite.c"); + final File hFile = new File(pckgDir, "Suite" + pckg.getId() + ".c"); + System.out.println(hFile); final String hSource = pckg.getCode("foo"); SourceFiles.writeIfChanged(hFile, hSource, force); } @@ -167,6 +168,9 @@ * @throws IOException In case of I/O problems. */ private boolean performFixture(@NotNull final File base, @NotNull final Pckg pckg, @NotNull final File fixtureFile) throws IOException { + if (fixtureFile.getName().matches("Suite\\d+\\.c")) { + return false; + } final String fixtureName = fixtureFile.getName().replaceAll("\\.c$", ""); final Fixture fixture = new Fixture(idGenerator.getNextId(), fixtureFile); final boolean containedFixture = fixture.containsTests(); Modified: trunk/src/native/test/basic/Makefile =================================================================== --- trunk/src/native/test/basic/Makefile 2008-11-14 01:21:32 UTC (rev 451) +++ trunk/src/native/test/basic/Makefile 2008-11-21 23:17:58 UTC (rev 452) @@ -1,10 +1,8 @@ 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 .) LINT=splint @@ -12,7 +10,6 @@ AceUnit \ AceUnitData \ $(LOGGER) \ - $(FIXTURE_NAMES) VPATH=$(ACE_UNIT_PATH)/native @@ -26,6 +23,16 @@ CFLAGS=-fdiagnostics-show-option -std=$(CVERSION) -pedantic $(C_and_LD_FLAGS) -ftest-coverage -W -Wall -g +SOURCES=$(sort $(shell find . -name "*.c")) +SUITES:=$(shell java -jar $(ACE_UNIT_PATH)/java/AceUnit.jar .) +SOURCES+=$(SUITES) +OBJECTS+=$(patsubst %.c,%.o,$(SOURCES)) +HEADERS=$(SOURCES:.c=.h) +DEPENDS=$(patsubst %.o,%.d,$(OBJECTS)) +GCOV=$(patsubst %.o,%.gcov,$(OBJECTS)) +GCNO=$(patsubst %.o,%.gcno,$(OBJECTS)) +GCDA=$(patsubst %.o,%.gcda,$(OBJECTS)) + LDFLAGS=$(C_and_LD_FLAGS) LINTFLAGS=-badflag -weak @@ -49,7 +56,7 @@ .PHONY : clean clean: - rm -f $(addsuffix .h, $(FIXTURE_NAMES)) RunTests *.gcov *.gcno *.gcda *.o *.d Suite.c + rm -f $(OBJECTS) $(HEADERS) $(DEPENDS) RunTests $(GCOV) $(GCNO) $(GCDA) $(SUITES) .PHONY : lint lint: $(LINTOUTS) Modified: trunk/src/native/test/basicEmbedded/Makefile =================================================================== --- trunk/src/native/test/basicEmbedded/Makefile 2008-11-14 01:21:32 UTC (rev 451) +++ trunk/src/native/test/basicEmbedded/Makefile 2008-11-21 23:17:58 UTC (rev 452) @@ -1,10 +1,8 @@ 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 .) LINT=splint @@ -12,7 +10,6 @@ AceUnit \ AceUnitData \ $(LOGGER) \ - $(FIXTURE_NAMES) VPATH=$(ACE_UNIT_PATH)/native @@ -26,6 +23,16 @@ CFLAGS=-fdiagnostics-show-option -std=$(CVERSION) -pedantic $(C_and_LD_FLAGS) -ftest-coverage -W -Wall -g +SOURCES=$(sort $(shell find . -name "*.c")) +SUITES:=$(shell java -jar $(ACE_UNIT_PATH)/java/AceUnit.jar .) +SOURCES+=$(SUITES) +OBJECTS+=$(patsubst %.c,%.o,$(SOURCES)) +HEADERS=$(SOURCES:.c=.h) +DEPENDS=$(patsubst %.o,%.d,$(OBJECTS)) +GCOV=$(patsubst %.o,%.gcov,$(OBJECTS)) +GCNO=$(patsubst %.o,%.gcno,$(OBJECTS)) +GCDA=$(patsubst %.o,%.gcda,$(OBJECTS)) + LDFLAGS=$(C_and_LD_FLAGS) LINTFLAGS=-badflag -weak @@ -49,7 +56,7 @@ .PHONY : clean clean: - rm -f $(addsuffix .h, $(FIXTURE_NAMES)) RunTests *.gcov *.gcno *.gcda *.o *.d Suite.c + rm -f $(OBJECTS) $(HEADERS) $(DEPENDS) RunTests $(GCOV) $(GCNO) $(GCDA) $(SUITES) .PHONY : lint lint: $(LINTOUTS) Modified: trunk/src/native/test/comment/Makefile =================================================================== --- trunk/src/native/test/comment/Makefile 2008-11-14 01:21:32 UTC (rev 451) +++ trunk/src/native/test/comment/Makefile 2008-11-21 23:17:58 UTC (rev 452) @@ -1,10 +1,8 @@ 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 .) LINT=splint @@ -12,7 +10,6 @@ AceUnit \ AceUnitData \ $(LOGGER) \ - $(FIXTURE_NAMES) VPATH=$(ACE_UNIT_PATH)/native @@ -26,6 +23,16 @@ CFLAGS=-fdiagnostics-show-option -std=$(CVERSION) -pedantic $(C_and_LD_FLAGS) -ftest-coverage -W -Wall -g +SOURCES=$(sort $(shell find . -name "*.c")) +SUITES:=$(shell java -jar $(ACE_UNIT_PATH)/java/AceUnit.jar .) +SOURCES+=$(SUITES) +OBJECTS+=$(patsubst %.c,%.o,$(SOURCES)) +HEADERS=$(SOURCES:.c=.h) +DEPENDS=$(patsubst %.o,%.d,$(OBJECTS)) +GCOV=$(patsubst %.o,%.gcov,$(OBJECTS)) +GCNO=$(patsubst %.o,%.gcno,$(OBJECTS)) +GCDA=$(patsubst %.o,%.gcda,$(OBJECTS)) + LDFLAGS=$(C_and_LD_FLAGS) LINTFLAGS=-badflag -weak @@ -49,7 +56,7 @@ .PHONY : clean clean: - rm -f $(addsuffix .h, $(FIXTURE_NAMES)) RunTests *.gcov *.gcno *.gcda *.o *.d Suite.c + rm -f $(OBJECTS) $(HEADERS) $(DEPENDS) RunTests $(GCOV) $(GCNO) $(GCDA) $(SUITES) .PHONY : lint lint: $(LINTOUTS) Modified: trunk/src/native/test/group/Makefile =================================================================== --- trunk/src/native/test/group/Makefile 2008-11-14 01:21:32 UTC (rev 451) +++ trunk/src/native/test/group/Makefile 2008-11-21 23:17:58 UTC (rev 452) @@ -1,10 +1,8 @@ LOGGER=FullPlainLogger -FIXTURE_NAMES=GroupTest 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 .) LINT=splint @@ -12,7 +10,6 @@ AceUnit \ AceUnitData \ $(LOGGER) \ - $(FIXTURE_NAMES) VPATH=$(ACE_UNIT_PATH)/native @@ -26,6 +23,16 @@ CFLAGS=-fdiagnostics-show-option -std=$(CVERSION) -pedantic $(C_and_LD_FLAGS) -ftest-coverage -W -Wall -g +SOURCES=$(sort $(shell find . -name "*.c")) +SUITES:=$(shell java -jar $(ACE_UNIT_PATH)/java/AceUnit.jar .) +SOURCES+=$(SUITES) +OBJECTS+=$(patsubst %.c,%.o,$(SOURCES)) +HEADERS=$(SOURCES:.c=.h) +DEPENDS=$(patsubst %.o,%.d,$(OBJECTS)) +GCOV=$(patsubst %.o,%.gcov,$(OBJECTS)) +GCNO=$(patsubst %.o,%.gcno,$(OBJECTS)) +GCDA=$(patsubst %.o,%.gcda,$(OBJECTS)) + LDFLAGS=$(C_and_LD_FLAGS) LINTFLAGS=-badflag -weak @@ -49,7 +56,7 @@ .PHONY : clean clean: - rm -f $(addsuffix .h, $(FIXTURE_NAMES)) RunTests *.gcov *.gcno *.gcda *.o *.d Suite.c + rm -f $(OBJECTS) $(HEADERS) $(DEPENDS) RunTests $(GCOV) $(GCNO) $(GCDA) $(SUITES) .PHONY : lint lint: $(LINTOUTS) Modified: trunk/src/native/test/longjmp/Makefile =================================================================== --- trunk/src/native/test/longjmp/Makefile 2008-11-14 01:21:32 UTC (rev 451) +++ trunk/src/native/test/longjmp/Makefile 2008-11-21 23:17:58 UTC (rev 452) @@ -1,10 +1,8 @@ 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 .) LINT=splint @@ -12,7 +10,6 @@ AceUnit \ AceUnitData \ $(LOGGER) \ - $(FIXTURE_NAMES) VPATH=$(ACE_UNIT_PATH)/native @@ -26,6 +23,16 @@ CFLAGS=-fdiagnostics-show-option -std=$(CVERSION) -pedantic $(C_and_LD_FLAGS) -ftest-coverage -W -Wall -g +SOURCES=$(sort $(shell find . -name "*.c")) +SUITES:=$(shell java -jar $(ACE_UNIT_PATH)/java/AceUnit.jar .) +SOURCES+=$(SUITES) +OBJECTS+=$(patsubst %.c,%.o,$(SOURCES)) +HEADERS=$(SOURCES:.c=.h) +DEPENDS=$(patsubst %.o,%.d,$(OBJECTS)) +GCOV=$(patsubst %.o,%.gcov,$(OBJECTS)) +GCNO=$(patsubst %.o,%.gcno,$(OBJECTS)) +GCDA=$(patsubst %.o,%.gcda,$(OBJECTS)) + LDFLAGS=$(C_and_LD_FLAGS) LINTFLAGS=-badflag -weak @@ -49,7 +56,7 @@ .PHONY : clean clean: - rm -f $(addsuffix .h, $(FIXTURE_NAMES)) RunTests *.gcov *.gcno *.gcda *.o *.d Suite.c + rm -f $(OBJECTS) $(HEADERS) $(DEPENDS) RunTests $(GCOV) $(GCNO) $(GCDA) $(SUITES) .PHONY : lint lint: $(LINTOUTS) Modified: trunk/src/native/test/loop/Makefile =================================================================== --- trunk/src/native/test/loop/Makefile 2008-11-14 01:21:32 UTC (rev 451) +++ trunk/src/native/test/loop/Makefile 2008-11-21 23:17:58 UTC (rev 452) @@ -1,10 +1,8 @@ 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 .) LINT=splint @@ -12,7 +10,6 @@ AceUnit \ AceUnitData \ $(LOGGER) \ - $(FIXTURE_NAMES) VPATH=$(ACE_UNIT_PATH)/native @@ -26,6 +23,16 @@ CFLAGS=-fdiagnostics-show-option -std=$(CVERSION) -pedantic $(C_and_LD_FLAGS) -ftest-coverage -W -Wall -g +SOURCES=$(sort $(shell find . -name "*.c")) +SUITES:=$(shell java -jar $(ACE_UNIT_PATH)/java/AceUnit.jar .) +SOURCES+=$(SUITES) +OBJECTS+=$(patsubst %.c,%.o,$(SOURCES)) +HEADERS=$(SOURCES:.c=.h) +DEPENDS=$(patsubst %.o,%.d,$(OBJECTS)) +GCOV=$(patsubst %.o,%.gcov,$(OBJECTS)) +GCNO=$(patsubst %.o,%.gcno,$(OBJECTS)) +GCDA=$(patsubst %.o,%.gcda,$(OBJECTS)) + LDFLAGS=$(C_and_LD_FLAGS) LINTFLAGS=-badflag -weak @@ -49,7 +56,7 @@ .PHONY : clean clean: - rm -f $(addsuffix .h, $(FIXTURE_NAMES)) RunTests *.gcov *.gcno *.gcda *.o *.d Suite.c + rm -f $(OBJECTS) $(HEADERS) $(DEPENDS) RunTests $(GCOV) $(GCNO) $(GCDA) $(SUITES) .PHONY : lint lint: $(LINTOUTS) Modified: trunk/src/native/test/recursive/Makefile =================================================================== --- trunk/src/native/test/recursive/Makefile 2008-11-14 01:21:32 UTC (rev 451) +++ trunk/src/native/test/recursive/Makefile 2008-11-21 23:17:58 UTC (rev 452) @@ -1,11 +1,8 @@ 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") -$(shell java -jar $(ACE_UNIT_PATH)/java/AceUnit.jar .) LINT=splint @@ -27,7 +24,8 @@ 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") +SUITES:=$(shell java -jar $(ACE_UNIT_PATH)/java/AceUnit.jar .) +SOURCES+=$(SUITES) OBJECTS+=$(patsubst %.c,%.o,$(SOURCES)) HEADERS=$(SOURCES:.c=.h) DEPENDS=$(patsubst %.o,%.d,$(OBJECTS)) Modified: trunk/src/native/test/twoFixtures/Makefile =================================================================== --- trunk/src/native/test/twoFixtures/Makefile 2008-11-14 01:21:32 UTC (rev 451) +++ trunk/src/native/test/twoFixtures/Makefile 2008-11-21 23:17:58 UTC (rev 452) @@ -1,19 +1,15 @@ 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 .) LINT=splint PARTS=\ AceUnit \ AceUnitData \ - RunTests \ $(LOGGER) \ - $(FIXTURE_NAMES) VPATH=$(ACE_UNIT_PATH)/native @@ -27,6 +23,16 @@ CFLAGS=-fdiagnostics-show-option -std=$(CVERSION) -pedantic $(C_and_LD_FLAGS) -ftest-coverage -W -Wall -g +SOURCES=$(sort $(shell find . -name "*.c")) +SUITES:=$(shell java -jar $(ACE_UNIT_PATH)/java/AceUnit.jar .) +SOURCES+=$(SUITES) +OBJECTS+=$(patsubst %.c,%.o,$(SOURCES)) +HEADERS=$(SOURCES:.c=.h) +DEPENDS=$(patsubst %.o,%.d,$(OBJECTS)) +GCOV=$(patsubst %.o,%.gcov,$(OBJECTS)) +GCNO=$(patsubst %.o,%.gcno,$(OBJECTS)) +GCDA=$(patsubst %.o,%.gcda,$(OBJECTS)) + LDFLAGS=$(C_and_LD_FLAGS) LINTFLAGS=-badflag -weak @@ -50,7 +56,7 @@ .PHONY : clean clean: - rm -f $(addsuffix .h, $(FIXTURE_NAMES)) RunTests *.gcov *.gcno *.gcda *.o *.d Suite.c + rm -f $(OBJECTS) $(HEADERS) $(DEPENDS) RunTests $(GCOV) $(GCNO) $(GCDA) $(SUITES) .PHONY : lint lint: $(LINTOUTS) Modified: trunk/src/native/test/xmlLog/Makefile =================================================================== --- trunk/src/native/test/xmlLog/Makefile 2008-11-14 01:21:32 UTC (rev 451) +++ trunk/src/native/test/xmlLog/Makefile 2008-11-21 23:17:58 UTC (rev 452) @@ -1,63 +1,68 @@ LOGGER=JUnitXmlLogger +CVERSION=c89 -ACE_UNIT_FILES=AceUnit.c AceUnit.h AceUnitData.c AceUnitData.h AceUnitAnnotations.h AceUnitLogging.h $(LOGGER).c AceUnit.jar - -ACE_UNIT_PATH=../../../ - +ACE_UNIT_PATH=../../.. ACE_UNIT_JAVA_SRC=$(shell find $(ACE_UNIT_PATH)/java/src -name "*.java") -FIXTURE_NAME=XmlLogTest +LINT=splint -CFLAGS=-DACEUNIT_CONFIG_FILE=\"AceUnitConfig.h\" +PARTS=\ + AceUnit \ + AceUnitData \ + $(LOGGER) \ -all: prepare compile test +VPATH=$(ACE_UNIT_PATH)/native -clean: - rm -f $(ACE_UNIT_FILES) $(FIXTURE_NAME).h runTests *.gcov *.gcno *.gcda TESTS-TestSuites.xml +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=$(CVERSION) -pedantic $(C_and_LD_FLAGS) -ftest-coverage -W -Wall -g -AceUnitData.h: $(ACE_UNIT_PATH)/native/AceUnitData.h - cp $< $@ +SOURCES=$(sort $(shell find . -name "*.c")) +SUITES:=$(shell java -jar $(ACE_UNIT_PATH)/java/AceUnit.jar .) +SOURCES+=$(SUITES) +OBJECTS+=$(patsubst %.c,%.o,$(SOURCES)) +HEADERS=$(SOURCES:.c=.h) +DEPENDS=$(patsubst %.o,%.d,$(OBJECTS)) +GCOV=$(patsubst %.o,%.gcov,$(OBJECTS)) +GCNO=$(patsubst %.o,%.gcno,$(OBJECTS)) +GCDA=$(patsubst %.o,%.gcda,$(OBJECTS)) -AceUnitAnnotations.h: $(ACE_UNIT_PATH)/native/AceUnitAnnotations.h - cp $< $@ +LDFLAGS=$(C_and_LD_FLAGS) -AceUnitLogging.h: $(ACE_UNIT_PATH)/native/AceUnitLogging.h - cp $< $@ +LINTFLAGS=-badflag -weak -$(LOGGER).c: $(ACE_UNIT_PATH)/native/$(LOGGER).c - cp $< $@ +.PHONY : all +all: test -AceUnit.jar: $(ACE_UNIT_PATH)/java/AceUnit.jar - cp $(ACE_UNIT_PATH)/java/AceUnit.jar $@ +RunTests: $(OBJECTS) $(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 $(OBJECTS) $(HEADERS) $(DEPENDS) RunTests $(GCOV) $(GCNO) $(GCDA) $(SUITES) -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 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-14 01:21:42
|
Revision: 451 http://aceunit.svn.sourceforge.net/aceunit/?rev=451&view=rev Author: christianhujer Date: 2008-11-14 01:21:32 +0000 (Fri, 14 Nov 2008) Log Message: ----------- Added note about runTests. Modified Paths: -------------- trunk/src/native/AceUnit.c Modified: trunk/src/native/AceUnit.c =================================================================== --- trunk/src/native/AceUnit.c 2008-11-14 00:50:16 UTC (rev 450) +++ trunk/src/native/AceUnit.c 2008-11-14 01:21:32 UTC (rev 451) @@ -266,11 +266,14 @@ } } -/** Runs the specified test cases. - * @param testCases test cases to run, terminated with zero. +/** Runs the specified tests. + * All tests (test cases and suites - fixtures as well as packages) share the same number space. + * With other words, the number for a test case is unique (within where you run AceUnit.jar). + * That means you can specify test suites, fixtures or tests. + * @param tests tests to run, terminated with zero. */ void runTests(AceTestId_t *tests) { - /* TODO */ + /* TODO not implemented yet - design and tests not finished. */ } /* TODO: Add method to run specified test cases from a test fixture. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-14 00:50:18
|
Revision: 450 http://aceunit.svn.sourceforge.net/aceunit/?rev=450&view=rev Author: christianhujer Date: 2008-11-14 00:50:16 +0000 (Fri, 14 Nov 2008) Log Message: ----------- Creating release tag 0.8.0 for branch 0.8. Added Paths: ----------- tags/0.8.0/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-14 00:49:35
|
Revision: 449 http://aceunit.svn.sourceforge.net/aceunit/?rev=449&view=rev Author: christianhujer Date: 2008-11-14 00:49:32 +0000 (Fri, 14 Nov 2008) Log Message: ----------- Creating branch for 0.8. Added Paths: ----------- branches/0.8/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-14 00:41:51
|
Revision: 448 http://aceunit.svn.sourceforge.net/aceunit/?rev=448&view=rev Author: christianhujer Date: 2008-11-14 00:41:47 +0000 (Fri, 14 Nov 2008) Log Message: ----------- Implemented group feature. The implementation isn't nice yet, but it works. Modified Paths: -------------- trunk/src/java/src/prj/net/sf/aceunit/Fixture.java trunk/src/java/src/prj/net/sf/aceunit/MethodList.java trunk/src/native/AceUnit.c trunk/src/native/AceUnit.h trunk/src/native/test/Makefile trunk/src/native/test/group/AceUnitConfig.h trunk/src/native/test/group/RunTests.c Modified: trunk/src/java/src/prj/net/sf/aceunit/Fixture.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/Fixture.java 2008-11-13 00:04:05 UTC (rev 447) +++ trunk/src/java/src/prj/net/sf/aceunit/Fixture.java 2008-11-14 00:41:47 UTC (rev 448) @@ -66,8 +66,11 @@ /** The list of {@code @Loop} methods. */ private final MethodList2 loopMethods = MethodList.createLoopMethodList(); + /** The list of {@code @Group} methods. */ + private final MethodList2 groupMethods = MethodList.createGroupMethodList(); + /** All method lists for easy iteration. */ - private final List<MethodList> methodLists = Arrays.asList(testMethods, beforeMethods, afterMethods, beforeClassMethods, afterClassMethods, ignoreMethods, loopMethods); + private final List<MethodList> methodLists = Arrays.asList(testMethods, beforeMethods, afterMethods, beforeClassMethods, afterClassMethods, ignoreMethods, loopMethods, groupMethods); /** All method lists for used methods for easy iteration. */ private final List<MethodList> usedMethodLists = Arrays.asList(testMethods, beforeMethods, afterMethods, beforeClassMethods, afterClassMethods); @@ -151,6 +154,7 @@ out.format("%s%n", getTestMethodIds()); out.format("%s%n", getTestLoops()); + out.format("%s%n", getTestGroups()); for (final MethodList methods : usedMethodLists) { out.format("%s%n", methods.getFunctionPointerList()); @@ -186,6 +190,9 @@ out.format("#ifdef ACEUNIT_LOOP%n"); out.format(" loops,%n"); out.format("#endif%n"); + out.format("#ifdef ACEUNIT_GROUP%n"); + out.format(" groups,%n"); + out.format("#endif%n"); out.format(" testCases,%n"); out.format(" before,%n"); out.format(" after,%n"); @@ -245,7 +252,7 @@ } /** Returns a String with the loop information for the test method ids. - * @return Source code with the loop informatino. + * @return Source code with the loop information. */ public String getTestLoops() { final Formatter out = new Formatter(); @@ -260,4 +267,19 @@ return out.toString(); } + /** Returns a String with the group information for the test method ids. + * @return Source code with the group information. + */ + public String getTestGroups() { + final Formatter out = new Formatter(); + out.format("#ifdef ACEUNIT_GROUP%n"); + out.format("/** The groups of this fixture. */%n"); + out.format("static const AceGroupId_t groups[] = {%n"); + for (final String method : testMethods) { + out.format(" %s,%n", groupMethods.getArg(method)); // TODO Care about last comma? + } + out.format("};%n"); + out.format("#endif%n"); + return out.toString(); + } } // class MethodLists Modified: trunk/src/java/src/prj/net/sf/aceunit/MethodList.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/MethodList.java 2008-11-13 00:04:05 UTC (rev 447) +++ trunk/src/java/src/prj/net/sf/aceunit/MethodList.java 2008-11-14 00:41:47 UTC (rev 448) @@ -151,6 +151,14 @@ } /** + * Creates a MethodList for A_Group. + * @return MethodList for A_Group + */ + public static MethodList2 createGroupMethodList() { + return new MethodList2("A_Group", "group", "groups of methods.", "0"); + } + + /** * Returns the annotation this MethodList was created for. * * @return The annotation this MethodList was created for. Modified: trunk/src/native/AceUnit.c =================================================================== --- trunk/src/native/AceUnit.c 2008-11-13 00:04:05 UTC (rev 447) +++ trunk/src/native/AceUnit.c 2008-11-14 00:41:47 UTC (rev 448) @@ -63,8 +63,13 @@ /** Runs all test cases from a test fixture. * @param fixture Test fixture to run. + * @param group Group to run. */ -void runFixture(const TestFixture_t *const fixture) { +void runFixture(const TestFixture_t *const fixture +#ifdef ACEUNIT_GROUP + , AceGroupId_t group +#endif + ) { #define invokeAll(X) for (secondary = fixture->X; NULL != *secondary; secondary++) {\ (*secondary)();\ } @@ -78,73 +83,97 @@ const aceunit_loop_t *loopMax; aceunit_loop_t currentLoop; #endif +#ifdef ACEUNIT_GROUP + const AceGroupId_t *groups; +#endif + bool ranBeforeClass; #ifdef ACEUNIT_LOG_FIXTURE globalLog(fixtureStarted, fixture->id); #endif + for ( + testCase = fixture->testCase, +#ifdef ACEUNIT_LOOP + loopMax = fixture->loops, +#endif +#ifdef ACEUNIT_GROUP + groups = fixture->groups, +#endif + testId = fixture->testIds; + NULL != *testCase; + testCase++, +#ifdef ACEUNIT_LOOP + loopMax++, +#endif +#ifdef ACEUNIT_GROUP + groups++, +#endif + testId++ + ) { +#ifdef ACEUNIT_GROUP + if (*groups == group) { +#endif + if (!ranBeforeClass) { #ifdef ACEUNIT_PRE_BEFORECLASS - ACEUNIT_PRE_BEFORECLASS + ACEUNIT_PRE_BEFORECLASS #endif - invokeAll(beforeClass); + invokeAll(beforeClass); #ifdef ACEUNIT_POST_BEFORECLASS - ACEUNIT_POST_BEFORECLASS + ACEUNIT_POST_BEFORECLASS #endif - for (testCase = fixture->testCase, -#ifdef ACEUNIT_LOOP - loopMax = fixture->loops, -#endif - testId = fixture->testIds; - NULL != *testCase; - testCase++, testId++) { - runnerData->currentTestId = *testId; + ranBeforeClass = true; + } + runnerData->currentTestId = *testId; #ifdef ACEUNIT_LOG_TESTCASE - globalLog(testCaseStarted, runnerData->currentTestId); + globalLog(testCaseStarted, runnerData->currentTestId); #endif #ifdef ACEUNIT_PRE_BEFORE - ACEUNIT_PRE_BEFORE + ACEUNIT_PRE_BEFORE #endif - invokeAll(before); + invokeAll(before); #ifdef ACEUNIT_POST_BEFORE - ACEUNIT_POST_BEFORE + ACEUNIT_POST_BEFORE #endif - runnerData->recentError = NULL; + runnerData->recentError = NULL; #ifdef ACEUNIT_PRE_TEST - ACEUNIT_PRE_TEST + ACEUNIT_PRE_TEST #endif #if ACEUNIT_ASSERTION_STYLE == ACEUNIT_ASSERTION_STYLE_LONGJMP - if (0 == setjmp(aceunitJmpBuf)) { + if (0 == setjmp(aceunitJmpBuf)) { #endif #ifdef ACEUNIT_LOOP - for (currentLoop = 0; (currentLoop < *loopMax) && (NULL == runnerData->recentError); currentLoop++) { + for (currentLoop = 0; (currentLoop < *loopMax) && (NULL == runnerData->recentError); currentLoop++) { #endif - (*testCase)(); + (*testCase)(); #ifdef ACEUNIT_LOOP - } + } #endif #if ACEUNIT_ASSERTION_STYLE == ACEUNIT_ASSERTION_STYLE_LONGJMP - } + } #endif #ifdef ACEUNIT_POST_TEST - ACEUNIT_POST_TEST + ACEUNIT_POST_TEST #endif - runnerData->testCaseCount++; - if (NULL != runnerData->recentError) { - globalLog(testCaseFailed, runnerData->recentError); - runnerData->testCaseFailureCount++; - } + runnerData->testCaseCount++; + if (NULL != runnerData->recentError) { + globalLog(testCaseFailed, runnerData->recentError); + runnerData->testCaseFailureCount++; + } + if (ranBeforeClass) { #ifdef ACEUNIT_PRE_AFTER - ACEUNIT_PRE_AFTER + ACEUNIT_PRE_AFTER #endif - invokeAll(after); + invokeAll(after); #ifdef ACEUNIT_POST_AFTER - ACEUNIT_POST_AFTER + ACEUNIT_POST_AFTER #endif + } #ifdef ACEUNIT_LOG_TESTCASE - globalLog(testCaseEnded, runnerData->currentTestId); + globalLog(testCaseEnded, runnerData->currentTestId); #endif - runnerData->currentTestId = TestCaseId_NULL; -#ifdef ACEUNIT_LOOP - loopMax++; + runnerData->currentTestId = TestCaseId_NULL; +#ifdef ACEUNIT_GROUP + } #endif } #ifdef ACEUNIT_PRE_AFTERCLASS @@ -164,17 +193,30 @@ /** Runs all test cases from the supplied fixtures. * @param fixtures Test fixtures to run (NULL terminated). */ -void runFixtures(const TestFixture_t *const fixtures[]) { +void runFixtures(const TestFixture_t *const fixtures[] +#ifdef ACEUNIT_GROUP + , AceGroupId_t group +#endif +) { while (NULL != *fixtures) { - runFixture(*fixtures); + runFixture(*fixtures +#ifdef ACEUNIT_GROUP + , group +#endif + ); fixtures++; } } /** Runs all test cases from the supplied suite. * @param suite Test suite to run. + * @param group Group to run. */ -void runSuite(const TestSuite_t *const suite) { +void runSuite(const TestSuite_t *const suite +#ifdef ACEUNIT_GROUP + , AceGroupId_t group +#endif +) { #define globalLog(X, Y) if ((NULL != globalLogger) && (NULL != globalLogger->X)) {\ globalLogger->X(Y);\ } @@ -186,11 +228,19 @@ if (suites != NULL) { /* this is a not a Fixture */ for (; NULL != *suites; suites++) { - runSuite(*suites); + runSuite(*suites +#ifdef ACEUNIT_GROUP + , group +#endif + ); } } else { /* this is a Fixture */ - runFixture((TestFixture_t *) suite); + runFixture((TestFixture_t *) suite +#ifdef ACEUNIT_GROUP + , group +#endif + ); } #ifdef ACEUNIT_LOG_SUITE globalLog(suiteEnded, suite->id); @@ -201,12 +251,27 @@ /** Runs all test cases from the supplied test suites. * @param suites Test suites to run (NULL terminated). */ -void runSuites(const TestSuite_t *const suites[]) { +void runSuites(const TestSuite_t *const suites[] +#ifdef ACEUNIT_GROUP + , AceGroupId_t group +#endif +) { while (NULL != *suites) { - runSuite(*suites); + runSuite(*suites +#ifdef ACEUNIT_GROUP + , group +#endif + ); suites++; } } +/** Runs the specified test cases. + * @param testCases test cases to run, terminated with zero. + */ +void runTests(AceTestId_t *tests) { + /* TODO */ +} + /* 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. */ Modified: trunk/src/native/AceUnit.h =================================================================== --- trunk/src/native/AceUnit.h 2008-11-13 00:04:05 UTC (rev 447) +++ trunk/src/native/AceUnit.h 2008-11-14 00:41:47 UTC (rev 448) @@ -221,6 +221,7 @@ #if ACEUNIT_C_MODE == ACEUNIT_C_MODE_C99_INCLUDES #include <stddef.h> #include <stdint.h> +#include <stdbool.h> #elif ACEUNIT_C_MODE == ACEUNIT_C_MODE_C89 #ifndef __int8_t_defined #define __int8_t_defined @@ -242,6 +243,16 @@ typedef long unsigned int size_t; #endif #endif +#ifndef __bool_true_false_are_defined +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +#define bool _Bool +#else +#define bool int +#endif +#define true 1 +#define false 0 +#define __bool_true_false_are_defined 1 +#endif #ifndef NULL /** Replacement for stddef.h NULL in case stddef.h is not available. */ #if defined(__cplusplus) @@ -385,6 +396,9 @@ /** TestId_t specifies a test. */ typedef uint16_t AceTestId_t; +/** GroupId_t specifies a group. */ +typedef uint16_t AceGroupId_t; + /** SuiteId_t specifies a test suite. * On embedded systems, this is a 16 bit quantity that uniquely identifies the test suite. * On normal systems, this is the directory name of the suite. @@ -574,6 +588,11 @@ const aceunit_loop_t *const loops; #endif +#ifdef ACEUNIT_GROUP + /** The test cases that shall be looped. */ + const AceGroupId_t *const groups; +#endif + /** The test cases of this test fixture. */ const testMethod_t *const testCase; @@ -599,12 +618,22 @@ /** Runs all test cases from a test fixture. * @param fixture Test fixture to run. + * @param group Group to run. */ -extern void runFixture(const TestFixture_t *const fixture); +extern void runFixture(const TestFixture_t *const fixture +#ifdef ACEUNIT_GROUP + , AceGroupId_t group +#endif +); /** Runs all test cases from a test suite. * @param suite Test suite to run. + * @param group Group to run. */ -extern void runSuite(const TestSuite_t *const suite); +extern void runSuite(const TestSuite_t *const suite +#ifdef ACEUNIT_GROUP + , AceGroupId_t group +#endif +); #endif /* ACEUNIT_H */ Modified: trunk/src/native/test/Makefile =================================================================== --- trunk/src/native/test/Makefile 2008-11-13 00:04:05 UTC (rev 447) +++ trunk/src/native/test/Makefile 2008-11-14 00:41:47 UTC (rev 448) @@ -3,6 +3,7 @@ basicEmbedded \ comment \ exhand \ + group \ longjmp \ loop \ recursive \ Modified: trunk/src/native/test/group/AceUnitConfig.h =================================================================== --- trunk/src/native/test/group/AceUnitConfig.h 2008-11-13 00:04:05 UTC (rev 447) +++ trunk/src/native/test/group/AceUnitConfig.h 2008-11-14 00:41:47 UTC (rev 448) @@ -1,2 +1,4 @@ /** Use return to exit a test case with a failed assertion. */ #define ACEUNIT_ASSERTION_STYLE ACEUNIT_ASSERTION_STYLE_RETURN + +#define ACEUNIT_GROUP Modified: trunk/src/native/test/group/RunTests.c =================================================================== --- trunk/src/native/test/group/RunTests.c 2008-11-13 00:04:05 UTC (rev 447) +++ trunk/src/native/test/group/RunTests.c 2008-11-14 00:41:47 UTC (rev 448) @@ -47,7 +47,7 @@ */ int main(void) { int retVal = 0; - runTestGroup(0); - runTestGroup(1); + runFixture(&GroupTestFixture, 0); + runFixture(&GroupTestFixture, 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-11-13 00:04:10
|
Revision: 447 http://aceunit.svn.sourceforge.net/aceunit/?rev=447&view=rev Author: christianhujer Date: 2008-11-13 00:04:05 +0000 (Thu, 13 Nov 2008) Log Message: ----------- Reintroduced strings to generated source code. Modified Paths: -------------- trunk/src/java/src/prj/net/sf/aceunit/Fixture.java trunk/src/native/AceUnit.c trunk/src/native/AceUnit.h Modified: trunk/src/java/src/prj/net/sf/aceunit/Fixture.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/Fixture.java 2008-11-12 23:45:35 UTC (rev 446) +++ trunk/src/java/src/prj/net/sf/aceunit/Fixture.java 2008-11-13 00:04:05 UTC (rev 447) @@ -179,7 +179,10 @@ out.format("#ifdef ACEUNIT_SUITES%n"); out.format(" NULL,%n"); out.format("#endif%n"); - out.format(" testId,%n"); + out.format(" testIds,%n"); + out.format("#ifndef ACEUNIT_EMBEDDED%n"); + out.format(" testNames,%n"); + out.format("#endif%n"); out.format("#ifdef ACEUNIT_LOOP%n"); out.format(" loops,%n"); out.format("#endif%n"); @@ -221,20 +224,23 @@ public String getTestMethodIds() { final Formatter out = new Formatter(); out.format("/** The test case ids of this fixture. */%n"); - out.format("static const TestCaseId_t testId[] = {%n"); -// out.format("#ifdef ACEUNIT_EMBEDDED%n"); + out.format("static const TestCaseId_t testIds[] = {%n"); int methodCount = 0; final String formatString = String.format(" %%%dd, /* %%s */%%n", (int) (Math.log10(testMethods.size()) + 1)); for (final String method : testMethods) { out.format(formatString, ++methodCount, method); } -// out.format("#else%n"); -// for (final String method : testMethods) { -// out.format(" \"%s\",%n", method); -// } -// out.format(" NULL%n"); -// out.format("#endif%n"); out.format("};%n"); + out.format("%n"); + + out.format("#ifndef ACEUNIT_EMBEDDED%n"); + out.format("/** The test names of this fixture. */%n"); + out.format("static const char *const testNames[] = {%n"); + for (final String method : testMethods) { + out.format(" \"%s\",%n", method); + } + out.format("};%n"); + out.format("#endif%n"); return out.toString(); } Modified: trunk/src/native/AceUnit.c =================================================================== --- trunk/src/native/AceUnit.c 2008-11-12 23:45:35 UTC (rev 446) +++ trunk/src/native/AceUnit.c 2008-11-13 00:04:05 UTC (rev 447) @@ -93,7 +93,7 @@ #ifdef ACEUNIT_LOOP loopMax = fixture->loops, #endif - testId = fixture->testId; + testId = fixture->testIds; NULL != *testCase; testCase++, testId++) { runnerData->currentTestId = *testId; Modified: trunk/src/native/AceUnit.h =================================================================== --- trunk/src/native/AceUnit.h 2008-11-12 23:45:35 UTC (rev 446) +++ trunk/src/native/AceUnit.h 2008-11-13 00:04:05 UTC (rev 447) @@ -551,7 +551,7 @@ #ifndef ACEUNIT_EMBEDDED /** The name of this fixture. */ - const char *name; + const char *const name; #endif #ifdef ACEUNIT_SUITES @@ -562,8 +562,13 @@ #endif /** The ids of the test cases of this test fixture. */ - const TestCaseId_t *const testId; + const TestCaseId_t *const testIds; +#ifndef ACEUNIT_EMBEDDED + /** The names of the test cases of this test fixture. */ + const char *const *const testNames; +#endif + #ifdef ACEUNIT_LOOP /** The test cases that shall be looped. */ const aceunit_loop_t *const loops; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-12 23:45:40
|
Revision: 446 http://aceunit.svn.sourceforge.net/aceunit/?rev=446&view=rev Author: christianhujer Date: 2008-11-12 23:45:35 +0000 (Wed, 12 Nov 2008) Log Message: ----------- Changed ID system to always use numeric ids. The strings will become optional but are temporarily unavailable now. Modified Paths: -------------- trunk/src/java/src/prj/net/sf/aceunit/Fixture.java trunk/src/java/src/prj/net/sf/aceunit/Pckg.java trunk/src/native/AceUnit.h trunk/src/native/FullPlainLogger.c trunk/src/native/JUnitXmlLogger.c Modified: trunk/src/java/src/prj/net/sf/aceunit/Fixture.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/Fixture.java 2008-11-12 20:33:05 UTC (rev 445) +++ trunk/src/java/src/prj/net/sf/aceunit/Fixture.java 2008-11-12 23:45:35 UTC (rev 446) @@ -140,14 +140,8 @@ out.format("#define _%s_H%n", ucaseFixture); out.format("%n"); - out.format("#ifndef A_FIXTURE_ID%n"); out.format("/** The id of this fixture. */%n"); - out.format("#ifdef ACEUNIT_EMBEDDED%n"); out.format("#define A_FIXTURE_ID %d%n", getId()); - out.format("#else%n"); - out.format("#define A_FIXTURE_ID \"%s\"%n", basename); - out.format("#endif%n"); - out.format("#endif%n"); out.format("%n"); out.format("#include \"AceUnit.h\"%n"); @@ -178,7 +172,10 @@ final Formatter out = new Formatter(); out.format("/** This fixture. */%n"); out.format("const TestFixture_t %sFixture = {%n", fixtureName); - out.format(" A_FIXTURE_ID,%n"); + out.format(" %d,%n", getId()); + out.format("#ifndef ACEUNIT_EMBEDDED%n"); + out.format(" \"%s\",%n", basename); + out.format("#endif%n"); out.format("#ifdef ACEUNIT_SUITES%n"); out.format(" NULL,%n"); out.format("#endif%n"); @@ -225,18 +222,18 @@ final Formatter out = new Formatter(); out.format("/** The test case ids of this fixture. */%n"); out.format("static const TestCaseId_t testId[] = {%n"); - out.format("#ifdef ACEUNIT_EMBEDDED%n"); +// out.format("#ifdef ACEUNIT_EMBEDDED%n"); int methodCount = 0; final String formatString = String.format(" %%%dd, /* %%s */%%n", (int) (Math.log10(testMethods.size()) + 1)); for (final String method : testMethods) { out.format(formatString, ++methodCount, method); } - out.format("#else%n"); - for (final String method : testMethods) { - out.format(" \"%s\",%n", method); - } - out.format(" NULL%n"); - out.format("#endif%n"); +// out.format("#else%n"); +// for (final String method : testMethods) { +// out.format(" \"%s\",%n", method); +// } +// out.format(" NULL%n"); +// out.format("#endif%n"); out.format("};%n"); return out.toString(); } Modified: trunk/src/java/src/prj/net/sf/aceunit/Pckg.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/Pckg.java 2008-11-12 20:33:05 UTC (rev 445) +++ trunk/src/java/src/prj/net/sf/aceunit/Pckg.java 2008-11-12 23:45:35 UTC (rev 446) @@ -99,9 +99,8 @@ out.format("};%n"); out.format("%n"); out.format("const TestSuite_t suite%d = {%n", getId()); - out.format("#ifdef ACEUNIT_EMBEDDED%n"); out.format(" %d,%n", getId()); - out.format("#else%n"); + out.format("#ifndef ACEUNIT_EMBEDDED%n"); out.format(" \"%s\",%n", basename); out.format("#endif%n"); out.format(" suitesOf%d%n", getId()); Modified: trunk/src/native/AceUnit.h =================================================================== --- trunk/src/native/AceUnit.h 2008-11-12 20:33:05 UTC (rev 445) +++ trunk/src/native/AceUnit.h 2008-11-12 23:45:35 UTC (rev 446) @@ -382,16 +382,15 @@ #error Unexpected internal error. #endif +/** TestId_t specifies a test. */ +typedef uint16_t AceTestId_t; + /** SuiteId_t specifies a test suite. * On embedded systems, this is a 16 bit quantity that uniquely identifies the test suite. * On normal systems, this is the directory name of the suite. * @note Fixtures also are Suites. */ -#ifdef ACEUNIT_EMBEDDED -typedef uint16_t SuiteId_t; -#else -typedef const char* SuiteId_t; -#endif +typedef AceTestId_t SuiteId_t; /** FixtureId_t specifies a test fixture. * On embedded systems, this is a 16 bit quantity that uniquely identifies the test fixture. @@ -403,18 +402,10 @@ * On embedded systems, this is a 16 bit quantity that uniquely identifies the test case within its fixture. * On normal systems, this is the function name of the test case. */ -#ifdef ACEUNIT_EMBEDDED -typedef uint16_t TestCaseId_t; -#else -typedef const char* TestCaseId_t; -#endif +typedef AceTestId_t TestCaseId_t; /** The value for something of type #TestCaseId_t for denoting no testcase. */ -#ifdef ACEUNIT_EMBEDDED #define TestCaseId_NULL 0 -#else -#define TestCaseId_NULL NULL -#endif /** The type to use for line numbers. */ #ifdef ACEUNIT_EMBEDDED @@ -445,7 +436,7 @@ #ifdef ACEUNIT_EMBEDDED #define newAssertionError(message) { AssertionId_t assertion = { __LINE__ }; recordError(A_FIXTURE_ID, assertion); } ACEUNIT_ABORT #else -#define newAssertionError(message) { AssertionId_t assertion = { __LINE__, message }; recordError(__FILE__, assertion); } ACEUNIT_ABORT +#define newAssertionError(message) { AssertionId_t assertion = { __LINE__, message }; recordError(A_FIXTURE_ID, assertion); } ACEUNIT_ABORT #endif /** Assertion Error. @@ -531,6 +522,11 @@ /** The Id of this suite. */ SuiteId_t const id; +#ifndef ACEUNIT_EMBEDDED + /** The name of this suite. */ + const char *name; +#endif + /** The suites that are contained in this suite. * If this Suite is a Fixture, this value is NULL. */ @@ -553,6 +549,11 @@ /** The Id of this fixture. */ FixtureId_t const id; +#ifndef ACEUNIT_EMBEDDED + /** The name of this fixture. */ + const char *name; +#endif + #ifdef ACEUNIT_SUITES /** The suites that are contained in this fixture. * This is a fixture, thus this value always is NULL. Modified: trunk/src/native/FullPlainLogger.c =================================================================== --- trunk/src/native/FullPlainLogger.c 2008-11-12 20:33:05 UTC (rev 445) +++ trunk/src/native/FullPlainLogger.c 2008-11-12 23:45:35 UTC (rev 446) @@ -48,7 +48,7 @@ #ifdef ACEUNIT_EMBEDDED #error "FullPlainLogger does not support embedded AceUnit." #else - printf("%s:%d: error: in %s: %s\n", recentError->fixtureId, recentError->assertionId.lineNumber, recentError->testId, recentError->assertionId.message); + printf("%d:%d: error: in %d: %s\n", recentError->fixtureId, recentError->assertionId.lineNumber, recentError->testId, recentError->assertionId.message); #endif } Modified: trunk/src/native/JUnitXmlLogger.c =================================================================== --- trunk/src/native/JUnitXmlLogger.c 2008-11-12 20:33:05 UTC (rev 445) +++ trunk/src/native/JUnitXmlLogger.c 2008-11-12 23:45:35 UTC (rev 446) @@ -97,7 +97,7 @@ /** Initializes suite-specific variables. * @see TestLogger_t#suiteStarted()} */ -static void suiteStarted() { +static void suiteStarted(SuiteId_t const suiteId) { suiteInfo.errors = 0; suiteInfo.failures = 0; suiteInfo.id = globalInfo.suiteId++; @@ -106,7 +106,7 @@ /** Initializes fixture-specific variables. * @see TestLogger_t#fixtureStarted()} */ -static void fixtureStarted(FixtureId_t fixture) { +static void fixtureStarted(const FixtureId_t fixture) { suiteInfo.package = NULL; /* TODO */ suiteInfo.name = NULL; /* TODO */ suiteInfo.tests = 0; /* TODO */ @@ -114,19 +114,19 @@ } /** @see TestLogger_t#testCaseStarted()} */ -static void testCaseStarted(const TestCaseId_t testCase) { +static void testCaseStarted(TestCaseId_t testCase) { } /** @see TestLogger_t#testCaseFailed()} */ -static void testCaseFailed(const AssertionError_t *const assertion) { +static void testCaseFailed(const AssertionError_t *assertion) { } /** @see TestLogger_t#testCaseEnded()} */ -static void testCaseEnded(const TestCaseId_t testCase) { +static void testCaseEnded(TestCaseId_t testCase) { } /** @see TestLogger_t#fixtureEnded()} */ -static void fixtureEnded() { +static void fixtureEnded(FixtureId_t fixture) { } /** Prints the environment as properties XML element to the specified file. @@ -163,7 +163,7 @@ } /** @see TestLogger_t#suiteEnded()} */ -static void suiteEnded() { +static void suiteEnded(SuiteId_t const suiteId) { 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"> */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-12 20:33:12
|
Revision: 445 http://aceunit.svn.sourceforge.net/aceunit/?rev=445&view=rev Author: christianhujer Date: 2008-11-12 20:33:05 +0000 (Wed, 12 Nov 2008) Log Message: ----------- Updated latest release version. Modified Paths: -------------- trunk/src/doc/start.xhtml Modified: trunk/src/doc/start.xhtml =================================================================== --- trunk/src/doc/start.xhtml 2008-11-12 20:31:12 UTC (rev 444) +++ trunk/src/doc/start.xhtml 2008-11-12 20:33:05 UTC (rev 445) @@ -20,7 +20,7 @@ </div> --> <p> - Latest release version: <strong>aceunit-0.6.1</strong> + Latest release version: <strong>aceunit-0.7.0</strong> </p> <h2>What is AceUnit?</h2> <!-- The description must match the project description at http://sourceforge.net/projects/aceunit/ --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-12 20:31:17
|
Revision: 444 http://aceunit.svn.sourceforge.net/aceunit/?rev=444&view=rev Author: christianhujer Date: 2008-11-12 20:31:12 +0000 (Wed, 12 Nov 2008) Log Message: ----------- Updated release script: Some improvements, and adoption to new file upload interface of SF.net. Modified Paths: -------------- release.sh Modified: release.sh =================================================================== --- release.sh 2008-11-12 11:49:37 UTC (rev 443) +++ release.sh 2008-11-12 20:31:12 UTC (rev 444) @@ -3,17 +3,26 @@ # TODO: Use freshmeat-submit # TODO: Support release levels -echo "Usage: ./release.sh <branch-name> <release-name> <email-address>" +if [ $# != 3 ] +then + echo "Usage: ./release.sh <branch-name> <release-name> <sf-username>" + exit 1 +fi -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 $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 $basename-src.* AceUnit-$2.jar +branchname=$1 +releasename=$2 +sfusername=$3 +mkdir -p uploads/ +basename=aceunit-$releasename +svn cp -m "Creating release tag $releasename for branch $branchname." https://aceunit.svn.sourceforge.net/svnroot/aceunit/branches/$branchname https://aceunit.svn.sourceforge.net/svnroot/aceunit/tags/$releasename +svn export http://aceunit.svn.sourceforge.net/svnroot/aceunit/tags/$releasename $basename +tar cjvf uploads/$basename-src.tar.bz2 $basename +tar czvf uploads/$basename-src.tar.gz $basename +zip -r uploads/$basename-src.zip $basename +(cd $basename/src/java ; ant) ; mv $basename/src/java/AceUnit.jar uploads/AceUnit-$releasename.jar +rsync -avPe ssh uploads/ $sfu...@fr...:uploads/ + echo echo "Upload done. Now create a new release at sourceforge and freshmeat, the mailing list and the forum." echo "SourceForge: http://sourceforge.net/project/admin/newrelease.php?package_id=247827&group_id=207094" @@ -23,5 +32,5 @@ echo "You should use the same description there." echo "The description should include the project description." echo "The normative project description is at: http://sourceforge.net/projects/aceunit/" -echo "Don't forget to update the homepage. cd to aceunit/src/doc, change start.xhtml and run ant uploadDoc." +echo "Don't forget to update the homepage. cd to trunk/src/doc, change start.xhtml and run ant uploadDoc." echo "Don't forget to update the bug tracker so users can report bugs to the correct release." This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-12 11:49:42
|
Revision: 443 http://aceunit.svn.sourceforge.net/aceunit/?rev=443&view=rev Author: christianhujer Date: 2008-11-12 11:49:37 +0000 (Wed, 12 Nov 2008) Log Message: ----------- Creating release tag 0.7.0 for branch 0.7. Added Paths: ----------- tags/0.7.0/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-12 11:46:10
|
Revision: 442 http://aceunit.svn.sourceforge.net/aceunit/?rev=442&view=rev Author: christianhujer Date: 2008-11-12 11:46:06 +0000 (Wed, 12 Nov 2008) Log Message: ----------- Creating branch for 0.7. Added Paths: ----------- branches/0.7/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-12 10:55:41
|
Revision: 441 http://aceunit.svn.sourceforge.net/aceunit/?rev=441&view=rev Author: christianhujer Date: 2008-11-12 10:55:37 +0000 (Wed, 12 Nov 2008) Log Message: ----------- Bug: backslash at end of eol comment must continue line. Fixed. Modified Paths: -------------- trunk/src/java/src/prj/net/sf/aceunit/CommentToWhitespaceReader.java trunk/src/java/src/tst/test/net/sf/aceunit/CommentToWhitespaceReaderTest.java Modified: trunk/src/java/src/prj/net/sf/aceunit/CommentToWhitespaceReader.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/CommentToWhitespaceReader.java 2008-11-12 10:43:29 UTC (rev 440) +++ trunk/src/java/src/prj/net/sf/aceunit/CommentToWhitespaceReader.java 2008-11-12 10:55:37 UTC (rev 441) @@ -53,6 +53,9 @@ /** A second slash was found, we are in an EOL comment now. */ EOL_COMMENT, + /** An escape was found in an EOL comment. */ + ESCAPE_IN_EOL_COMMENT, + /** An asterisk after a slash was found, we are in a multiline comment now. */ ML_COMMENT, @@ -172,6 +175,9 @@ } else if (c == '\r') { state = State.NORMAL; rc = c; + } else if (c == '\\') { + state = State.ESCAPE_IN_EOL_COMMENT; + rc = ' '; } else { state = State.EOL_COMMENT; rc = c == -1 ? c : ' '; @@ -246,6 +252,17 @@ state = State.STRING; rc = c; break; + case ESCAPE_IN_EOL_COMMENT: + if (c == '\n') { + state = State.EOL_COMMENT; + rc = c; + } else if (c == '\r') { + rc = c; + } else { + state = State.EOL_COMMENT; + rc = ' '; + } + break; default: throw new AssertionError("Missing case in above switch."); } Modified: trunk/src/java/src/tst/test/net/sf/aceunit/CommentToWhitespaceReaderTest.java =================================================================== --- trunk/src/java/src/tst/test/net/sf/aceunit/CommentToWhitespaceReaderTest.java 2008-11-12 10:43:29 UTC (rev 440) +++ trunk/src/java/src/tst/test/net/sf/aceunit/CommentToWhitespaceReaderTest.java 2008-11-12 10:55:37 UTC (rev 441) @@ -402,6 +402,33 @@ assertReplacement(orig, expe); } + /** Tests that a backslash at the end of a end of line comment continues the comment. + * @throws IOException In case of I/O problems (unexpected). + */ + @Test public void backslashAtEOLCommentContinuesLF() throws IOException { + final String orig = "foo //comment\\\ncomment"; + final String expe = "foo \n "; + assertReplacement(orig, expe); + } + + /** Tests that a backslash at the end of a end of line comment continues the comment. + * @throws IOException In case of I/O problems (unexpected). + */ + @Test public void backslashAtEOLCommentContinuesCR() throws IOException { + final String orig = "foo //comment\\\rcomment"; + final String expe = "foo \r "; + assertReplacement(orig, expe); + } + + /** Tests that a backslash at the end of a end of line comment continues the comment. + * @throws IOException In case of I/O problems (unexpected). + */ + @Test public void backslashAtEOLCommentContinuesCRLF() throws IOException { + final String orig = "foo //comment\\\r\ncomment"; + final String expe = "foo \r\n "; + assertReplacement(orig, expe); + } + /** Asserts that when reading the String <var>orig</var> through a {@link CommentToWhitespaceReader}, <var>expe</var> is returned. * @param orig Original String, will be passed through a {@link CommentToWhitespaceReader}. * @param expe Expected String, will be compared to the result of passing <var>orig</var> through a {@link CommentToWhitespaceReader}. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-12 10:43:34
|
Revision: 440 http://aceunit.svn.sourceforge.net/aceunit/?rev=440&view=rev Author: christianhujer Date: 2008-11-12 10:43:29 +0000 (Wed, 12 Nov 2008) Log Message: ----------- Fixed bug in tests: tests didn't compile. Modified Paths: -------------- trunk/src/java/src/prj/net/sf/aceunit/Fixture.java trunk/src/java/src/tst/test/net/sf/aceunit/FixtureTest.java trunk/src/java/src/tst/test/net/sf/aceunit/PckgTest.java Modified: trunk/src/java/src/prj/net/sf/aceunit/Fixture.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/Fixture.java 2008-11-12 10:21:29 UTC (rev 439) +++ trunk/src/java/src/prj/net/sf/aceunit/Fixture.java 2008-11-12 10:43:29 UTC (rev 440) @@ -34,6 +34,7 @@ import java.io.IOException; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * The Fixture represents a single test fixture along with all its methods. @@ -88,6 +89,21 @@ } /** + * Creates a Fixture with the specified id. + * + * @param id The id of this Fixture. + * @param file File to create fixture for. + * @param source The source of this Fixture. + */ + public Fixture(final int id, @Nullable final File file, @Nullable final String source) { + super(id); + if (source != null) { + findMethods(source); + } + this.fixtureName = file != null ? file.getName().replaceAll("\\.c$", "") : "dummy"; + } + + /** * Finds all methods of all method lists in the specified source. * * @param cSource C source to search. Modified: trunk/src/java/src/tst/test/net/sf/aceunit/FixtureTest.java =================================================================== --- trunk/src/java/src/tst/test/net/sf/aceunit/FixtureTest.java 2008-11-12 10:21:29 UTC (rev 439) +++ trunk/src/java/src/tst/test/net/sf/aceunit/FixtureTest.java 2008-11-12 10:43:29 UTC (rev 440) @@ -37,7 +37,7 @@ /** {@inheritDoc} */ public Fixture createSuite(final int id) { - return new Fixture(id, ""); + return new Fixture(id, null, null); } /** Dummy Test to workaround a bug in IntelliJ IDEA. */ Modified: trunk/src/java/src/tst/test/net/sf/aceunit/PckgTest.java =================================================================== --- trunk/src/java/src/tst/test/net/sf/aceunit/PckgTest.java 2008-11-12 10:21:29 UTC (rev 439) +++ trunk/src/java/src/tst/test/net/sf/aceunit/PckgTest.java 2008-11-12 10:43:29 UTC (rev 440) @@ -51,10 +51,10 @@ final Pckg pckg = new Pckg(2); testling.addSuite(pckg); Assert.assertFalse("After adding an empty package, a package is still empty.", testling.containsTests()); - final Fixture emptyFixture = new Fixture(3, ""); + final Fixture emptyFixture = new Fixture(3, null, ""); pckg.addSuite(emptyFixture); Assert.assertFalse("After adding a fixture with no test cases, a package is still empty.", testling.containsTests()); - final Fixture fixture = new Fixture(3, "A_Test void aTest() {\n}\n"); + final Fixture fixture = new Fixture(3, null, "A_Test void aTest() {\n}\n"); pckg.addSuite(fixture); Assert.assertTrue("After adding a fixture with test cases, a package is no longer empty.", testling.containsTests()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-12 10:21:33
|
Revision: 439 http://aceunit.svn.sourceforge.net/aceunit/?rev=439&view=rev Author: christianhujer Date: 2008-11-12 10:21:29 +0000 (Wed, 12 Nov 2008) Log Message: ----------- Added FIXME file for known bug in Makefile. Added Paths: ----------- trunk/src/native/test/recursive/FIXME Added: trunk/src/native/test/recursive/FIXME =================================================================== --- trunk/src/native/test/recursive/FIXME (rev 0) +++ trunk/src/native/test/recursive/FIXME 2008-11-12 10:21:29 UTC (rev 439) @@ -0,0 +1,3 @@ +The current makefile does not properly work incrementally. +The files in subdirectories are not remade. +There probably is a problem with the dependency generation. Property changes on: trunk/src/native/test/recursive/FIXME ___________________________________________________________________ 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-12 10:14:33
|
Revision: 438 http://aceunit.svn.sourceforge.net/aceunit/?rev=438&view=rev Author: christianhujer Date: 2008-11-12 10:14:28 +0000 (Wed, 12 Nov 2008) Log Message: ----------- Changed this test / example to make use of the Suites feature. Modified Paths: -------------- trunk/src/native/test/recursive/AceUnitConfig.h trunk/src/native/test/recursive/RunTests.c Modified: trunk/src/native/test/recursive/AceUnitConfig.h =================================================================== --- trunk/src/native/test/recursive/AceUnitConfig.h 2008-11-12 10:02:33 UTC (rev 437) +++ trunk/src/native/test/recursive/AceUnitConfig.h 2008-11-12 10:14:28 UTC (rev 438) @@ -1,2 +1,4 @@ /** Let AceUnit use its own C99 definitions. */ #define ACEUNIT_INTERNAL_ISO_TYPES + +#define ACEUNIT_SUITES Modified: trunk/src/native/test/recursive/RunTests.c =================================================================== --- trunk/src/native/test/recursive/RunTests.c 2008-11-12 10:02:33 UTC (rev 437) +++ trunk/src/native/test/recursive/RunTests.c 2008-11-12 10:14:28 UTC (rev 438) @@ -33,26 +33,6 @@ #include "AceUnitData.h" #include <stdio.h> -/** The fixtures. */ -extern const TestFixture_t C1Mod1TestFixture; - -/** 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 -}; - /** The number of test cases contained in this fixture. * This is used to verify that the number of executed test cases is correct. */ @@ -61,11 +41,13 @@ /** 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) +/** Prototype for running a suite. + * @param suite Suite to run. */ -extern void runFixtures(const TestFixture_t *const fixtures[]); +extern void runSuite(const TestSuite_t *const suite); +extern TestSuite_t suite1; + /** Main program. * @return Exit status. * @retval 0 if all tests ran successfully. @@ -73,7 +55,7 @@ */ int main(void) { int retVal = 0; - runFixtures(fixtures); + runSuite(&suite1); if (runnerData->testCaseFailureCount != 0) { fprintf(stderr, "Error: %d test cases failed.\n", (int) runnerData->testCaseFailureCount); retVal = 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-12 10:02:37
|
Revision: 437 http://aceunit.svn.sourceforge.net/aceunit/?rev=437&view=rev Author: christianhujer Date: 2008-11-12 10:02:33 +0000 (Wed, 12 Nov 2008) Log Message: ----------- Bug in Pckg handling: Pckg did not contain sub packages. Fixed. Modified Paths: -------------- trunk/src/java/src/prj/net/sf/aceunit/GenTest.java trunk/src/java/src/prj/net/sf/aceunit/Pckg.java Modified: trunk/src/java/src/prj/net/sf/aceunit/GenTest.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/GenTest.java 2008-11-12 09:48:01 UTC (rev 436) +++ trunk/src/java/src/prj/net/sf/aceunit/GenTest.java 2008-11-12 10:02:33 UTC (rev 437) @@ -35,6 +35,7 @@ import net.sf.japi.io.args.BasicCommand; import net.sf.japi.io.args.Option; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * Program for generating the code that's needed to execute a fixture. @@ -101,7 +102,7 @@ boolean testsFound = false; if (baseDir.isDirectory()) { baseFound = true; - final boolean testsFoundInDirectory = performPckg(baseDir, baseDir); + final boolean testsFoundInDirectory = performPckg(baseDir, null, baseDir); testsFound = testsFoundInDirectory; if (!testsFoundInDirectory) { System.err.println(baseDir + ": warning: No test cases found. Maybe the annotations are missing?"); @@ -130,16 +131,17 @@ * Performs the generation of tests for a package. * * @param base Base directory of the tree, required to determine what part of the path is package. + * @param parent Parent package of this package, <code>null</code> if toplevel. * @param pckgDir Directory to treat as package. * @return <code>true</code> if the package tree contained a fixture, otherwise <code>false</code> * @throws IOException In case of I/O problems. */ - private boolean performPckg(@NotNull final File base, @NotNull final File pckgDir) throws IOException { + private boolean performPckg(@NotNull final File base, @Nullable final Pckg parent, @NotNull final File pckgDir) throws IOException { assert pckgDir.isDirectory(); boolean containedFixture = false; final Pckg pckg = new Pckg(idGenerator.getNextId()); for (final File dir : pckgDir.listFiles(SourceFiles.DIR_FILTER)) { - containedFixture |= performPckg(base, dir); + containedFixture |= performPckg(base, pckg, dir); } for (final File fixtureFile : pckgDir.listFiles(SourceFiles.C_SOURCE_FILTER)) { containedFixture |= performFixture(base, pckg, fixtureFile); @@ -149,6 +151,9 @@ final String hSource = pckg.getCode("foo"); SourceFiles.writeIfChanged(hFile, hSource, force); } + if (containedFixture && parent != null) { + parent.addSuite(pckg); + } return containedFixture; } Modified: trunk/src/java/src/prj/net/sf/aceunit/Pckg.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/Pckg.java 2008-11-12 09:48:01 UTC (rev 436) +++ trunk/src/java/src/prj/net/sf/aceunit/Pckg.java 2008-11-12 10:02:33 UTC (rev 437) @@ -88,7 +88,7 @@ out.format("#include \"AceUnit.h\"%n"); out.format("%n"); for (final Suite suite : suites) { - out.format("extern TestSuite_t %s;", suite.getGlobalVariablename()); + out.format("extern TestSuite_t %s;%n", suite.getGlobalVariablename()); } out.format("%n"); out.format("const TestSuite_t *suitesOf%d[] = {%n", getId()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-12 09:48:05
|
Revision: 436 http://aceunit.svn.sourceforge.net/aceunit/?rev=436&view=rev Author: christianhujer Date: 2008-11-12 09:48:01 +0000 (Wed, 12 Nov 2008) Log Message: ----------- Updated doxygen configuration. Modified Paths: -------------- trunk/src/native/Doxyfile Modified: trunk/src/native/Doxyfile =================================================================== --- trunk/src/native/Doxyfile 2008-11-12 09:36:08 UTC (rev 435) +++ trunk/src/native/Doxyfile 2008-11-12 09:48:01 UTC (rev 436) @@ -1,4 +1,4 @@ -# Doxyfile 1.5.3 +# Doxyfile 1.5.5 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project @@ -14,11 +14,11 @@ # Project related configuration options #--------------------------------------------------------------------------- -# This tag specifies the encoding used for all characters in the config file that -# follow. The default is UTF-8 which is also the encoding used for all text before -# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into -# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of -# possible encodings. +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 @@ -54,10 +54,11 @@ # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, -# Italian, Japanese, Japanese-en (Japanese with English messages), Korean, -# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, -# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. +# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek, +# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish, +# Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, +# and Ukrainian. OUTPUT_LANGUAGE = English @@ -195,14 +196,26 @@ OPTIMIZE_OUTPUT_FOR_C = YES # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for Java. -# For instance, namespaces will be presented as packages, qualified scopes -# will look different, etc. +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to -# include (a tag file for) the STL sources as input, then you should +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also make the inheritance and collaboration @@ -215,6 +228,12 @@ CPP_CLI_SUPPORT = NO +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default @@ -230,6 +249,16 @@ SUBGROUPING = YES +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = YES + #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- @@ -264,10 +293,11 @@ EXTRACT_LOCAL_METHODS = NO -# If this flag is set to YES, the members of anonymous namespaces will be extracted -# and appear in the documentation as a namespace called 'anonymous_namespace{file}', -# where file will be replaced with the base name of the file that contains the anonymous -# namespace. By default anonymous namespace are hidden. +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespace are hidden. EXTRACT_ANON_NSPACES = NO @@ -346,6 +376,12 @@ SORT_BRIEF_DOCS = NO +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = YES + # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, @@ -408,8 +444,8 @@ SHOW_DIRECTORIES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from the -# version control system). Doxygen will invoke the program by executing (via +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via # popen()) the command <command> <input-file>, where <command> is the value of # the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file # provided by doxygen. Whatever the program writes to standard output @@ -479,10 +515,11 @@ INPUT = -# This tag can be used to specify the character encoding of the source files that -# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default -# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. -# See http://www.gnu.org/software/libiconv for the list of possible encodings. +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. INPUT_ENCODING = UTF-8 @@ -491,7 +528,7 @@ # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx -# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 FILE_PATTERNS = *.h @@ -522,9 +559,10 @@ EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the output. -# The symbol name can be a fully qualified name, a word, or if the wildcard * is used, -# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test EXCLUDE_SYMBOLS = @@ -586,9 +624,7 @@ # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. If you have enabled CALL_GRAPH or CALLER_GRAPH -# then you must also enable this option. If you don't then doxygen will produce -# a warning and turn it on anyway +# VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = NO @@ -709,11 +745,36 @@ # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. For this to work a browser that supports @@ -1128,10 +1189,11 @@ CLASS_DIAGRAMS = YES # You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to -# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to -# specify the directory where the mscgen tool resides. If left empty the tool is assumed to -# be found in the default search path. +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. MSCGEN_PATH = @@ -1192,19 +1254,19 @@ INCLUDED_BY_GRAPH = YES -# If the CALL_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will -# generate a call dependency graph for every global function or class method. -# Note that enabling this option will significantly increase the time of a run. -# So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. CALL_GRAPH = NO -# If the CALLER_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will -# generate a caller dependency graph for every global function or class method. -# Note that enabling this option will significantly increase the time of a run. -# So in most cases it will be better to enable caller graphs for selected -# functions only using the \callergraph command. +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. CALLER_GRAPH = NO @@ -1240,9 +1302,9 @@ # The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of # nodes that will be shown in the graph. If the number of nodes in a graph # becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the number -# of direct children of the root node in a graph is already larger than -# MAX_DOT_GRAPH_NOTES then the graph will not be shown at all. Also note +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 @@ -1258,10 +1320,10 @@ MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, which results in a white background. -# Warning: Depending on the platform used, enabling this option may lead to -# badly anti-aliased labels on the edges of a graph (i.e. they become hard to -# read). +# background. This is enabled by default, which results in a transparent +# background. Warning: Depending on the platform used, enabling this option +# may lead to badly anti-aliased labels on the edges of a graph (i.e. they +# become hard to read). DOT_TRANSPARENT = NO This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-12 09:36:13
|
Revision: 435 http://aceunit.svn.sourceforge.net/aceunit/?rev=435&view=rev Author: christianhujer Date: 2008-11-12 09:36:08 +0000 (Wed, 12 Nov 2008) Log Message: ----------- Fixed warning when compiling MiniRamLogger. Modified Paths: -------------- trunk/src/native/MiniRamLogger.c Modified: trunk/src/native/MiniRamLogger.c =================================================================== --- trunk/src/native/MiniRamLogger.c 2008-11-12 09:30:04 UTC (rev 434) +++ trunk/src/native/MiniRamLogger.c 2008-11-12 09:36:08 UTC (rev 435) @@ -40,8 +40,8 @@ #ifdef ACEUNIT_MINIRAMLOGGER_SAVE #include <stdio.h> +#endif #include <string.h> -#endif #ifndef ACEUNIT_MINIRAM_LOGGER_BUFSIZE /** The size of the buffer that's used for the Mini Ram Logger. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-11-12 09:30:09
|
Revision: 434 http://aceunit.svn.sourceforge.net/aceunit/?rev=434&view=rev Author: christianhujer Date: 2008-11-12 09:30:04 +0000 (Wed, 12 Nov 2008) Log Message: ----------- Added Test for group feature. (Does not run yet, group feature not fully implemented yet.) Added Paths: ----------- trunk/src/native/test/group/ trunk/src/native/test/group/AceUnitConfig.h trunk/src/native/test/group/GroupTest.c trunk/src/native/test/group/Makefile trunk/src/native/test/group/RunTests.c Added: trunk/src/native/test/group/AceUnitConfig.h =================================================================== --- trunk/src/native/test/group/AceUnitConfig.h (rev 0) +++ trunk/src/native/test/group/AceUnitConfig.h 2008-11-12 09:30:04 UTC (rev 434) @@ -0,0 +1,2 @@ +/** Use return to exit a test case with a failed assertion. */ +#define ACEUNIT_ASSERTION_STYLE ACEUNIT_ASSERTION_STYLE_RETURN Property changes on: trunk/src/native/test/group/AceUnitConfig.h ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/src/native/test/group/GroupTest.c =================================================================== --- trunk/src/native/test/group/GroupTest.c (rev 0) +++ trunk/src/native/test/group/GroupTest.c 2008-11-12 09:30:04 UTC (rev 434) @@ -0,0 +1,50 @@ +/* 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. + */ + +/** Unit Test for AceUnit. + * Yes, AceUnit can be tested using itself. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @file AceUnitTest.c + */ + +#include <stdbool.h> +#include <stdio.h> + +#include "AceUnitData.h" +#include "GroupTest.h" + +A_Test void testInDefaultGroup() { + printf("Test in default group.\n"); +} + +A_Group(1) A_Test void firstTestInGroup1() { + printf("First test in group 1.\n"); +} + +A_Group(1) A_Test void secondTestInGroup1() { + printf("Second test in group 1.\n"); +} Property changes on: trunk/src/native/test/group/GroupTest.c ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/src/native/test/group/Makefile =================================================================== --- trunk/src/native/test/group/Makefile (rev 0) +++ trunk/src/native/test/group/Makefile 2008-11-12 09:30:04 UTC (rev 434) @@ -0,0 +1,61 @@ +LOGGER=FullPlainLogger +FIXTURE_NAMES=GroupTest +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 .) + +LINT=splint + +PARTS=\ + AceUnit \ + AceUnitData \ + $(LOGGER) \ + $(FIXTURE_NAMES) + +VPATH=$(ACE_UNIT_PATH)/native + +OBJECTS=$(addsuffix .o,$(PARTS)) + +LINTOUTS=$(addsuffix .ln,$(PARTS)) + +CPPFLAGS=-DACEUNIT_CONFIG_FILE=\"AceUnitConfig.h\" -I . -I $(ACE_UNIT_PATH)/native + +C_and_LD_FLAGS=-fprofile-arcs + +CFLAGS=-fdiagnostics-show-option -std=$(CVERSION) -pedantic $(C_and_LD_FLAGS) -ftest-coverage -W -Wall -g + +LDFLAGS=$(C_and_LD_FLAGS) + +LINTFLAGS=-badflag -weak + +.PHONY : all +all: test + +RunTests: $(OBJECTS) + +$(ACE_UNIT_PATH)/java/AceUnit.jar: $(ACE_UNIT_JAVA_SRC) + ant -f $(ACE_UNIT_PATH)/java/build.xml + +%.d: %.c + $(CPP) -M -MM -MG $(CPPFLAGS) $< | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' > $@ + +coverage: test + gcov *.c + +test: RunTests + ./RunTests + +.PHONY : clean +clean: + rm -f $(addsuffix .h, $(FIXTURE_NAMES)) RunTests *.gcov *.gcno *.gcda *.o *.d Suite.c + +.PHONY : lint +lint: $(LINTOUTS) + +$(OBJECTS) $(OBJECTS:.o=.d): Makefile + +ifneq ($(MAKECMDGOALS),clean) +-include $(OBJECTS:.o=.d) +endif Property changes on: trunk/src/native/test/group/Makefile ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/src/native/test/group/RunTests.c =================================================================== --- trunk/src/native/test/group/RunTests.c (rev 0) +++ trunk/src/native/test/group/RunTests.c 2008-11-12 09:30:04 UTC (rev 434) @@ -0,0 +1,53 @@ +/* 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. + */ + +/** Test executor for AceUnit unit test "basicEmbedded". + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @file + */ + +#include <stdbool.h> +#include <stdio.h> + +#include "AceUnitData.h" + +extern const TestFixture_t GroupTestFixture; + +/** 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; + runTestGroup(0); + runTestGroup(1); + return retVal; +} Property changes on: trunk/src/native/test/group/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. |