aceunit-commit Mailing List for AceUnit (Page 10)
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-10-05 21:15:14
|
Revision: 358 http://aceunit.svn.sourceforge.net/aceunit/?rev=358&view=rev Author: christianhujer Date: 2008-10-05 21:15:08 +0000 (Sun, 05 Oct 2008) Log Message: ----------- Added documentation for future loop annotation. (Experimental!) Modified Paths: -------------- trunk/src/native/AceUnit.h Modified: trunk/src/native/AceUnit.h =================================================================== --- trunk/src/native/AceUnit.h 2008-10-05 21:08:48 UTC (rev 357) +++ trunk/src/native/AceUnit.h 2008-10-05 21:15:08 UTC (rev 358) @@ -171,6 +171,12 @@ * <dd> * If you want AceUnit to use setjmp / longjmp but do not want AceUnit to automatically include any file for it, define this macro. * </dd> + * <dt><code>ACEUNIT_LOOP</code></dt> + * <dd> + * This feature enables <code>A_Loop</code> annotation support. + * <code>A_Loop</code> support is independent of the generator. + * You may turn <code>A_Loop</code> support on and off during compile time without having to rerun the generator. + * </dd> * <dt><code>ACEUNIT_SKIP_ISO_DEFINES</code></dt> * <dd> * This feature tells AceUnit to skip its own ISO defines. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-10-05 21:08:51
|
Revision: 357 http://aceunit.svn.sourceforge.net/aceunit/?rev=357&view=rev Author: christianhujer Date: 2008-10-05 21:08:48 +0000 (Sun, 05 Oct 2008) Log Message: ----------- Added uint32_t for AceUnit to keep it working with pre-C99 compilers without a definition of uint32_t. Modified Paths: -------------- trunk/src/native/AceUnit.h Modified: trunk/src/native/AceUnit.h =================================================================== --- trunk/src/native/AceUnit.h 2008-10-05 21:07:36 UTC (rev 356) +++ trunk/src/native/AceUnit.h 2008-10-05 21:08:48 UTC (rev 357) @@ -192,6 +192,8 @@ #ifndef ACEUNIT_SKIP_ISO_DEFINES /** Replacement for stdint.h uint16_t in case stdint.h is not available. */ typedef unsigned short int uint16_t; +/** Replacement for stdint.h uint32_t in case stdint.h is not available. */ +typedef unsigned long int uint32_t; #endif #ifndef NULL /** Replacement for stddef.h NULL in case stddef.h is not available. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-10-05 21:07:38
|
Revision: 356 http://aceunit.svn.sourceforge.net/aceunit/?rev=356&view=rev Author: christianhujer Date: 2008-10-05 21:07:36 +0000 (Sun, 05 Oct 2008) Log Message: ----------- Added configuration switch to skip AceUnit's own definition of ISO integer types in case they are type incompatible with already defined ISO integer types. Modified Paths: -------------- trunk/src/native/AceUnit.h Modified: trunk/src/native/AceUnit.h =================================================================== --- trunk/src/native/AceUnit.h 2008-10-05 21:03:59 UTC (rev 355) +++ trunk/src/native/AceUnit.h 2008-10-05 21:07:36 UTC (rev 356) @@ -171,6 +171,11 @@ * <dd> * If you want AceUnit to use setjmp / longjmp but do not want AceUnit to automatically include any file for it, define this macro. * </dd> + * <dt><code>ACEUNIT_SKIP_ISO_DEFINES</code></dt> + * <dd> + * This feature tells AceUnit to skip its own ISO defines. + * Use this if you do not have ISO C99 but still have your own ISO C99 type definitions and want / need to use them. + * </dd> * </dl> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @file AceUnit.h @@ -184,8 +189,10 @@ #include <stddef.h> #include <stdint.h> #else +#ifndef ACEUNIT_SKIP_ISO_DEFINES /** Replacement for stdint.h uint16_t in case stdint.h is not available. */ typedef unsigned short int uint16_t; +#endif #ifndef NULL /** Replacement for stddef.h NULL in case stddef.h is not available. */ #if defined(__cplusplus) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-10-05 21:04:01
|
Revision: 355 http://aceunit.svn.sourceforge.net/aceunit/?rev=355&view=rev Author: christianhujer Date: 2008-10-05 21:03:59 +0000 (Sun, 05 Oct 2008) Log Message: ----------- Fixed bug: C version check was wrong. Modified Paths: -------------- trunk/src/native/AceUnit.h Modified: trunk/src/native/AceUnit.h =================================================================== --- trunk/src/native/AceUnit.h 2008-10-05 21:03:12 UTC (rev 354) +++ trunk/src/native/AceUnit.h 2008-10-05 21:03:59 UTC (rev 355) @@ -180,7 +180,7 @@ #include ACEUNIT_CONFIG_FILE #endif -#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 19901L) && defined(ACEUNIT_C99) +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && defined(ACEUNIT_C99) #include <stddef.h> #include <stdint.h> #else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-10-05 21:03:14
|
Revision: 354 http://aceunit.svn.sourceforge.net/aceunit/?rev=354&view=rev Author: christianhujer Date: 2008-10-05 21:03:12 +0000 (Sun, 05 Oct 2008) Log Message: ----------- Improved documentation. Modified Paths: -------------- trunk/src/native/AceUnit.h Modified: trunk/src/native/AceUnit.h =================================================================== --- trunk/src/native/AceUnit.h 2008-10-05 20:56:17 UTC (rev 353) +++ trunk/src/native/AceUnit.h 2008-10-05 21:03:12 UTC (rev 354) @@ -33,7 +33,6 @@ * You do not need to include this header file in a fixture. * The generated header file for your fixture will automatically include it. * - * When using AceUnit, this is the header file that you need to include in your test fixtures. * The following options are supported: * <dl> * <dt><code>ACEUNIT_EMBEDDED</code></dt> @@ -53,8 +52,12 @@ * <li><code><stdint.h></code> for <code>uint16_t</code></li> * <li><code><stddef.h></code> for <code>NULL</code></li> * </ul> + * See also <code>ACEUNIT_SKIP_ISO_DEFINES</code> which tells AceUnit to skip the ISO defines. + * Use this if you use the ISO C99 integer types but do not get them from <code><stdint.h></code> but somewhere else. + * <p> * If you use non-C99 compilers, you should bug your compiler vendor to produce an ISO/IEC 9899/1999 (aka ISO C99) compiler. - * It's a shame that today, about a decade after the release of C99, still only a small minority of compilers actually proparly support that standard. + * AceUnit works without problems on C89 compilers. + * But it's a shame that even today, about a decade after the release of C99, still only a small minority of compilers actually properly support that standard. * </dd> * <dt><code>ACEUNIT_STATIC_ANNOTATIONS</code></dt> * <dd> @@ -84,11 +87,19 @@ * <dd> * Include this header file before AceUnit Code (only applies to framework, not to test cases / generated code). * Use this if you need to specify section information for your compiler e.g. in an embedded environment. + * <p> + * Of course you could just modify the AceUnit source code to include the section information. + * But it is not recommended to modify the AceUnit source code because it will cause extra work for you if you want to upgrade to a newer version of AceUnit. + * Therefore we tried to design AceUnit in a way that you shouldn't need to modify AceUnit's source code to get AceUnit running in your environment. * </dd> * <dt><code>ACEUNIT_DATA_INCLUDE</code></dt> * <dd> * Include this header file before AceUnit Data (only applies to framework, not to test cases / generated code). * Use this if you need to specify section information for your compiler e.g. in an embedded environment. + * <p> + * Of course you could just modify the AceUnit source code to include the section information. + * But it is not recommended to modify the AceUnit source code because it will cause extra work for you if you want to upgrade to a newer version of AceUnit. + * Therefore we tried to design AceUnit in a way that you shouldn't need to modify AceUnit's source code to get AceUnit running in your environment. * </dd> * <dt><code>ACEUNIT_DATA_ON_STACK</code></dt> * <dd> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-10-05 20:56:20
|
Revision: 353 http://aceunit.svn.sourceforge.net/aceunit/?rev=353&view=rev Author: christianhujer Date: 2008-10-05 20:56:17 +0000 (Sun, 05 Oct 2008) Log Message: ----------- Changed Makefile to remove headers. Modified Paths: -------------- trunk/src/native/test/recursive/Makefile Modified: trunk/src/native/test/recursive/Makefile =================================================================== --- trunk/src/native/test/recursive/Makefile 2008-10-05 20:54:10 UTC (rev 352) +++ trunk/src/native/test/recursive/Makefile 2008-10-05 20:56:17 UTC (rev 353) @@ -11,6 +11,7 @@ SOURCES=$(sort $(shell find . -name "*.c") $(filter %.c,$(addprefix ./,$(ACE_UNIT_FILES)))) OBJECTS=$(patsubst %.c,%.o,$(SOURCES)) +HEADERS=$(patsubst %.c,%.h,$(shell find . -name "*.c")) GCOV=$(patsubst %.c,%.gcov,$(SOURCES)) GCNO=$(patsubst %.c,%.gcno,$(SOURCES)) GCDA=$(patsubst %.c,%.gcda,$(SOURCES)) @@ -18,7 +19,7 @@ all: prepare generateHeaders compile test clean: - rm -f $(ACE_UNIT_FILES) $(OBJECTS) runTests $(GCOV) $(GCNO) $(GCDA) + rm -f $(ACE_UNIT_FILES) $(OBJECTS) $(HEADERS) runTests $(GCOV) $(GCNO) $(GCDA) prepare: $(ACE_UNIT_FILES) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-10-05 20:54:14
|
Revision: 352 http://aceunit.svn.sourceforge.net/aceunit/?rev=352&view=rev Author: christianhujer Date: 2008-10-05 20:54:10 +0000 (Sun, 05 Oct 2008) Log Message: ----------- Changed makefiles to output the corresponding option in case of compiler warnings. Modified Paths: -------------- trunk/src/native/test/basic/Makefile trunk/src/native/test/basicEmbedded/Makefile trunk/src/native/test/comment/Makefile trunk/src/native/test/exhand/Makefile trunk/src/native/test/longjmp/Makefile trunk/src/native/test/recursive/Makefile trunk/src/native/test/twoFixtures/Makefile trunk/src/native/test/xmlLog/Makefile Modified: trunk/src/native/test/basic/Makefile =================================================================== --- trunk/src/native/test/basic/Makefile 2008-10-05 20:41:03 UTC (rev 351) +++ trunk/src/native/test/basic/Makefile 2008-10-05 20:54:10 UTC (rev 352) @@ -48,7 +48,7 @@ java -jar AceUnit.jar $(FIXTURE_NAME) runTests: $(FIXTURE_NAME).c $(FIXTURE_NAME).h $(ACE_UNIT_FILES) - $(CC) -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -o runTests *.c + $(CC) -fdiagnostics-show-option -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -o runTests *.c test: runTests ./runTests Modified: trunk/src/native/test/basicEmbedded/Makefile =================================================================== --- trunk/src/native/test/basicEmbedded/Makefile 2008-10-05 20:41:03 UTC (rev 351) +++ trunk/src/native/test/basicEmbedded/Makefile 2008-10-05 20:54:10 UTC (rev 352) @@ -48,7 +48,7 @@ java -jar AceUnit.jar $(FIXTURE_NAME) runTests: $(FIXTURE_NAME).c $(FIXTURE_NAME).h $(ACE_UNIT_FILES) - $(CC) -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -DACEUNIT_EMBEDDED -o runTests *.c + $(CC) -fdiagnostics-show-option -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -DACEUNIT_EMBEDDED -o runTests *.c test: runTests ./runTests Modified: trunk/src/native/test/comment/Makefile =================================================================== --- trunk/src/native/test/comment/Makefile 2008-10-05 20:41:03 UTC (rev 351) +++ trunk/src/native/test/comment/Makefile 2008-10-05 20:54:10 UTC (rev 352) @@ -48,7 +48,7 @@ java -jar AceUnit.jar $(FIXTURE_NAME) runTests: $(FIXTURE_NAME).c $(FIXTURE_NAME).h $(ACE_UNIT_FILES) - $(CC) -std=c99 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -o runTests *.c + $(CC) -fdiagnostics-show-option -std=c99 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -o runTests *.c test: runTests ./runTests Modified: trunk/src/native/test/exhand/Makefile =================================================================== --- trunk/src/native/test/exhand/Makefile 2008-10-05 20:41:03 UTC (rev 351) +++ trunk/src/native/test/exhand/Makefile 2008-10-05 20:54:10 UTC (rev 352) @@ -18,8 +18,8 @@ compile: runTests runTests: $(ACE_UNIT_FILES) TryExceptionHandling.c - $(CC) -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -o runTests *.c -# $(CC) -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -DACEUNIT_EMBEDDED -o runTests *.c + $(CC) -fdiagnostics-show-option -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -o runTests *.c +# $(CC) -fdiagnostics-show-option -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -DACEUNIT_EMBEDDED -o runTests *.c test: runTests ./runTests Modified: trunk/src/native/test/longjmp/Makefile =================================================================== --- trunk/src/native/test/longjmp/Makefile 2008-10-05 20:41:03 UTC (rev 351) +++ trunk/src/native/test/longjmp/Makefile 2008-10-05 20:54:10 UTC (rev 352) @@ -49,8 +49,8 @@ java -jar AceUnit.jar $(FIXTURE_NAME) runTests: $(FIXTURE_NAME).c $(FIXTURE_NAME).h $(ACE_UNIT_FILES) - $(CC) -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -o runTests *.c -# $(CC) -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -DACEUNIT_EMBEDDED -o runTests *.c + $(CC) -fdiagnostics-show-option -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -o runTests *.c +# $(CC) -fdiagnostics-show-option -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -DACEUNIT_EMBEDDED -o runTests *.c test: runTests ./runTests Modified: trunk/src/native/test/recursive/Makefile =================================================================== --- trunk/src/native/test/recursive/Makefile 2008-10-05 20:41:03 UTC (rev 351) +++ trunk/src/native/test/recursive/Makefile 2008-10-05 20:54:10 UTC (rev 352) @@ -55,10 +55,10 @@ java -jar AceUnit.jar $(FIXTURE_NAME) %.o: %.c - $(CC) -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -c -o $@ -I. $< + $(CC) -fdiagnostics-show-option -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -c -o $@ -I. $< runTests: $(ACE_UNIT_FILES) $(OBJECTS) - $(CC) -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -o $@ $(OBJECTS) + $(CC) -fdiagnostics-show-option -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -o $@ $(OBJECTS) test: runTests ./runTests Modified: trunk/src/native/test/twoFixtures/Makefile =================================================================== --- trunk/src/native/test/twoFixtures/Makefile 2008-10-05 20:41:03 UTC (rev 351) +++ trunk/src/native/test/twoFixtures/Makefile 2008-10-05 20:54:10 UTC (rev 352) @@ -52,8 +52,8 @@ java -jar AceUnit.jar . runTests: $(FIXTURE_SOURCES) $(FIXTURE_HEADERS) $(ACE_UNIT_FILES) - $(CC) -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -o runTests *.c -# $(CC) -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -DACEUNIT_EMBEDDED -o runTests *.c + $(CC) -fdiagnostics-show-option -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -o runTests *.c +# $(CC) -fdiagnostics-show-option -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -DACEUNIT_EMBEDDED -o runTests *.c test: runTests ./runTests Modified: trunk/src/native/test/xmlLog/Makefile =================================================================== --- trunk/src/native/test/xmlLog/Makefile 2008-10-05 20:41:03 UTC (rev 351) +++ trunk/src/native/test/xmlLog/Makefile 2008-10-05 20:54:10 UTC (rev 352) @@ -48,8 +48,8 @@ java -jar AceUnit.jar $(FIXTURE_NAME) runTests: $(FIXTURE_NAME).c $(FIXTURE_NAME).h $(ACE_UNIT_FILES) - $(CC) -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -o runTests *.c -# $(CC) -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -DACEUNIT_EMBEDDED -o runTests *.c + $(CC) -fdiagnostics-show-option -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -o runTests *.c +# $(CC) -fdiagnostics-show-option -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -DACEUNIT_EMBEDDED -o runTests *.c test: runTests ./runTests This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-10-05 20:41:13
|
Revision: 351 http://aceunit.svn.sourceforge.net/aceunit/?rev=351&view=rev Author: christianhujer Date: 2008-10-05 20:41:03 +0000 (Sun, 05 Oct 2008) Log Message: ----------- Make main make fail in case a sub make failed. Modified Paths: -------------- trunk/src/native/test/Makefile Modified: trunk/src/native/test/Makefile =================================================================== --- trunk/src/native/test/Makefile 2008-10-05 20:27:19 UTC (rev 350) +++ trunk/src/native/test/Makefile 2008-10-05 20:41:03 UTC (rev 351) @@ -10,7 +10,7 @@ xmlLog \ all: - @for dir in $(DIRS) ; do (cd $$dir ; make) ; done + @for dir in $(DIRS) ; do (cd $$dir ; make) || exit 1 ; done clean: - @for dir in $(DIRS) ; do (cd $$dir ; make clean) ; done + @for dir in $(DIRS) ; do (cd $$dir ; make clean) || exit 1 ; done This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-10-05 20:27:23
|
Revision: 350 http://aceunit.svn.sourceforge.net/aceunit/?rev=350&view=rev Author: christianhujer Date: 2008-10-05 20:27:19 +0000 (Sun, 05 Oct 2008) Log Message: ----------- Updated TODO. Modified Paths: -------------- trunk/TODO Modified: trunk/TODO =================================================================== --- trunk/TODO 2008-10-03 13:38:48 UTC (rev 349) +++ trunk/TODO 2008-10-05 20:27:19 UTC (rev 350) @@ -11,6 +11,10 @@ * Add proper runner tree that makes makes use of every logger method. * Add generation of main() * Add suites that consist of suites and fixtures. Suites are packages for now. +* Support performance tests by measuring the time for tests. +* Support looping of tests for performance tests. +* Support fork() in the runner, just like check. +* Rename all symbols to have a pseudo-namespace. * Add groups which are an orthogonal grouping system to the tree of suites with fixtures with testcases. * Extend the runner to get information about what to run. * Extend the runner to optionally use fork() like check. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-10-03 13:38:55
|
Revision: 349 http://aceunit.svn.sourceforge.net/aceunit/?rev=349&view=rev Author: christianhujer Date: 2008-10-03 13:38:48 +0000 (Fri, 03 Oct 2008) Log Message: ----------- Updated README for tests. Modified Paths: -------------- trunk/src/native/test/README Modified: trunk/src/native/test/README =================================================================== --- trunk/src/native/test/README 2008-10-03 13:36:34 UTC (rev 348) +++ trunk/src/native/test/README 2008-10-03 13:38:48 UTC (rev 349) @@ -3,9 +3,7 @@ Please note: It requires a POSIX compatible find command, a normal make command, Java and Ant to run. -The compiler is required to be GCC or largely compatible with GCC. -It is theoretically possible to port the test to other compilers. -The reasons why the test suite is designed like this are: -* GCC allows nested functions. That's beyond spec, but it makes writing the - AceUnit self test suite so much easier that it justifies using this feature. -* GCC can run with a built in profiling. That's also used by the self test. + +The recommended compiler for the test suite is GCC (for profiling). + +The recommended way of running the test suite is make -s -j This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-10-03 13:36:39
|
Revision: 348 http://aceunit.svn.sourceforge.net/aceunit/?rev=348&view=rev Author: christianhujer Date: 2008-10-03 13:36:34 +0000 (Fri, 03 Oct 2008) Log Message: ----------- Replaced nested function by global function. Modified Paths: -------------- trunk/src/native/test/longjmp/LongJmpTest.c Modified: trunk/src/native/test/longjmp/LongJmpTest.c =================================================================== --- trunk/src/native/test/longjmp/LongJmpTest.c 2008-10-03 13:22:49 UTC (rev 347) +++ trunk/src/native/test/longjmp/LongJmpTest.c 2008-10-03 13:36:34 UTC (rev 348) @@ -39,20 +39,19 @@ #include "LongJmpTest.h" #include "AceUnitData.h" +/** Helper function. Fails intentionally. */ +void helper() { + assertTrue("Test assertion, expected to fail.", false); +} + /** Tests that {@link #assertTrue()} does a longjmp. */ A_Test void testAssertDoesLongjmp() { - void helper() { - assertTrue("Test assertion, expected to fail.", false); - } helper(); fail("This statement should not be reached."); } /** Tests that {@link #assertEquals()} with unequal values sets recentError. */ A_Test void testAssertDoesLongjmp2() { - void helper() { - assertTrue("Test assertion, expected to fail.", false); - } helper(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-10-03 13:23:04
|
Revision: 347 http://aceunit.svn.sourceforge.net/aceunit/?rev=347&view=rev Author: christianhujer Date: 2008-10-03 13:22:49 +0000 (Fri, 03 Oct 2008) Log Message: ----------- Unified basic and basicEmbedded tests. Modified Paths: -------------- trunk/src/native/test/basic/AceUnitTest.c trunk/src/native/test/basicEmbedded/AceUnitTest.c Modified: trunk/src/native/test/basic/AceUnitTest.c =================================================================== --- trunk/src/native/test/basic/AceUnitTest.c 2008-10-03 12:47:34 UTC (rev 346) +++ trunk/src/native/test/basic/AceUnitTest.c 2008-10-03 13:22:49 UTC (rev 347) @@ -104,6 +104,7 @@ int val2 = 20; assertEquals("Test assertion, expected to fail.", val1, val2); } + break; } assertionContinued = true; } Modified: trunk/src/native/test/basicEmbedded/AceUnitTest.c =================================================================== --- trunk/src/native/test/basicEmbedded/AceUnitTest.c 2008-10-03 12:47:34 UTC (rev 346) +++ trunk/src/native/test/basicEmbedded/AceUnitTest.c 2008-10-03 13:22:49 UTC (rev 347) @@ -39,6 +39,17 @@ #include "AceUnitData.h" #include "AceUnitTest.h" +/** 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. + */ +static int myTestCaseCount = 0; + /** Clears the current recent error. */ void clearRecentError() { if (runnerData->recentError != NULL) { @@ -46,14 +57,62 @@ } } +/** 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 continue the test case.", 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() { - bool assertionContinued = false; - void helper() { - assertTrue("assertTrue(msg, true) MUST continue the test case.", true); - assertionContinued = true; - } - helper(); + myTestCaseCount++; + helper(0); clearRecentError(); if (!assertionContinued) { fail("Expected assertTrue(msg, true) to continue."); @@ -62,12 +121,8 @@ /** Tests that {@link #assertTrue()} with a false condition does not continue a test case. */ A_Test void testAssertTrueWithFalseReturns() { - bool assertionContinued = false; - void helper() { - assertTrue("Test assertion, expected to fail.", false); - assertionContinued = true; - } - helper(); + myTestCaseCount++; + helper(1); clearRecentError(); if (assertionContinued) { fail("Expected assertTrue(msg, false) to not continue."); @@ -76,6 +131,7 @@ /** 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) { @@ -87,11 +143,10 @@ /** Tests that {@link #assertTrue()} with a false condition sets recentError. */ A_Test void testAssertTrueWithFalseSetsRecentError() { bool recentErrorSet = false; + + myTestCaseCount++; clearRecentError(); - void helper() { - assertTrue("Test assertion, expected to fail.", false); - } - helper(); + helper(2); if (runnerData->recentError != NULL) { recentErrorSet = true; } @@ -103,12 +158,8 @@ /** Tests that {@link #assertFalse()} with a true condition continues a test case. */ A_Test void testAssertFalseWithFalseContinues() { - bool assertionContinued = false; - void helper() { - assertFalse("assertFalse(msg, false) MUST continue the test case.", false); - assertionContinued = true; - } - helper(); + myTestCaseCount++; + helper(3); clearRecentError(); if (!assertionContinued) { fail("Expected assertion to continue."); @@ -117,12 +168,8 @@ /** Tests that {@link #assertFalse()} with a false condition does not continue a test case. */ A_Test void testAssertFalseWithTrueReturns() { - bool assertionContinued = false; - void helper() { - assertFalse("Test assertion, expected to fail.", true); - assertionContinued = true; - } - helper(); + myTestCaseCount++; + helper(4); clearRecentError(); if (assertionContinued) { fail("Expected assertion to not continue."); @@ -131,6 +178,7 @@ /** 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) { @@ -142,11 +190,10 @@ /** Tests that {@link #assertFalse()} with a false condition sets recentError. */ A_Test void testAssertFalseWithTrueSetsRecentError() { bool recentErrorSet = false; + + myTestCaseCount++; clearRecentError(); - void helper() { - assertFalse("Test assertion, expected to fail.", true); - } - helper(); + helper(5); if (runnerData->recentError != NULL) { recentErrorSet = true; } @@ -158,14 +205,8 @@ /** Tests that {@link #assertEquals()} with equal values continues a test case. */ A_Test void testAssertEqualsWithEqualContinues() { - bool assertionContinued = false; - int val1 = 10; - int val2 = val1; - void helper() { - assertEquals("assertEquals(msg, val, val) MUST continue the test case.", val1, val2); - assertionContinued = true; - } - helper(); + myTestCaseCount++; + helper(6); clearRecentError(); if (!assertionContinued) { fail("Expected assertion to continue."); @@ -174,14 +215,8 @@ /** Tests that {@link #assertEquals()} with unequal values does not continue a test case. */ A_Test void testAssertEqualsWithUnequalReturns() { - bool assertionContinued = false; - int val1 = 10; - int val2 = 20; - void helper() { - assertEquals("assertEquals(msg, val1, val2) MUST NOT continue the test case.", val1, val2); - assertionContinued = true; - } - helper(); + myTestCaseCount++; + helper(7); clearRecentError(); if (assertionContinued) { fail("Expected assertion to not continue."); @@ -192,6 +227,8 @@ 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) { @@ -200,16 +237,20 @@ } } -/** Tests that {@link #assertEquals()} with unequal values sets recentError. */ -A_Test void testAssertEqualsWithUnequalSetsRecentError() { +/** 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; - int val1 = 10; - int val2 = 20; + + myTestCaseCount++; clearRecentError(); - void helper() { - assertEquals("Test assertion, expected to fail.", val1, val2); - } - helper(); + helper(8); if (runnerData->recentError != NULL) { recentErrorSet = true; } @@ -228,10 +269,19 @@ * @return Exit status (currently always 0). */ int main(int argc, char *argv[]) { + int retVal = 0; runFixture(&AceUnitTestFixture); if (runnerData->testCaseFailureCount != 0) { fprintf(stderr, "Test Cases: %d Errors: %d\n", runnerData->testCaseCount, runnerData->testCaseFailureCount); - return 1; + retVal = 1; } - return 0; + 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; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-10-03 12:47:51
|
Revision: 346 http://aceunit.svn.sourceforge.net/aceunit/?rev=346&view=rev Author: christianhujer Date: 2008-10-03 12:47:34 +0000 (Fri, 03 Oct 2008) Log Message: ----------- Changed basic test to not use nested functions. Modified Paths: -------------- trunk/src/native/test/basic/AceUnitTest.c Modified: trunk/src/native/test/basic/AceUnitTest.c =================================================================== --- trunk/src/native/test/basic/AceUnitTest.c 2008-10-01 20:24:38 UTC (rev 345) +++ trunk/src/native/test/basic/AceUnitTest.c 2008-10-03 12:47:34 UTC (rev 346) @@ -57,16 +57,61 @@ } } +/** 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); + } + } + assertionContinued = true; +} + /** Tests that {@link #assertTrue()} with a true condition continues a test case. */ A_Test void testAssertTrueWithTrueContinues() { - bool assertionContinued = false; - void helper() { - assertTrue("assertTrue(msg, true) MUST continue the test case.", true); - assertionContinued = true; - } - myTestCaseCount++; - helper(); + helper(0); clearRecentError(); if (!assertionContinued) { fail("Expected assertTrue(msg, true) to continue."); @@ -75,14 +120,8 @@ /** Tests that {@link #assertTrue()} with a false condition does not continue a test case. */ A_Test void testAssertTrueWithFalseReturns() { - bool assertionContinued = false; - void helper() { - assertTrue("Test assertion, expected to fail.", false); - assertionContinued = true; - } - myTestCaseCount++; - helper(); + helper(1); clearRecentError(); if (assertionContinued) { fail("Expected assertTrue(msg, false) to not continue."); @@ -103,13 +142,10 @@ /** Tests that {@link #assertTrue()} with a false condition sets recentError. */ A_Test void testAssertTrueWithFalseSetsRecentError() { bool recentErrorSet = false; - void helper() { - assertTrue("Test assertion, expected to fail.", false); - } myTestCaseCount++; clearRecentError(); - helper(); + helper(2); if (runnerData->recentError != NULL) { recentErrorSet = true; } @@ -121,14 +157,8 @@ /** Tests that {@link #assertFalse()} with a true condition continues a test case. */ A_Test void testAssertFalseWithFalseContinues() { - bool assertionContinued = false; - void helper() { - assertFalse("assertFalse(msg, false) MUST continue the test case.", false); - assertionContinued = true; - } - myTestCaseCount++; - helper(); + helper(3); clearRecentError(); if (!assertionContinued) { fail("Expected assertion to continue."); @@ -137,14 +167,8 @@ /** Tests that {@link #assertFalse()} with a false condition does not continue a test case. */ A_Test void testAssertFalseWithTrueReturns() { - bool assertionContinued = false; - void helper() { - assertFalse("Test assertion, expected to fail.", true); - assertionContinued = true; - } - myTestCaseCount++; - helper(); + helper(4); clearRecentError(); if (assertionContinued) { fail("Expected assertion to not continue."); @@ -165,13 +189,10 @@ /** Tests that {@link #assertFalse()} with a false condition sets recentError. */ A_Test void testAssertFalseWithTrueSetsRecentError() { bool recentErrorSet = false; - void helper() { - assertFalse("Test assertion, expected to fail.", true); - } myTestCaseCount++; clearRecentError(); - helper(); + helper(5); if (runnerData->recentError != NULL) { recentErrorSet = true; } @@ -183,16 +204,8 @@ /** Tests that {@link #assertEquals()} with equal values continues a test case. */ A_Test void testAssertEqualsWithEqualContinues() { - bool assertionContinued = false; - int val1 = 10; - int val2 = val1; - void helper() { - assertEquals("assertEquals(msg, val, val) MUST continue the test case.", val1, val2); - assertionContinued = true; - } - myTestCaseCount++; - helper(); + helper(6); clearRecentError(); if (!assertionContinued) { fail("Expected assertion to continue."); @@ -201,16 +214,8 @@ /** Tests that {@link #assertEquals()} with unequal values does not continue a test case. */ A_Test void testAssertEqualsWithUnequalReturns() { - bool assertionContinued = false; - int val1 = 10; - int val2 = 20; - void helper() { - assertEquals("assertEquals(msg, val1, val2) MUST NOT continue the test case.", val1, val2); - assertionContinued = true; - } - myTestCaseCount++; - helper(); + helper(7); clearRecentError(); if (assertionContinued) { fail("Expected assertion to not continue."); @@ -241,15 +246,10 @@ () { bool recentErrorSet = false; - int val1 = 10; - int val2 = 20; - void helper() { - assertEquals("Test assertion, expected to fail.", val1, val2); - } myTestCaseCount++; clearRecentError(); - helper(); + helper(8); if (runnerData->recentError != NULL) { recentErrorSet = true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-10-01 20:24:44
|
Revision: 345 http://aceunit.svn.sourceforge.net/aceunit/?rev=345&view=rev Author: christianhujer Date: 2008-10-01 20:24:38 +0000 (Wed, 01 Oct 2008) Log Message: ----------- Added Stub for loggers so people have a template when they want to create their own logger. Added Paths: ----------- trunk/src/native/AceUnitLoggerStub.c Added: trunk/src/native/AceUnitLoggerStub.c =================================================================== --- trunk/src/native/AceUnitLoggerStub.c (rev 0) +++ trunk/src/native/AceUnitLoggerStub.c 2008-10-01 20:24:38 UTC (rev 345) @@ -0,0 +1,110 @@ +/* Copyright (c) 2008, Christian Hujer + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the AceUnit developers nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "AceUnitLogging.h" + +/* This file is a stub for a logger. + * If you need just one logger in your AceUnit environment then this stub is ideal for you. + * Copy it and fill the methods with your needs for logging. + * E.g. if your testling (and thus your tests) run inside an embedded device, you might be interested in logging through a debug interface. + */ + +#ifdef ACEUNIT_LOG_RUNNER +/** @see TestLogger_t.runnerStarted */ +void logRunnerStarted() +{ +} +#endif + +#ifdef ACEUNIT_LOG_SUITE +/** @see TestLogger_t.suiteStarted */ +void logSuiteStarted() +{ +} +#endif + +#ifdef ACEUNIT_LOG_FIXTURE +/** @see TestLogger_t.fixtureStarted */ +void logFixtureStarted(const FixtureId_t fixture) +{ +} +#endif + +#ifdef ACEUNIT_LOG_TESTCASE +/** @see TestLogger_t.testCaseStarted */ +void logTestCaseStarted(TestCaseId_t testCase) +{ +} +#endif + +/** @see TestLogger_t.testCaseCailed */ +void logTestCaseFailed(const AssertoinError_t *error) +{ +} + +#ifdef ACEUNIT_LOG_TESTCASE +/** @see TestLogger_t.testCaseEnded */ +void logTestCaseEnded(TestCaseId_t testCase) +{ +} +#endif + +#ifdef ACEUNIT_LOG_FIXTURE +void logFixtureEnded(const FixtureId_t fixture) +{ +} +#endif + +#ifdef ACEUNIT_LOG_SUITE +/** @see TestLogger_t.suiteEnded */ +void logSuiteEnded() +{ +} +#endif + +#ifdef ACEUNIT_LOG_RUNNER +/** @see TestLogger_t.runnerEnded */ +void logRunnerEnded() +{ +} +#endif + +/** This Logger. */ +AceUnitNewLogger( + loggerStub, /* CHANGE THIS NAME!!! */ + logRunnerStarted, + logSuiteStarted, + logFixtureStarted, + logTestCaseStarted, + logTestCaseFailed, + logTestCaseEnded, + logFixtureEnded, + logSuiteEnded, + logRunnerEnded +); + +TestLogger_t *globalLogger = &loggerStub; /* XXX Hack. Remove. */ Property changes on: trunk/src/native/AceUnitLoggerStub.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-09-28 17:07:09
|
Revision: 344 http://aceunit.svn.sourceforge.net/aceunit/?rev=344&view=rev Author: christianhujer Date: 2008-09-28 17:07:00 +0000 (Sun, 28 Sep 2008) Log Message: ----------- Implemented experimental output of suite header files. Not yet used by the runner. Modified Paths: -------------- trunk/src/java/src/prj/net/sf/aceunit/GenTest.java Modified: trunk/src/java/src/prj/net/sf/aceunit/GenTest.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/GenTest.java 2008-09-27 18:07:10 UTC (rev 343) +++ trunk/src/java/src/prj/net/sf/aceunit/GenTest.java 2008-09-28 17:07:00 UTC (rev 344) @@ -109,7 +109,7 @@ } if (fixtureFile.isFile()) { baseFound = true; - final boolean testsFoundInFile = performFixture(fixtureFile.getParentFile(), fixtureFile); + final boolean testsFoundInFile = performFixture(fixtureFile.getParentFile(), new Pckg(0), fixtureFile); testsFound |= testsFoundInFile; if (!testsFoundInFile) { System.err.println(fixtureFile + ": warning: No test cases found. Maybe the annotations are missing?"); @@ -137,12 +137,18 @@ private boolean performPckg(@NotNull final File base, @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); } for (final File fixtureFile : pckgDir.listFiles(SourceFiles.C_SOURCE_FILTER)) { - containedFixture |= performFixture(base, fixtureFile); + containedFixture |= performFixture(base, pckg, fixtureFile); } + if (containedFixture) { + final File hFile = new File(pckgDir, "Suite.h"); + final String hSource = pckg.getCode("foo"); + SourceFiles.writeIfChanged(hFile, hSource, force); + } return containedFixture; } @@ -150,11 +156,12 @@ * Performs the generation of tests for a fixtureFile. * * @param base Base directory of the tree, required to determine what part of the path is package. + * @param pckg Package to which the fixture will be added. * @param fixtureFile File that contains the fixtureFile. * @return <code>true</code> if the source code contained a fixture, otherwise <code>false</code> * @throws IOException In case of I/O problems. */ - private boolean performFixture(@NotNull final File base, @NotNull final File fixtureFile) throws IOException { + private boolean performFixture(@NotNull final File base, @NotNull final Pckg pckg, @NotNull final File fixtureFile) throws IOException { final String fixtureName = fixtureFile.getName().replaceAll("\\.c$", ""); final Fixture fixture = new Fixture(idGenerator.getNextId(), fixtureFile); final boolean containedFixture = fixture.containsTests(); @@ -162,6 +169,7 @@ final File hFile = new File(fixtureFile.getParent(), fixtureName + ".h"); final String hSource = fixture.getCode(fixtureName); SourceFiles.writeIfChanged(hFile, hSource, force); + pckg.addSuite(fixture); } return containedFixture; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-09-27 18:07:17
|
Revision: 343 http://aceunit.svn.sourceforge.net/aceunit/?rev=343&view=rev Author: christianhujer Date: 2008-09-27 18:07:10 +0000 (Sat, 27 Sep 2008) Log Message: ----------- Fixed warning. Modified Paths: -------------- trunk/src/java/src/prj/net/sf/aceunit/GenTest.java Modified: trunk/src/java/src/prj/net/sf/aceunit/GenTest.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/GenTest.java 2008-09-27 17:50:53 UTC (rev 342) +++ trunk/src/java/src/prj/net/sf/aceunit/GenTest.java 2008-09-27 18:07:10 UTC (rev 343) @@ -102,7 +102,7 @@ if (baseDir.isDirectory()) { baseFound = true; final boolean testsFoundInDirectory = performPckg(baseDir, baseDir); - testsFound |= testsFoundInDirectory; + testsFound = testsFoundInDirectory; if (!testsFoundInDirectory) { System.err.println(baseDir + ": warning: No test cases found. Maybe the annotations are missing?"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-09-27 17:50:57
|
Revision: 342 http://aceunit.svn.sourceforge.net/aceunit/?rev=342&view=rev Author: christianhujer Date: 2008-09-27 17:50:53 +0000 (Sat, 27 Sep 2008) Log Message: ----------- Removed '();' from macro reference to allow more flexible macros to extend the runner. Modified Paths: -------------- trunk/src/native/AceUnit.c Modified: trunk/src/native/AceUnit.c =================================================================== --- trunk/src/native/AceUnit.c 2008-09-27 12:48:14 UTC (rev 341) +++ trunk/src/native/AceUnit.c 2008-09-27 17:50:53 UTC (rev 342) @@ -98,7 +98,7 @@ #endif runnerData->recentError = NULL; #ifdef ACEUNIT_PRE_TEST - ACEUNIT_PRE_TEST(); + ACEUNIT_PRE_TEST #endif #if ACEUNIT_ASSERTION_STYLE == ACEUNIT_ASSERTION_STYLE_LONGJMP if (!(setjmp(aceunitJmpBuf))) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-09-27 12:48:17
|
Revision: 341 http://aceunit.svn.sourceforge.net/aceunit/?rev=341&view=rev Author: christianhujer Date: 2008-09-27 12:48:14 +0000 (Sat, 27 Sep 2008) Log Message: ----------- Added prototype annotations for the planned group feature. Modified Paths: -------------- trunk/src/native/AceUnitAnnotations.h Modified: trunk/src/native/AceUnitAnnotations.h =================================================================== --- trunk/src/native/AceUnitAnnotations.h 2008-09-27 12:38:37 UTC (rev 340) +++ trunk/src/native/AceUnitAnnotations.h 2008-09-27 12:48:14 UTC (rev 341) @@ -67,4 +67,33 @@ */ #define A_Ignore ACEUNIT_ANNOTATION +/** Puts a test in a specific group. + * This annotation is only allowed for methods annotated as {@link #A_Test}. + * + * A test group allows tests to be grouped. + * When the runner runs, it will pick only those tests belonging to the group given to the runner. + * + * For C99 it is possible to put a test in an arbitrary number of groups. + * For C89 a test can be put in only one group. + * + * The default group of a test is group 0 (zero). + */ +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 19901L) && defined(ACEUNIT_C99) +#define A_Group(...) ACEUNIT_ANNOTATION +#else +#define A_Group(group) +#endif + +/** Puts a fixture in a specific group. + * This annotation is only allowed once per fixture source. + * Though this annotation might appear anywhere in the source code, it is recommended to place after include directives but before "normal" code. + * + * Putting a fixture in a specific group overrides the default group for all tests in that fixture. + */ +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 19901L) && defined(ACEUNIT_C99) +#define A_FixtureGroup(...) +#else +#define A_FixtureGroup(group) +#endif + #endif /* ACEUNITANNOTATIONS_H */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-09-27 12:38:38
|
Revision: 340 http://aceunit.svn.sourceforge.net/aceunit/?rev=340&view=rev Author: christianhujer Date: 2008-09-27 12:38:37 +0000 (Sat, 27 Sep 2008) Log Message: ----------- Removed '();' from macro reference to allow more flexible macros to extend the runner. Modified Paths: -------------- trunk/src/native/AceUnit.c Modified: trunk/src/native/AceUnit.c =================================================================== --- trunk/src/native/AceUnit.c 2008-09-26 21:24:53 UTC (rev 339) +++ trunk/src/native/AceUnit.c 2008-09-27 12:38:37 UTC (rev 340) @@ -78,11 +78,11 @@ globalLog(fixtureStarted, fixture->id); #endif #ifdef ACEUNIT_PRE_BEFORECLASS - ACEUNIT_PRE_BEFORECLASS(); + ACEUNIT_PRE_BEFORECLASS #endif invokeAll(beforeClass); #ifdef ACEUNIT_POST_BEFORECLASS - ACEUNIT_POST_BEFORECLASS(); + ACEUNIT_POST_BEFORECLASS #endif for (testCase = fixture->testCase, testId = fixture->testId; NULL != *testCase; testCase++, testId++) { runnerData->currentTestId = *testId; @@ -90,11 +90,11 @@ globalLog(testCaseStarted, runnerData->currentTestId); #endif #ifdef ACEUNIT_PRE_BEFORE - ACEUNIT_PRE_BEFORE(); + ACEUNIT_PRE_BEFORE #endif invokeAll(before); #ifdef ACEUNIT_POST_BEFORE - ACEUNIT_POST_BEFORE(); + ACEUNIT_POST_BEFORE #endif runnerData->recentError = NULL; #ifdef ACEUNIT_PRE_TEST @@ -108,7 +108,7 @@ } #endif #ifdef ACEUNIT_POST_TEST - ACEUNIT_POST_TEST(); + ACEUNIT_POST_TEST #endif runnerData->testCaseCount++; if (NULL != runnerData->recentError) { @@ -116,11 +116,11 @@ runnerData->testCaseFailureCount++; } #ifdef ACEUNIT_PRE_AFTER - ACEUNIT_PRE_AFTER(); + ACEUNIT_PRE_AFTER #endif invokeAll(after); #ifdef ACEUNIT_POST_AFTER - ACEUNIT_POST_AFTER(); + ACEUNIT_POST_AFTER #endif #ifdef ACEUNIT_LOG_TESTCASE globalLog(testCaseEnded, runnerData->currentTestId); @@ -128,11 +128,11 @@ runnerData->currentTestId = TestCaseId_NULL; } #ifdef ACEUNIT_PRE_AFTERCLASS - ACEUNIT_PRE_AFTERCLASS(); + ACEUNIT_PRE_AFTERCLASS #endif invokeAll(afterClass); #ifdef ACEUNIT_POST_AFTERCLASS - ACEUNIT_POST_AFTERCLASS(); + ACEUNIT_POST_AFTERCLASS #endif #ifdef ACEUNIT_LOG_FIXTURE globalLog(fixtureEnded, fixture->id); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-09-26 21:25:01
|
Revision: 339 http://aceunit.svn.sourceforge.net/aceunit/?rev=339&view=rev Author: christianhujer Date: 2008-09-26 21:24:53 +0000 (Fri, 26 Sep 2008) Log Message: ----------- Reformatted source code. Modified Paths: -------------- trunk/src/java/src/prj/net/sf/aceunit/CommentToWhitespaceReader.java trunk/src/java/src/prj/net/sf/aceunit/Fixture.java trunk/src/java/src/prj/net/sf/aceunit/GenTest.java trunk/src/java/src/prj/net/sf/aceunit/IdGenerator.java trunk/src/java/src/prj/net/sf/aceunit/MethodList.java trunk/src/java/src/prj/net/sf/aceunit/Pckg.java trunk/src/java/src/prj/net/sf/aceunit/SourceFiles.java trunk/src/java/src/prj/net/sf/aceunit/Suite.java Modified: trunk/src/java/src/prj/net/sf/aceunit/CommentToWhitespaceReader.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/CommentToWhitespaceReader.java 2008-09-26 21:24:24 UTC (rev 338) +++ trunk/src/java/src/prj/net/sf/aceunit/CommentToWhitespaceReader.java 2008-09-26 21:24:53 UTC (rev 339) @@ -30,10 +30,13 @@ import java.io.FilterReader; import java.io.Reader; import java.io.IOException; + import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.NotNull; -/** A NoCommentReader is a reader which replaces comments (C++, C99, Java) with whitespace. +/** + * A NoCommentReader is a reader which replaces comments (C++, C99, Java) with whitespace. + * * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class CommentToWhitespaceReader extends FilterReader { @@ -73,17 +76,22 @@ } // enum State /** The Sync Lock. */ - @NotNull private final Object syncLock = new Object(); + @NotNull + private final Object syncLock = new Object(); /** The internal parser state, we begin with State.NORMAL. */ - @NotNull private State state = State.NORMAL; + @NotNull + private State state = State.NORMAL; - /** The cached character is used to return a char that can only be returned when its following char was konwn. + /** + * The cached character is used to return a char that can only be returned when its following char was konwn. * If this is <code>null</code>, there is no cached character. */ - @Nullable private Integer cachedChar; + @Nullable + private Integer cachedChar; - /** Creates a new NoCommentReader. + /** + * Creates a new NoCommentReader. * * @param in a Reader protected providing the underlying stream. * @throws NullPointerException if <code>in</code> is <code>null</code> @@ -107,137 +115,139 @@ } int rc; //noinspection StatementWithEmptyBody - while ((rc = readImpl()) == -2); + while ((rc = readImpl()) == -2) ; return rc; } } - /** Implementation of {@link #read()}. + /** + * Implementation of {@link #read()}. + * * @return read character. + * @throws IOException In caes of I/O problems. * @retval -1 in case of end of file. * @retval -2 in case this function needs to be invoked again. - * @throws IOException In caes of I/O problems. */ private int readImpl() throws IOException { final int c = super.read(); int rc; switch (state) { - case NORMAL: - if (c == '/') { - state = State.SLASH; - rc = -2; - } else if (c == '\\') { - state = State.ESCAPE; - rc = c; - } else if (c == '"') { - state = State.STRING; - rc = c; - } else if (c == '\'') { - state = State.CHAR; - rc = c; - } else { - state = State.NORMAL; - rc = c; - } - break; - case SLASH: - if (c == '/') { - state = State.EOL_COMMENT; - cachedChar = (int) ' '; - rc = ' '; - } else if (c == '*') { - state = State.ML_COMMENT; - cachedChar = (int) ' '; - rc = ' '; - } else { - state = State.NORMAL; - cachedChar = c; - rc = '/'; - } - break; - case EOL_COMMENT: - if (c == '\n') { - state = State.NORMAL; - rc = c; - } else if (c == '\r') { - state = State.NORMAL; - rc = c; - } else { - state = State.EOL_COMMENT; - rc = c == -1 ? c : ' '; - } - break; - case ML_COMMENT: - if (c == '\n') { - state = State.ML_COMMENT; - rc = c; - } else if (c == '\r') { - state = State.ML_COMMENT; - rc = c; - } else if (c == '*') { - state = State.MAYBE_END_OF_ML_COMMENT; - rc = ' '; - } else { - state = State.ML_COMMENT; - rc = c == -1 ? c : ' '; - } - break; - case MAYBE_END_OF_ML_COMMENT: - if (c == '\n') { - state = State.ML_COMMENT; - rc = c; - } else if (c == '\r') { - state = State.ML_COMMENT; - rc = c; - } else if (c == '*') { - state = State.MAYBE_END_OF_ML_COMMENT; - rc = ' '; - } else if (c == '/') { - state = State.NORMAL; - rc = ' '; - } else { - state = State.ML_COMMENT; - rc = ' '; - } - break; - case ESCAPE: + case NORMAL: + if (c == '/') { + state = State.SLASH; + rc = -2; + } else if (c == '\\') { + state = State.ESCAPE; + rc = c; + } else if (c == '"') { + state = State.STRING; + rc = c; + } else if (c == '\'') { + state = State.CHAR; + rc = c; + } else { state = State.NORMAL; rc = c; - break; - case CHAR: - if (c == '\'') { - state = State.NORMAL; - rc = c; - } else if (c == '\\') { - state = State.ESCAPE_IN_CHAR; - rc = c; - } else { - state = State.CHAR; - rc = c; - } - break; - case ESCAPE_IN_CHAR: + } + break; + case SLASH: + if (c == '/') { + state = State.EOL_COMMENT; + cachedChar = (int) ' '; + rc = ' '; + } else if (c == '*') { + state = State.ML_COMMENT; + cachedChar = (int) ' '; + rc = ' '; + } else { + state = State.NORMAL; + cachedChar = c; + rc = '/'; + } + break; + case EOL_COMMENT: + if (c == '\n') { + state = State.NORMAL; + rc = c; + } else if (c == '\r') { + state = State.NORMAL; + rc = c; + } else { + state = State.EOL_COMMENT; + rc = c == -1 ? c : ' '; + } + break; + case ML_COMMENT: + if (c == '\n') { + state = State.ML_COMMENT; + rc = c; + } else if (c == '\r') { + state = State.ML_COMMENT; + rc = c; + } else if (c == '*') { + state = State.MAYBE_END_OF_ML_COMMENT; + rc = ' '; + } else { + state = State.ML_COMMENT; + rc = c == -1 ? c : ' '; + } + break; + case MAYBE_END_OF_ML_COMMENT: + if (c == '\n') { + state = State.ML_COMMENT; + rc = c; + } else if (c == '\r') { + state = State.ML_COMMENT; + rc = c; + } else if (c == '*') { + state = State.MAYBE_END_OF_ML_COMMENT; + rc = ' '; + } else if (c == '/') { + state = State.NORMAL; + rc = ' '; + } else { + state = State.ML_COMMENT; + rc = ' '; + } + break; + case ESCAPE: + state = State.NORMAL; + rc = c; + break; + case CHAR: + if (c == '\'') { + state = State.NORMAL; + rc = c; + } else if (c == '\\') { + state = State.ESCAPE_IN_CHAR; + rc = c; + } else { state = State.CHAR; rc = c; - break; - case STRING: - if (c == '"') { - state = State.NORMAL; - rc = c; - } else if (c == '\\') { - state = State.ESCAPE_IN_STRING; - rc = c; - } else { - state = State.STRING; - rc = c; - } - break; - case ESCAPE_IN_STRING: + } + break; + case ESCAPE_IN_CHAR: + state = State.CHAR; + rc = c; + break; + case STRING: + if (c == '"') { + state = State.NORMAL; + rc = c; + } else if (c == '\\') { + state = State.ESCAPE_IN_STRING; + rc = c; + } else { state = State.STRING; rc = c; - break; - default: - throw new AssertionError("Missing case in above switch."); + } + break; + case ESCAPE_IN_STRING: + state = State.STRING; + rc = c; + break; + default: + throw new AssertionError("Missing case in above switch."); } return rc; } Modified: trunk/src/java/src/prj/net/sf/aceunit/Fixture.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/Fixture.java 2008-09-26 21:24:24 UTC (rev 338) +++ trunk/src/java/src/prj/net/sf/aceunit/Fixture.java 2008-09-26 21:24:53 UTC (rev 339) @@ -32,32 +32,35 @@ import java.util.List; import java.io.File; import java.io.IOException; + import org.jetbrains.annotations.NotNull; -/** The Fixture represents a single test fixture along with all its methods. +/** + * The Fixture represents a single test fixture along with all its methods. * It is intentional that the Ids of the test methods are not globally unique. * Globally unique test method ids would lead to changes in fixtures if the number of test cases in previously scanned fixtures changes. + * * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class Fixture extends Suite { /** The list of {@code @Test} methods. */ - private final MethodList testMethods = MethodList.createTestMethodList(); + private final MethodList testMethods = MethodList.createTestMethodList(); /** The list of {@code @Before} methods. */ - private final MethodList beforeMethods = MethodList.createBeforeMethodList(); + private final MethodList beforeMethods = MethodList.createBeforeMethodList(); /** The list of {@code @After} methods. */ - private final MethodList afterMethods = MethodList.createAfterMethodList(); + private final MethodList afterMethods = MethodList.createAfterMethodList(); /** The list of {@code @BeforeClass} methods. */ private final MethodList beforeClassMethods = MethodList.createBeforeClassMethodList(); /** The list of {@code @AfterClass} methods. */ - private final MethodList afterClassMethods = MethodList.createAfterClassMethodList(); + private final MethodList afterClassMethods = MethodList.createAfterClassMethodList(); /** The list of {@code @Ignore} methods. */ - private final MethodList ignoreMethods = MethodList.createIgnoreMethodList(); + private final MethodList ignoreMethods = MethodList.createIgnoreMethodList(); /** All method lists for easy iteration. */ private final List<MethodList> methodLists = Arrays.asList(testMethods, beforeMethods, afterMethods, beforeClassMethods, afterClassMethods, ignoreMethods); @@ -65,8 +68,10 @@ /** All method lists for used methods for easy iteration. */ private final List<MethodList> usedMethodLists = Arrays.asList(testMethods, beforeMethods, afterMethods, beforeClassMethods, afterClassMethods); - /** Creates a Fixture with the specified id. - * @param id The id of this Fixture. + /** + * Creates a Fixture with the specified id. + * + * @param id The id of this Fixture. * @param file File to create fixture for. * @throws IOException In case of I/O problems. */ @@ -74,8 +79,10 @@ this(id, SourceFiles.readSourceWithoutComments(file)); } - /** Creates a Fixture with the specified id. - * @param id The id of this Fixture. + /** + * Creates a Fixture with the specified id. + * + * @param id The id of this Fixture. * @param sourceCode C source code for this fixture. */ public Fixture(final int id, @NotNull final String sourceCode) { @@ -83,7 +90,9 @@ findMethods(sourceCode); } - /** Finds all methods of all method lists in the specified source. + /** + * Finds all methods of all method lists in the specified source. + * * @param cSource C source to search. */ private void findMethods(@NotNull final String cSource) { @@ -145,7 +154,9 @@ return out.toString(); } - /** Returns source code for the fixture. + /** + * Returns source code for the fixture. + * * @param basename Base name of the fixture. * @return Source code for the fixture. */ @@ -167,7 +178,9 @@ return out.toString(); } - /** Returns source code for all method prototypes. + /** + * Returns source code for all method prototypes. + * * @return Source code for all method prototypes. */ public String getPrototypes() { @@ -181,7 +194,9 @@ return out.toString(); } - /** Returns a String with the source code for the test method ids. + /** + * Returns a String with the source code for the test method ids. + * * @return Source code for the test method ids. */ public String getTestMethodIds() { Modified: trunk/src/java/src/prj/net/sf/aceunit/GenTest.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/GenTest.java 2008-09-26 21:24:24 UTC (rev 338) +++ trunk/src/java/src/prj/net/sf/aceunit/GenTest.java 2008-09-26 21:24:53 UTC (rev 339) @@ -30,22 +30,27 @@ import java.io.File; import java.io.IOException; import java.util.List; + import net.sf.japi.io.args.ArgParser; import net.sf.japi.io.args.BasicCommand; import net.sf.japi.io.args.Option; import org.jetbrains.annotations.NotNull; -/** Program for generating the code that's needed to execute a fixture. +/** + * Program for generating the code that's needed to execute a fixture. * This is a prototype in Java. * The final version should be in C so a developer is not required to run Java in a C development environment. + * * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class GenTest extends BasicCommand { - /** Main program. + /** + * Main program. + * * @param args Currently the first argument must be the base name of the file to create a fixture for, e.g. "example", without file ending. + * @throws IOException in case of I/O problems. * @note the interface is subject of change. - * @throws IOException in case of I/O problems. */ public static void main(@NotNull final String... args) throws IOException { ArgParser.simpleParseAndRun(new GenTest(), args); @@ -54,18 +59,24 @@ /** Whether to overwrite write-protected files. */ private boolean force; - /** The IdGenerator which is used for generating unique ids for Suites. + /** + * The IdGenerator which is used for generating unique ids for Suites. * It is used for all {@link Suite}s ({@link Pckg}s and {@link Fixture}s). */ - @NotNull private final IdGenerator idGenerator = new IdGenerator(); + @NotNull + private final IdGenerator idGenerator = new IdGenerator(); - /** Creates a GenTest instance. + /** + * Creates a GenTest instance. + * * @throws IOException in case of I/O problems. */ public GenTest() throws IOException { } - /** Sets whether overwriting of existing files should be enforced. + /** + * Sets whether overwriting of existing files should be enforced. + * * @param force Whether overwriting of existing files should be enforced. */ @Option({"f", "force"}) @@ -73,12 +84,14 @@ this.force = force; } - /** Performs the generation of tests. + /** + * Performs the generation of tests. + * * @param basename Base name to generate tests for. * This may be a file when appending '.c' or a directory or both. * If it is neither nor, an {@link IllegalArgumentException} is thrown. * @return <code>true</code> if tests were found, otherwise <code>false</code>. - * @throws IOException In case of I/O problems. + * @throws IOException In case of I/O problems. * @throws IllegalArgumentException in case <var>basename</var> is not a directory and no file <code><var>basename</var>.c</code> was found. */ private boolean perform(@NotNull final String basename) throws IOException { @@ -113,8 +126,10 @@ return baseFound || testsFound; } - /** 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. + /** + * 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 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. @@ -131,8 +146,10 @@ return containedFixture; } - /** Performs the generation of tests for a fixtureFile. - * @param base Base directory of the tree, required to determine what part of the path is package. + /** + * Performs the generation of tests for a fixtureFile. + * + * @param base Base directory of the tree, required to determine what part of the path is package. * @param fixtureFile File that contains the fixtureFile. * @return <code>true</code> if the source code contained a fixture, otherwise <code>false</code> * @throws IOException In case of I/O problems. Modified: trunk/src/java/src/prj/net/sf/aceunit/IdGenerator.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/IdGenerator.java 2008-09-26 21:24:24 UTC (rev 338) +++ trunk/src/java/src/prj/net/sf/aceunit/IdGenerator.java 2008-09-26 21:24:53 UTC (rev 339) @@ -1,6 +1,8 @@ package net.sf.aceunit; -/** Generator for consecutive Ids. +/** + * Generator for consecutive Ids. + * * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class IdGenerator { @@ -8,21 +10,26 @@ /** The last used id. */ private int lastId; - /** Creates an IdGenerator. + /** + * Creates an IdGenerator. * The {@link #lastId} will be 0 which means the id returned by {@link #getNextId()} will be 1. */ public IdGenerator() { this(0); } - /** Creates an IdGenerator. + /** + * Creates an IdGenerator. + * * @param lastId Last id used, {@link #getNextId()} will return that value + 1. */ public IdGenerator(final int lastId) { this.lastId = lastId; } - /** Returns the next id. + /** + * Returns the next id. + * * @return The next id. */ public int getNextId() { Modified: trunk/src/java/src/prj/net/sf/aceunit/MethodList.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/MethodList.java 2008-09-26 21:24:24 UTC (rev 338) +++ trunk/src/java/src/prj/net/sf/aceunit/MethodList.java 2008-09-26 21:24:53 UTC (rev 339) @@ -35,37 +35,48 @@ import java.util.Formatter; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jetbrains.annotations.NotNull; -/** A MethodList finds and contains all methods of a certain annotation type. +/** + * A MethodList finds and contains all methods of a certain annotation type. + * * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class MethodList implements Iterable<String> { /** The annotation to find. */ - @NotNull private final String annotation; + @NotNull + private final String annotation; /** The regular expression to use for finding annotated methods. */ - @NotNull private final Pattern pattern; + @NotNull + private final Pattern pattern; /** The variable name to use for symbols related to this MethodList. */ - @NotNull private final String symName; + @NotNull + private final String symName; /** The title to use for this method list, used in comments. */ - @NotNull private final String title; + @NotNull + private final String title; /** The names of the methods found to be annotated. */ - @NotNull private final List<String> methodNames = new ArrayList<String>(); + @NotNull + private final List<String> methodNames = new ArrayList<String>(); /** The unmodifiable view of {@link #methodNames}. */ - @NotNull private final Collection<String> unmodifiableMethodNames = Collections.unmodifiableCollection(methodNames); + @NotNull + private final Collection<String> unmodifiableMethodNames = Collections.unmodifiableCollection(methodNames); - /** Create a MethodList. + /** + * Create a MethodList. * The MethodListis initially empty. * Invoke {@link #findMethods(String)} to fill this MethodList. + * * @param annotation Annotation to find. - * @param symName Name to use for symbols related to this MethodList. - * @param title Title to use e.g. in comments. + * @param symName Name to use for symbols related to this MethodList. + * @param title Title to use e.g. in comments. */ public MethodList(@NotNull final String annotation, @NotNull final String symName, @NotNull final String title) { this.annotation = annotation; @@ -74,56 +85,73 @@ this.title = title; } - /** Creates a MethodList for A_Test. + /** + * Creates a MethodList for A_Test. + * * @return MethodList for A_Test */ public static MethodList createTestMethodList() { return new MethodList("A_Test", "testCases", "test cases"); } - /** Creates a MethodList for A_Before. + /** + * Creates a MethodList for A_Before. + * * @return MethodList for A_Before */ public static MethodList createBeforeMethodList() { return new MethodList("A_Before", "before", "before methods"); } - /** Creates a MethodList for A_After. + /** + * Creates a MethodList for A_After. + * * @return MethodList for A_After */ public static MethodList createAfterMethodList() { return new MethodList("A_After", "after", "after methods"); } - /** Creates a MethodList for A_BeforeClass. + /** + * Creates a MethodList for A_BeforeClass. + * * @return MethodList for A_BeforeClass */ public static MethodList createBeforeClassMethodList() { return new MethodList("A_BeforeClass", "beforeClass", "beforeClass methods"); } - /** Creates a MethodList for A_AfterClass. + /** + * Creates a MethodList for A_AfterClass. + * * @return MethodList for A_AfterClass */ public static MethodList createAfterClassMethodList() { return new MethodList("A_AfterClass", "afterClass", "afterClass methods"); } - /** Creates a MethodList for A_Ignore. + /** + * Creates a MethodList for A_Ignore. + * * @return MethodList for A_Ignore */ public static MethodList createIgnoreMethodList() { return new MethodList("A_Ignore", "ignore", "ignored methods"); } - /** Returns the annotation this MethodList was created for. + /** + * Returns the annotation this MethodList was created for. + * * @return The annotation this MethodList was created for. */ - @NotNull public String getAnnotation() { + @NotNull + public String getAnnotation() { return annotation; } - /** Finds all annotated methods in the specified C source. + /** + * Finds all annotated methods in the specified C source. + * * @param cSource C source to search. */ public void findMethods(@NotNull final String cSource) { @@ -134,7 +162,9 @@ } } - /** Returns whether this MethodList contains a method with the specified name. + /** + * Returns whether this MethodList contains a method with the specified name. + * * @param methodName Method name to look for. * @return <code>true</code> if this MethodList contains a method with the specified name, otherwise <code>false</code>. */ @@ -143,32 +173,42 @@ } /** {@inheritDoc} */ - @NotNull public Iterator<String> iterator() { + @NotNull + public Iterator<String> iterator() { return methodNames.iterator(); } - /** Removes from this MethodList all methods that are in the specified list. + /** + * Removes from this MethodList all methods that are in the specified list. + * * @param list List with methods that should be removed from this MethodList. */ public void removeAll(@NotNull final MethodList list) { methodNames.removeAll(list.methodNames); } - /** Returns a collection with all method names. + /** + * Returns a collection with all method names. + * * @return A collection with all method names. */ - @NotNull public Collection<String> getMethodNames() { + @NotNull + public Collection<String> getMethodNames() { return unmodifiableMethodNames; } - /** Returns the number of methods in this methodlist. + /** + * Returns the number of methods in this methodlist. + * * @return Number of methods in this method list. */ public int size() { return methodNames.size(); } - /** Creates source code for an array of function pointers for this method list. + /** + * Creates source code for an array of function pointers for this method list. + * * @return Source code for the function pointer array. */ public String getFunctionPointerList() { Modified: trunk/src/java/src/prj/net/sf/aceunit/Pckg.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/Pckg.java 2008-09-26 21:24:24 UTC (rev 338) +++ trunk/src/java/src/prj/net/sf/aceunit/Pckg.java 2008-09-26 21:24:53 UTC (rev 339) @@ -28,19 +28,25 @@ package net.sf.aceunit; import org.jetbrains.annotations.NotNull; + import java.util.Formatter; import java.util.ArrayList; import java.util.List; -/** A Pckg is a Suite that contains other Suites. +/** + * A Pckg is a Suite that contains other Suites. + * * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class Pckg extends Suite { /** The list of suites found. */ - @NotNull private final List<Suite> suites = new ArrayList<Suite>(); + @NotNull + private final List<Suite> suites = new ArrayList<Suite>(); - /** Creates a Pckg with the specified id. + /** + * Creates a Pckg with the specified id. + * * @param id The id for this Pckg. */ public Pckg(final int id) { @@ -56,7 +62,9 @@ return containsTests; } - /** Adds a Suite to this Pckg. + /** + * Adds a Suite to this Pckg. + * * @param suite Suite to add */ public void addSuite(@NotNull final Suite suite) { Modified: trunk/src/java/src/prj/net/sf/aceunit/SourceFiles.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/SourceFiles.java 2008-09-26 21:24:24 UTC (rev 338) +++ trunk/src/java/src/prj/net/sf/aceunit/SourceFiles.java 2008-09-26 21:24:53 UTC (rev 339) @@ -28,6 +28,7 @@ package net.sf.aceunit; import org.jetbrains.annotations.NotNull; + import java.io.File; import java.io.IOException; import java.io.Reader; @@ -38,7 +39,9 @@ import java.io.BufferedReader; import static java.util.logging.Logger.getAnonymousLogger; -/** Utility class with methods for reading source files. +/** + * Utility class with methods for reading source files. + * * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public final class SourceFiles { @@ -59,15 +62,19 @@ } }; - /** Flag to remember whether we've already warned the user about 1.6 being required for removing a write protection from a file. + /** + * Flag to remember whether we've already warned the user about 1.6 being required for removing a write protection from a file. * We do not want to spam the user with the same message over and over again. */ private static boolean warned16RequiredForSetWritable; /** Utility class - do not instanciate. */ - private SourceFiles() {} + private SourceFiles() { + } - /** Reads a source file. + /** + * Reads a source file. + * * @param file File of the source to read. * @return String with the contents of the specified file. * @throws java.io.IOException in case of I/O problems. @@ -83,7 +90,9 @@ return sb.toString(); } - /** Reads a source file without comments. + /** + * Reads a source file without comments. + * * @param file File of the source to read. * @return String with the contents of the specified file. * @throws java.io.IOException in case of I/O problems. @@ -99,9 +108,11 @@ return sb.toString(); } - /** Writes a String to a file if the String differs from the file's content. - * @param file File to write to. - * @param text String to write to the file. + /** + * Writes a String to a file if the String differs from the file's content. + * + * @param file File to write to. + * @param text String to write to the file. * @param force Set this to true if a write protection from the file should be removed. * @throws java.io.IOException In case of I/O problems. */ Modified: trunk/src/java/src/prj/net/sf/aceunit/Suite.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/Suite.java 2008-09-26 21:24:24 UTC (rev 338) +++ trunk/src/java/src/prj/net/sf/aceunit/Suite.java 2008-09-26 21:24:53 UTC (rev 339) @@ -29,9 +29,11 @@ import org.jetbrains.annotations.NotNull; -/** A Suite is a collection of Test Cases. +/** + * A Suite is a collection of Test Cases. * A Suite can either be a Fixture that really contains Test Cases, * or a Pckg which is a Suite that contains other Suites. + * * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public abstract class Suite { @@ -39,29 +41,38 @@ /** The id of this Suite. */ private final int id; - /** Creates a Suite. + /** + * Creates a Suite. + * * @param id Id for this Suite. */ protected Suite(final int id) { this.id = id; } - /** Returns the id of this Suite. + /** + * Returns the id of this Suite. + * * @return The id of this Suite. */ public int getId() { return id; } - /** Returns whether this suite contains tests. + /** + * Returns whether this suite contains tests. + * * @return <code>true</code> if this fiture contains test cases, otherwise <code>false</code>. */ public abstract boolean containsTests(); - /** Returns a String repsuites.size() > 0;C-Source code for this Suite. + /** + * Returns a String repsuites.size() > 0;C-Source code for this Suite. + * * @param basename Base name of this Suite. * @return String with the C-Source for this Suite. */ - @NotNull public abstract String getCode(@NotNull final String basename); + @NotNull + public abstract String getCode(@NotNull final String basename); } // class Pckg This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-09-26 21:24:36
|
Revision: 338 http://aceunit.svn.sourceforge.net/aceunit/?rev=338&view=rev Author: christianhujer Date: 2008-09-26 21:24:24 +0000 (Fri, 26 Sep 2008) Log Message: ----------- Updated settings. Modified Paths: -------------- trunk/src/java/AceUnit.ipr Modified: trunk/src/java/AceUnit.ipr =================================================================== --- trunk/src/java/AceUnit.ipr 2008-09-22 21:55:33 UTC (rev 337) +++ trunk/src/java/AceUnit.ipr 2008-09-26 21:24:24 UTC (rev 338) @@ -250,7 +250,7 @@ </option> <option name="lastEditedConfigurable" value="Project 'Default (Template) Project'" /> </component> - <component name="ProjectRootManager" version="2" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK"> + <component name="ProjectRootManager" version="2" assert-keyword="true" jdk-15="true" project-jdk-name="latest" project-jdk-type="JavaSDK"> <output url="file://$PROJECT_DIR$/classes" /> </component> <component name="ResourceManagerContainer"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-09-22 21:55:39
|
Revision: 337 http://aceunit.svn.sourceforge.net/aceunit/?rev=337&view=rev Author: christianhujer Date: 2008-09-22 21:55:33 +0000 (Mon, 22 Sep 2008) Log Message: ----------- Marked AceUnitPrintf.c as work in progress - do not use. Modified Paths: -------------- trunk/src/native/AceUnitPrintf.c Modified: trunk/src/native/AceUnitPrintf.c =================================================================== --- trunk/src/native/AceUnitPrintf.c 2008-09-22 21:12:57 UTC (rev 336) +++ trunk/src/native/AceUnitPrintf.c 2008-09-22 21:55:33 UTC (rev 337) @@ -27,6 +27,9 @@ /** AceUnit implementation of printf. * This primitive implementation allows using printf-like operations even in extremely resource constrained embedded devices. + * + * @warning This is work in progress. Do not use! + * * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @file AceUnitPrintf.c */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-09-22 21:13:06
|
Revision: 336 http://aceunit.svn.sourceforge.net/aceunit/?rev=336&view=rev Author: christianhujer Date: 2008-09-22 21:12:57 +0000 (Mon, 22 Sep 2008) Log Message: ----------- Adding printf work in progress. Modified Paths: -------------- trunk/README trunk/TODO trunk/src/native/test/Makefile Added Paths: ----------- trunk/src/native/AceUnitPrintf.c trunk/src/native/test/printf/ trunk/src/native/test/printf/AceUnitPrintfTest.c trunk/src/native/test/printf/Makefile Modified: trunk/README =================================================================== --- trunk/README 2008-03-18 22:57:52 UTC (rev 335) +++ trunk/README 2008-09-22 21:12:57 UTC (rev 336) @@ -21,6 +21,7 @@ Java 1.6 is required to build the generator. C89 is required for AceUnit. If C99 is available, AceUnit can make use of it. +A C99 environment is strongly recommended. DIRECTORY STRUCTURE @@ -34,3 +35,5 @@ src/native The source code that you need for building programs with AceUnit. + This also contains tests which can be used to test AceUnit with itself. + Also, these tests are examples of how to use AceUnit. Modified: trunk/TODO =================================================================== --- trunk/TODO 2008-03-18 22:57:52 UTC (rev 335) +++ trunk/TODO 2008-09-22 21:12:57 UTC (rev 336) @@ -11,3 +11,9 @@ * Add proper runner tree that makes makes use of every logger method. * Add generation of main() * Add suites that consist of suites and fixtures. Suites are packages for now. +* Add groups which are an orthogonal grouping system to the tree of suites with fixtures with testcases. +* Extend the runner to get information about what to run. +* Extend the runner to optionally use fork() like check. +* Extend the generator to output a mapping table between ids and strings. +* Add a library for C to access that mapping table. +* Add a library for Java to access that mapping table. Added: trunk/src/native/AceUnitPrintf.c =================================================================== --- trunk/src/native/AceUnitPrintf.c (rev 0) +++ trunk/src/native/AceUnitPrintf.c 2008-09-22 21:12:57 UTC (rev 336) @@ -0,0 +1,156 @@ +/* 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. + */ + +/** AceUnit implementation of printf. + * This primitive implementation allows using printf-like operations even in extremely resource constrained embedded devices. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @file AceUnitPrintf.c + */ + +#include <stdarg.h> + +#ifdef ACEUNIT_CODE_INCLUDE +#include ACEUNIT_CODE_INCLUDE +#endif + +typedef enum { + + NORMAL, + + FMT_START, + + FMT_LENGTH + +} fmt_state_t; + +/** Character writer. + * Used by aceunitPrintfImpl to perform the output. + * @param c character to write + */ +typedef (void)(*aceunitPutchar_fptr_t)(int c); + +/** Prints a formatted message. + * + * This is a minimalistic implementation of printf. + * It is guaranteed to support the following subset of the formatting specified in C99: + * - The only supported character set and encoding is US-ASCII-7. + * - The only supported flag is <code>0</code>. + * - Setting the field width is not supported. The field width is fixed to not given for conversions <code>s</code> and <code>%</code>, 8 for <code>x</code>, <code>X</code> and <code>p</code>. + * - Precision is not supported. + * - Length modifier is supported within the limited range 1..8. + * - The only supported conversion specifiers are: <code>s</code>, <code>x</code>, <code>X</code>, <code>p</code> and <code>%</code>. + * - The only supported argument types are <code>char *</code>, <code>void *</code> and <code>long int</code>. + * More features may be supported by different implementations. + * + * @note You should not use this for regular test logging. + * Something worth logging is something worth checking, so instead of looking at the log to see whether what's going on is correct, you should programmatically verify your assumptions. + * That's what testing is about. + * + * @param format Format string. + * + * @return The number of characters transmitted, or a negative value if an output or encoding error occurred. + * + * @see ISO/IEC 9899:1999 Programming languages - C, chapter 7.19.6.1 The fprintf function + */ +int aceunitPrintfImpl(aceunitPutchar_fptr_t putchar, const char * restrict format, ...) +{ + char fmtChar; + int charsTransmitted; + va_list args; + fmt_state_t fmtState = NORMAL; + + bool printLeadingZeros = false; + int length = 0; + bool upperCase; + + va_start(args, format); + + while (fmtChar = *format++) { + switch (fmtState) { + case NORMAL: + switch (fmtChar) { + case '%': + fmtState = FORMAT_START; + break; + default: + aceunitPutchar(fmtChar); + } + break; + case FORMAT_START: + switch (fmtChar) { + case '%': + aceunitPutchar('%'); + state = NORMAL; + break; + case '0': + printLeadingZeros = true; + break; + case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': + length = fmtChar - '0'; + break; + case 'X': + upperCase = true; + //-fallthrough + case 'x': + case 'p': + { + uint32_t value = va_arg(args, uint32_t); + int i; + bool first = true; + for (i = 7; i >= 0; i--) { + uint8_t nibble = (uint8_t) ((value >> (i * 4)) & 0xF); + if (!first || (nibble != 0) || printLeadingZeros) { + aceunitPutchar(nibble + ((nibble <= 9) ? '0' : (upperCase ? 'A' : 'a') - 10)); + first = false; + } + } + } + break; + default: + // Unknown format or flag, simply ignore it. + } + } + while ((fmtChar = *format++)) { + if (fmtChar == '%') { + switch (*format++) { + case 0: + } + while (fmtChar = *format++) { + int flags = 0; + switch (fmtChar) { + case '0': + break; + } + } else { + break; + } + } else { + aceunitPutchar(fmtChar); + } + } +end: +} Property changes on: trunk/src/native/AceUnitPrintf.c ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/src/native/test/Makefile =================================================================== --- trunk/src/native/test/Makefile 2008-03-18 22:57:52 UTC (rev 335) +++ trunk/src/native/test/Makefile 2008-09-22 21:12:57 UTC (rev 336) @@ -1,4 +1,13 @@ -DIRS=basic basicEmbedded comment exhand longjmp xmlLog twoFixtures recursive +DIRS= \ + basic \ + basicEmbedded \ + comment \ + exhand \ + longjmp \ + printf \ + recursive \ + twoFixtures \ + xmlLog \ all: @for dir in $(DIRS) ; do (cd $$dir ; make) ; done Added: trunk/src/native/test/printf/AceUnitPrintfTest.c =================================================================== --- trunk/src/native/test/printf/AceUnitPrintfTest.c (rev 0) +++ trunk/src/native/test/printf/AceUnitPrintfTest.c 2008-09-22 21:12:57 UTC (rev 336) @@ -0,0 +1,78 @@ +/* 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's own printf. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @file + */ + +#include <stdbool.h> +#include <stdio.h> + +#define ACEUNIT_ASSERTION_STYLE ACEUNIT_ASSERTION_STYLE_RETURN + +#include "AceUnitData.h" +#include "AceUnitPrintfTest.h" + +/** Tests that {@link #assertEquals()} with equal values does not set recentError. */ +A_Test void testPrintfSimple() { + char *format = "foo"; + char *expected = "foo"; + + + assertEquals("assertEquals(msg, val1, val2) MUST NOT set recentError.", val1, val2); + if (runnerData->recentError != NULL) { + clearRecentError(); + fail("Expected recentError to be NULL."); + } +} + +/** 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. + * @param argc Command line argument count. + * @param argv Command line argument values. + * @return Exit status (currently always 0). + */ +int main(int argc, char *argv[]) { + 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/printf/AceUnitPrintfTest.c ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/src/native/test/printf/Makefile =================================================================== --- trunk/src/native/test/printf/Makefile (rev 0) +++ trunk/src/native/test/printf/Makefile 2008-09-22 21:12:57 UTC (rev 336) @@ -0,0 +1,60 @@ +LOGGER=FullPlainLogger + +ACE_UNIT_FILES=AceUnit.c AceUnit.h AceUnitData.c AceUnitData.h AceUnitData.h AceUnitAnnotations.h AceUnitLogging.h $(LOGGER).c AceUnit.jar + +ACE_UNIT_PATH=../../../ + +ACE_UNIT_JAVA_SRC=$(shell find $(ACE_UNIT_PATH)/java/src -name "*.java") + +FIXTURE_NAME=AceUnitTest + +all: prepare compile test + +clean: + rm -f $(ACE_UNIT_FILES) $(FIXTURE_NAME).h runTests *.gcov *.gcno *.gcda + +prepare: $(ACE_UNIT_FILES) + +AceUnit.c: $(ACE_UNIT_PATH)/native/AceUnit.c + cp $< $@ + +AceUnit.h: $(ACE_UNIT_PATH)/native/AceUnit.h + cp $< $@ + +AceUnitData.c: $(ACE_UNIT_PATH)/native/AceUnitData.c + cp $< $@ + +AceUnitData.h: $(ACE_UNIT_PATH)/native/AceUnitData.h + cp $< $@ + +AceUnitAnnotations.h: $(ACE_UNIT_PATH)/native/AceUnitAnnotations.h + cp $< $@ + +AceUnitLogging.h: $(ACE_UNIT_PATH)/native/AceUnitLogging.h + cp $< $@ + +$(LOGGER).c: $(ACE_UNIT_PATH)/native/$(LOGGER).c + cp $< $@ + +AceUnit.jar: $(ACE_UNIT_PATH)/java/AceUnit.jar + cp $(ACE_UNIT_PATH)/java/AceUnit.jar $@ + +$(ACE_UNIT_PATH)/java/AceUnit.jar: $(ACE_UNIT_JAVA_SRC) + ant -f $(ACE_UNIT_PATH)/java/build.xml + +compile: runTests + +$(FIXTURE_NAME).h: AceUnit.jar $(FIXTURE_NAME).c + java -jar AceUnit.jar $(FIXTURE_NAME) + +runTests: $(FIXTURE_NAME).c $(FIXTURE_NAME).h $(ACE_UNIT_FILES) + $(CC) -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -o runTests *.c + +test: runTests + ./runTests + +doc: $(FIXTURE_NAME).c $(FIXTURE_NAME).h $(ACE_UNIT_FILES) + doxygen + +coverage: test + gcov *.c Property changes on: trunk/src/native/test/printf/Makefile ___________________________________________________________________ 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-03-18 22:57:56
|
Revision: 335 http://aceunit.svn.sourceforge.net/aceunit/?rev=335&view=rev Author: christianhujer Date: 2008-03-18 15:57:52 -0700 (Tue, 18 Mar 2008) Log Message: ----------- [ 1918882 ] Generator does not build with Java 1.5 This doesn't fix that the Generator doesn't build with Java 1.5. But it makes the Generator run on 1.5. Modified Paths: -------------- trunk/src/java/src/prj/net/sf/aceunit/SourceFiles.java Modified: trunk/src/java/src/prj/net/sf/aceunit/SourceFiles.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/SourceFiles.java 2008-03-18 22:52:31 UTC (rev 334) +++ trunk/src/java/src/prj/net/sf/aceunit/SourceFiles.java 2008-03-18 22:57:52 UTC (rev 335) @@ -59,6 +59,11 @@ } }; + /** Flag to remember whether we've already warned the user about 1.6 being required for removing a write protection from a file. + * We do not want to spam the user with the same message over and over again. + */ + private static boolean warned16RequiredForSetWritable; + /** Utility class - do not instanciate. */ private SourceFiles() {} @@ -105,7 +110,14 @@ if (force) { if (!file.canWrite()) { getAnonymousLogger().info("Removing write protection from " + file); - file.setWritable(true); + try { + file.setWritable(true); + } catch (final NoSuchMethodError e) { + if (!warned16RequiredForSetWritable) { + getAnonymousLogger().warning("Java 1.6 required for removing write protections."); + warned16RequiredForSetWritable = true; + } + } } } final PrintWriter out = new PrintWriter(new FileWriter(file)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cdo...@us...> - 2008-03-18 22:52:28
|
Revision: 334 http://aceunit.svn.sourceforge.net/aceunit/?rev=334&view=rev Author: cdoenges Date: 2008-03-18 15:52:31 -0700 (Tue, 18 Mar 2008) Log Message: ----------- Changed the Java requirements to reflect the future need for Java 1.6. Modified Paths: -------------- trunk/README Modified: trunk/README =================================================================== --- trunk/README 2008-03-18 22:49:34 UTC (rev 333) +++ trunk/README 2008-03-18 22:52:31 UTC (rev 334) @@ -17,7 +17,8 @@ REQUIREMENTS ============ -Java 1.5 is required for the generator. +Java 1.5 is required to run the generator. +Java 1.6 is required to build the generator. C89 is required for AceUnit. If C99 is available, AceUnit can make use of it. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |