aceunit-commit Mailing List for AceUnit (Page 3)
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...> - 2009-08-21 19:53:22
|
Revision: 533
http://aceunit.svn.sourceforge.net/aceunit/?rev=533&view=rev
Author: christianhujer
Date: 2009-08-21 19:53:15 +0000 (Fri, 21 Aug 2009)
Log Message:
-----------
Fix some manual bugs. Improve manual.
Modified Paths:
--------------
trunk/src/doc/manual.xhtml
Modified: trunk/src/doc/manual.xhtml
===================================================================
--- trunk/src/doc/manual.xhtml 2009-08-21 19:52:46 UTC (rev 532)
+++ trunk/src/doc/manual.xhtml 2009-08-21 19:53:15 UTC (rev 533)
@@ -72,7 +72,8 @@
That information will be placed in the specified header file.
</p>
<p>
- We know that running Java in a C environment is not convenient in
+ We know that running Java in a C environment is not convenient.
+ As soon as the main framework is stable, there will be a C implementation of AceUnit.jar.
</p>
<h2>Variants of Unit Test Declaration</h2>
<p>
@@ -113,24 +114,22 @@
</dd>
-->
</dl>
- <!--
<h3>Naming Convention based testing</h3>
<p>
- When using the naming convention, the following naming conventions are used:
+ The following naming convention is recommended for the test names:
</p>
<dl>
<dt>test*</dt>
<dd>A test case method.</dd>
<dt>before*</dt>
- <dd>Before method, should be invoked before each test case in a fixture. Note: "*" must not match "Class*".</dd>
+ <dd>Before method, should be invoked before each test case in a fixture. Note: "*" MUST not match "Class*".</dd>
<dt>after*</dt>
- <dd>After method, should be invoked after each test case in a fixture. Note: "*" must not match "Class*".</dd>
+ <dd>After method, should be invoked after each test case in a fixture. Note: "*" MUST not match "Class*".</dd>
<dt>beforeClass*</dt>
<dd>BeforeClass method, should be invoked once for the fixture before all of its test cases.</dd>
<dt>afterClass*</dt>
<dd>AfterClass method, should be invoked once for the fixture after all of its test cases.</dd>
</dl>
- -->
<h2>AceUnit Glossary</h2>
<dl>
<dt>Annotation</dt>
@@ -176,7 +175,7 @@
* @retval <0 if o1 should be sorted before o2.
* @retval >0 if o1 should be sorted after o2.
*/
-typedef sint8_least_t(*comparator)(const void *o1, const void *o2);]]></pre>
+typedef int8_least_t(*comparator)(const void *o1, const void *o2);]]></pre>
<p>
For testing purposes, we want to sort ints.
So the first thing that we do is we test whether our comparator implementation works.
@@ -184,7 +183,7 @@
<pre><![CDATA[/** Comparator for int values.
* @see comparator
*/
-sint8_least_t compareInt(const void *o1, const void *o2) {
+int8_least_t compareInt(const void *o1, const void *o2) {
return 0;
}]]></pre>
<p>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2009-08-21 19:52:53
|
Revision: 532
http://aceunit.svn.sourceforge.net/aceunit/?rev=532&view=rev
Author: christianhujer
Date: 2009-08-21 19:52:46 +0000 (Fri, 21 Aug 2009)
Log Message:
-----------
Change upload for new sf remote access.
Modified Paths:
--------------
trunk/src/doc/build.xml
Modified: trunk/src/doc/build.xml
===================================================================
--- trunk/src/doc/build.xml 2009-08-21 16:42:38 UTC (rev 531)
+++ trunk/src/doc/build.xml 2009-08-21 19:52:46 UTC (rev 532)
@@ -99,7 +99,7 @@
<target name="uploadDoc" depends="transform, doxygen">
<exec executable="rsync" failonerror="true">
- <arg line="-auzv -e ssh docs/ ${user.rsync.username}@${user.rsync.host}:${user.rsync.dir}/htdocs/" />
+ <arg line="-auzv -e ssh docs/ ${user.rsync.username}@${user.rsync.host}:${user.rsync.dir}" />
</exec>
</target>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2009-08-21 16:42:45
|
Revision: 531
http://aceunit.svn.sourceforge.net/aceunit/?rev=531&view=rev
Author: christianhujer
Date: 2009-08-21 16:42:38 +0000 (Fri, 21 Aug 2009)
Log Message:
-----------
Fix typos.
Modified Paths:
--------------
trunk/src/native/AceUnit.h
Modified: trunk/src/native/AceUnit.h
===================================================================
--- trunk/src/native/AceUnit.h 2009-08-21 15:30:23 UTC (rev 530)
+++ trunk/src/native/AceUnit.h 2009-08-21 16:42:38 UTC (rev 531)
@@ -197,13 +197,13 @@
* </dd>
* </dl>
*
- * @warning AceUnit can define types foritself for exotic compilation environments where standard includes are not available or shall not be used.
+ * @warning AceUnit can define types for itself for exotic compilation environments where standard includes are not available or shall not be used.
* But though AceUnit can do that, this is strongly deprecated.
* This will certainly cause a lot of problems:
* - AceUnit "guesses" the types by assuming <code>short int</code> to be 16 bit and <code>long int</code> to be 32 bit.
* Especially about the second assumption AceUnit could be wrong.
* - Tools like lint are very picky about type definitions.
- * For lint it makes a difference if a type of size 16 bit is defiend as <code>short int</code> or <code>int</code>.
+ * For lint it makes a difference if a type of size 16 bit is defined as <code>short int</code> or <code>int</code>.
* For sure lint will find something to complain about if you let AceUnit define its own types instead of providing consistent types from your compilation environment.
*
* @author <a href="mailto:ch...@ri...">Christian Hujer</a>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2009-08-21 15:30:41
|
Revision: 530
http://aceunit.svn.sourceforge.net/aceunit/?rev=530&view=rev
Author: christianhujer
Date: 2009-08-21 15:30:23 +0000 (Fri, 21 Aug 2009)
Log Message:
-----------
Minor documentation updates.
Modified Paths:
--------------
trunk/src/doc/future.xhtml
trunk/src/doc/manual.xhtml
trunk/src/doc/start.xhtml
Modified: trunk/src/doc/future.xhtml
===================================================================
--- trunk/src/doc/future.xhtml 2009-08-19 22:25:52 UTC (rev 529)
+++ trunk/src/doc/future.xhtml 2009-08-21 15:30:23 UTC (rev 530)
@@ -17,7 +17,7 @@
<li>Optional feature: Create / finnish implementation of JUnit compatible loggers</li>
<li>Optional feature: Randomization of test order</li>
<li>Optional feature: Automatic generation of main() function</li>
- <li>Optional feature: Recursive suites</li>
+ <li>Optional feature: Off-Target Runner which runs the unit tests on-target by controlling a simulator or debug interface</li>
<li>Better logging of information, e.g. expected and actual values</li>
<li>Alternative test runner with more information, e.g. timing values</li>
<li>
Modified: trunk/src/doc/manual.xhtml
===================================================================
--- trunk/src/doc/manual.xhtml 2009-08-19 22:25:52 UTC (rev 529)
+++ trunk/src/doc/manual.xhtml 2009-08-21 15:30:23 UTC (rev 530)
@@ -50,7 +50,7 @@
This annotation will be the main interface between your unit tests and the AceUnit framework which will run them.
</p>
<h4>Example</h4>
- <pre>A_Test void someTestMethod() [
+ <pre>A_Test void someTestMethod() {
// test case implementation for this test case goes here
}</pre>
<p>
@@ -191,7 +191,7 @@
It is obvious that our current implementation is bogus.
In test first programming, you intentionally start with a bogus implementation to verify that your test actually detects that the implementation is bogus.
</p>
- <pre><![CDATA[/** Tests that {@link compareInt()} works. */
+ <pre><![CDATA[/** Tests that #compareInt() works. */
A_Test void testCompareInt() {
int n1;
int n2;
Modified: trunk/src/doc/start.xhtml
===================================================================
--- trunk/src/doc/start.xhtml 2009-08-19 22:25:52 UTC (rev 529)
+++ trunk/src/doc/start.xhtml 2009-08-21 15:30:23 UTC (rev 530)
@@ -20,14 +20,14 @@
</div>
-->
<p>
- Latest release version: <strong>aceunit-0.9.0</strong>
+ Latest release version: <strong>aceunit-0.10.0</strong>
</p>
<h2>What is AceUnit?</h2>
<!-- The description must match the project description at http://sourceforge.net/projects/aceunit/ -->
<p class="description">
AceUnit (Advanced C and Embedded Unit): a comfortable C code unit test framework.
AceUnit is JUnit 4.x style, easy, modular and flexible.
- AceUnit can be used in resource constraint environments, e.g. embedded software development.
+ AceUnit can be used in resource constraint environments, e.g. embedded software development, as well as on PCs, Workstations and Servers (Windows and UNIX).
</p>
<p>
AceUnit's current slogan is: <strong>Vitamins for your software quality!</strong>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2009-08-19 22:25:58
|
Revision: 529
http://aceunit.svn.sourceforge.net/aceunit/?rev=529&view=rev
Author: christianhujer
Date: 2009-08-19 22:25:52 +0000 (Wed, 19 Aug 2009)
Log Message:
-----------
Improved documentation on setId().
Modified Paths:
--------------
trunk/src/java/src/prj/net/sf/aceunit/Test.java
Modified: trunk/src/java/src/prj/net/sf/aceunit/Test.java
===================================================================
--- trunk/src/java/src/prj/net/sf/aceunit/Test.java 2009-08-19 22:10:58 UTC (rev 528)
+++ trunk/src/java/src/prj/net/sf/aceunit/Test.java 2009-08-19 22:25:52 UTC (rev 529)
@@ -69,11 +69,11 @@
}
/**
- * Sets the id of this test.
+ * Sets the id of this test (recursively).
*
* @param generator IdGenerator from which the id to set is retrieved.
- *
* @throws IllegalStateException in case the id is already set.
+ * @note Because of the recursive behaviour, the generator might be used more than once.
*/
public void setId(@NotNull final IdGenerator generator) throws IllegalStateException {
if (id != 0) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2009-08-19 22:11:10
|
Revision: 528
http://aceunit.svn.sourceforge.net/aceunit/?rev=528&view=rev
Author: christianhujer
Date: 2009-08-19 22:10:58 +0000 (Wed, 19 Aug 2009)
Log Message:
-----------
Give all tests a name, not just a testcase.
Modified Paths:
--------------
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/Pckg.java
trunk/src/java/src/prj/net/sf/aceunit/Suite.java
trunk/src/java/src/prj/net/sf/aceunit/Test.java
trunk/src/java/src/prj/net/sf/aceunit/TestCase.java
trunk/src/java/src/tst/test/net/sf/aceunit/PckgTest.java
trunk/src/java/src/tst/test/net/sf/aceunit/SuiteTest.java
Modified: trunk/src/java/src/prj/net/sf/aceunit/Fixture.java
===================================================================
--- trunk/src/java/src/prj/net/sf/aceunit/Fixture.java 2009-08-19 22:00:07 UTC (rev 527)
+++ trunk/src/java/src/prj/net/sf/aceunit/Fixture.java 2009-08-19 22:10:58 UTC (rev 528)
@@ -73,9 +73,6 @@
/** All method lists for used methods for easy iteration. */
private final List<MethodList> usedMethodLists = Arrays.asList(testMethods, beforeMethods, afterMethods, beforeClassMethods, afterClassMethods);
- /** The name of this fixture. */
- private final String fixtureName;
-
/**
* Creates a Fixture with the specified id.
*
@@ -83,8 +80,8 @@
* @throws IOException In case of I/O problems.
*/
public Fixture(@NotNull final File file) throws IOException {
+ super(file.getName().replaceAll("\\.c(pp)?$", ""));
findMethods(SourceFiles.readSourceWithoutComments(file));
- this.fixtureName = file.getName().replaceAll("\\.c(pp)?$", "");
}
/**
@@ -94,10 +91,10 @@
* @param source The source of this Fixture.
*/
public Fixture(@Nullable final File file, @Nullable final String source) {
+ super(file != null ? file.getName().replaceAll("\\.c$", "") : "dummy");
if (source != null) {
findMethods(source);
}
- this.fixtureName = file != null ? file.getName().replaceAll("\\.c$", "") : "dummy";
}
/**
@@ -207,7 +204,7 @@
out.format("#if defined __cplusplus%n");
out.format("extern%n");
out.format("#endif%n");
- out.format("const TestFixture_t %sFixture = {%n", fixtureName);
+ out.format("const TestFixture_t %sFixture = {%n", getName());
out.format(" %d,%n", getId());
out.format("#ifndef ACEUNIT_EMBEDDED%n");
out.format(" \"%s\",%n", basename);
@@ -239,7 +236,7 @@
/** {@inheritDoc} */
@Override public String getGlobalVariablename() {
- return fixtureName + "Fixture";
+ return getName() + "Fixture";
}
/** Creates a TestCase for each contained test method.
Modified: trunk/src/java/src/prj/net/sf/aceunit/GenTest.java
===================================================================
--- trunk/src/java/src/prj/net/sf/aceunit/GenTest.java 2009-08-19 22:00:07 UTC (rev 527)
+++ trunk/src/java/src/prj/net/sf/aceunit/GenTest.java 2009-08-19 22:10:58 UTC (rev 528)
@@ -75,6 +75,9 @@
/** The flattened list of all tests. */
private final List<String> allTests = new ArrayList<String>();
+ /** The root packages which were found so far. */
+ private final List<Pckg> roots = new ArrayList<Pckg>();
+
/**
* Creates a GenTest instance.
*
@@ -140,7 +143,7 @@
for (final File fixtureFile : fixtureFiles) {
if (fixtureFile.isFile()) {
baseFound = true;
- final boolean testsFoundInFile = performFixture(fixtureFile.getParentFile(), new Pckg(), fixtureFile);
+ final boolean testsFoundInFile = performFixture(fixtureFile.getParentFile(), new Pckg("dummy"), fixtureFile);
testsFound |= testsFoundInFile;
if (!testsFoundInFile) {
System.err.println(fixtureFile + ": warning: No test cases found. Maybe the annotations are missing?");
@@ -171,13 +174,14 @@
private boolean performPckg(@NotNull final File base, @Nullable final Pckg parent, @NotNull final File pckgDir) throws IOException {
assert pckgDir.isDirectory();
boolean containedFixture = false;
- final Pckg pckg = new Pckg();
+ final Pckg pckg = new Pckg("dummy");
// XXX:2009-08-16:christianhujer:Hack to keep the first suite id "1".
// The correct solution would be to separate scan and output.
// However, that solution might require more memory.
// So before that solution is implemented, a footprint analysis is required.
if (parent == null) {
pckg.setId(idGenerator);
+ roots.add(pckg);
}
for (final File dir : pckgDir.listFiles(SourceFiles.DIR_FILTER)) {
containedFixture |= performPckg(base, pckg, dir);
@@ -257,6 +261,9 @@
System.out.println(allTestsFilename);
}
try {
+ for (final Pckg pckg : roots) {
+ writeAllTests(out, pckg);
+ }
// TODO:2009-08-16:christianhujer:Create list of test / suite ids.
//for (final Integer id : new TreeSet<Integer>(allTests.keySet())) {
// out.format("%d: %s%n", id, allTests.get(id));
@@ -266,6 +273,20 @@
}
}
+ /** Writes all tests of <var>test</var> including <var>test</var> itself to <var>out</var>.
+ * @param out PrintWriter to append to.
+ * @param test Package to append.
+ * @throws IOException in case of I/O problems.
+ */
+ private void writeAllTests(@NotNull final PrintWriter out, @NotNull final Test test) throws IOException {
+ out.format("%d: %s%n", test.getId(), test.getName());
+ if (test instanceof Suite) {
+ for (final Test subtest : ((Suite<Test>) test)) {
+ writeAllTests(out, subtest);
+ }
+ }
+ }
+
/** {@inheritDoc} */
public int run(@NotNull final List<String> args) throws Exception {
if (args.isEmpty()) {
Modified: trunk/src/java/src/prj/net/sf/aceunit/Pckg.java
===================================================================
--- trunk/src/java/src/prj/net/sf/aceunit/Pckg.java 2009-08-19 22:00:07 UTC (rev 527)
+++ trunk/src/java/src/prj/net/sf/aceunit/Pckg.java 2009-08-19 22:10:58 UTC (rev 528)
@@ -40,8 +40,10 @@
/**
* Creates a Pckg with the specified id.
+ * @param name Name of this Pckg.
*/
- public Pckg() {
+ public Pckg(@NotNull final String name) {
+ super(name);
}
/** {@inheritDoc} */
Modified: trunk/src/java/src/prj/net/sf/aceunit/Suite.java
===================================================================
--- trunk/src/java/src/prj/net/sf/aceunit/Suite.java 2009-08-19 22:00:07 UTC (rev 527)
+++ trunk/src/java/src/prj/net/sf/aceunit/Suite.java 2009-08-19 22:10:58 UTC (rev 528)
@@ -47,8 +47,10 @@
/**
* Creates a Suite.
+ * @param name Name of this Suite.
*/
- protected Suite() {
+ protected Suite(@NotNull final String name) {
+ super(name);
}
/**
Modified: trunk/src/java/src/prj/net/sf/aceunit/Test.java
===================================================================
--- trunk/src/java/src/prj/net/sf/aceunit/Test.java 2009-08-19 22:00:07 UTC (rev 527)
+++ trunk/src/java/src/prj/net/sf/aceunit/Test.java 2009-08-19 22:10:58 UTC (rev 528)
@@ -33,15 +33,27 @@
*/
public abstract class Test {
+ /** The name of this Test. */
+ private final String name;
+
/** The id of this Test. */
private int id;
/**
* Creates a Test.
+ * @param name The name of this test.
*/
- protected Test() {
+ protected Test(@NotNull final String name) {
+ this.name = name;
}
+ /** Returns the name of this test.
+ * @return The name of this test.
+ */
+ public String getName() {
+ return name;
+ }
+
/**
* Returns the id of this Test.
*
@@ -69,4 +81,5 @@
}
id = generator.getNextId();
}
+
}
Modified: trunk/src/java/src/prj/net/sf/aceunit/TestCase.java
===================================================================
--- trunk/src/java/src/prj/net/sf/aceunit/TestCase.java 2009-08-19 22:00:07 UTC (rev 527)
+++ trunk/src/java/src/prj/net/sf/aceunit/TestCase.java 2009-08-19 22:10:58 UTC (rev 528)
@@ -33,24 +33,13 @@
*/
public class TestCase extends Test {
- /** The name of this TestCase. */
- @NotNull private final String name;
-
/**
* Creates a TestCase.
*
* @param name Name for this TestCase.
*/
protected TestCase(@NotNull final String name) {
- this.name = name;
+ super(name);
}
- /** Returns the name of this TestCase.
- * @return The name of this TestCase.
- */
- @NotNull
- public String getName() {
- return name;
- }
-
}
Modified: trunk/src/java/src/tst/test/net/sf/aceunit/PckgTest.java
===================================================================
--- trunk/src/java/src/tst/test/net/sf/aceunit/PckgTest.java 2009-08-19 22:00:07 UTC (rev 527)
+++ trunk/src/java/src/tst/test/net/sf/aceunit/PckgTest.java 2009-08-19 22:10:58 UTC (rev 528)
@@ -32,6 +32,7 @@
import net.sf.aceunit.Fixture;
import org.junit.Test;
import org.junit.Assert;
+import org.jetbrains.annotations.NotNull;
/** Unit Test for {@link Pckg}.
* @author <a href="mailto:ch...@ri...">Christian Hujer</a>
@@ -39,16 +40,16 @@
public class PckgTest extends SuiteTest {
/** {@inheritDoc} */
- public Suite createSuite() {
- return new Pckg();
+ public Suite createSuite(@NotNull final String name) {
+ return new Pckg(name);
}
/** Tests that {@link Pckg#addSuite(Suite)} works. */
@Test
public void testAdd() {
- final Pckg testling = new Pckg();
+ final Pckg testling = new Pckg("dummy");
Assert.assertFalse("After creation, a package is empty.", testling.containsTests());
- final Pckg pckg = new Pckg();
+ final Pckg pckg = new Pckg("dummy");
testling.addSuite(pckg);
Assert.assertFalse("After adding an empty package, a package is still empty.", testling.containsTests());
final Fixture emptyFixture = new Fixture(null, "");
Modified: trunk/src/java/src/tst/test/net/sf/aceunit/SuiteTest.java
===================================================================
--- trunk/src/java/src/tst/test/net/sf/aceunit/SuiteTest.java 2009-08-19 22:00:07 UTC (rev 527)
+++ trunk/src/java/src/tst/test/net/sf/aceunit/SuiteTest.java 2009-08-19 22:10:58 UTC (rev 528)
@@ -38,10 +38,11 @@
public class SuiteTest {
/** Creates a Suite with the specified id.
+ * @param name Name for the suite.
* @return Suite with the specified id.
*/
- public Suite createSuite() {
- return new Suite() {
+ public Suite createSuite(@NotNull final String name) {
+ return new Suite(name) {
/** {@inheritDoc} */
public boolean containsTests() {
return false;
@@ -59,7 +60,7 @@
*/
@Test(expected = IllegalStateException.class)
public void testId() {
- createSuite().getId();
+ createSuite("dummy").getId();
}
} // class SuiteTest
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2009-08-19 22:00:17
|
Revision: 527
http://aceunit.svn.sourceforge.net/aceunit/?rev=527&view=rev
Author: christianhujer
Date: 2009-08-19 22:00:07 +0000 (Wed, 19 Aug 2009)
Log Message:
-----------
Fixed bug in the documentation.
Modified Paths:
--------------
trunk/src/java/src/prj/net/sf/aceunit/Test.java
Modified: trunk/src/java/src/prj/net/sf/aceunit/Test.java
===================================================================
--- trunk/src/java/src/prj/net/sf/aceunit/Test.java 2009-08-19 21:57:23 UTC (rev 526)
+++ trunk/src/java/src/prj/net/sf/aceunit/Test.java 2009-08-19 22:00:07 UTC (rev 527)
@@ -33,7 +33,7 @@
*/
public abstract class Test {
- /** The id of this Suite. */
+ /** The id of this Test. */
private int id;
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2009-08-19 21:57:45
|
Revision: 526
http://aceunit.svn.sourceforge.net/aceunit/?rev=526&view=rev
Author: christianhujer
Date: 2009-08-19 21:57:23 +0000 (Wed, 19 Aug 2009)
Log Message:
-----------
Make Suite Iterable.
Modified Paths:
--------------
trunk/src/java/src/prj/net/sf/aceunit/Suite.java
Modified: trunk/src/java/src/prj/net/sf/aceunit/Suite.java
===================================================================
--- trunk/src/java/src/prj/net/sf/aceunit/Suite.java 2009-08-19 21:42:27 UTC (rev 525)
+++ trunk/src/java/src/prj/net/sf/aceunit/Suite.java 2009-08-19 21:57:23 UTC (rev 526)
@@ -31,6 +31,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Collections;
+import java.util.Iterator;
/**
* A Suite is a collection of Test Cases.
@@ -39,7 +40,7 @@
*
* @author <a href="mailto:ch...@ri...">Christian Hujer</a>
*/
-public abstract class Suite<T extends Test> extends Test {
+public abstract class Suite<T extends Test> extends Test implements Iterable<T> {
/** The Tests contained in this Suite. */
private final List<T> tests = new ArrayList<T>();
@@ -105,4 +106,8 @@
tests.add(test);
}
+ /** {@inheritDoc} */
+ public Iterator<T> iterator() {
+ return tests.iterator();
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2009-08-19 21:42:38
|
Revision: 525
http://aceunit.svn.sourceforge.net/aceunit/?rev=525&view=rev
Author: christianhujer
Date: 2009-08-19 21:42:27 +0000 (Wed, 19 Aug 2009)
Log Message:
-----------
Removed TODOs which are already done.
Modified Paths:
--------------
trunk/TODO
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2009-08-18 14:22:03 UTC (rev 524)
+++ trunk/TODO 2009-08-19 21:42:27 UTC (rev 525)
@@ -3,14 +3,11 @@
* Make better distinction between public API and internal symbols even in header files
* Alternatively allow for naming schemes instead of annotations so users can go without the A_Test annotations.
-* Test AceUnit with AceUnit
-* Test GenTest with JUnit
* Turn runFixture in a non-void function that returns whether one or more test cases failed.
* Add randomization of test order.
* Add JUnit-compatible loggers.
* 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.
@@ -18,6 +15,5 @@
* 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.
+* Add a library for C to access the mapping table.
+* Add a library for Java to access the mapping table.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2009-08-18 14:22:09
|
Revision: 524
http://aceunit.svn.sourceforge.net/aceunit/?rev=524&view=rev
Author: christianhujer
Date: 2009-08-18 14:22:03 +0000 (Tue, 18 Aug 2009)
Log Message:
-----------
Doxygen: Change predefined DOXYGEN to _doxygen.
Modified Paths:
--------------
trunk/src/native/AceUnit.h
trunk/src/native/Doxyfile
Modified: trunk/src/native/AceUnit.h
===================================================================
--- trunk/src/native/AceUnit.h 2009-08-16 21:46:24 UTC (rev 523)
+++ trunk/src/native/AceUnit.h 2009-08-18 14:22:03 UTC (rev 524)
@@ -609,7 +609,7 @@
* @param group Group to run.
* This parameter is only available if #ACEUNIT_GROUP is defined.
*/
-#if defined(ACEUNIT_GROUP) || defined(DOXYGEN)
+#if defined(ACEUNIT_GROUP) || defined(_doxygen)
extern void runFixture(const TestFixture_t *const fixture, AceGroupId_t group);
#else
extern void runFixture(const TestFixture_t *const fixture);
@@ -620,7 +620,7 @@
* @param group Group to run.
* This parameter is only available if #ACEUNIT_GROUP is defined.
*/
-#if defined(ACEUNIT_GROUP) || defined(DOXYGEN)
+#if defined(ACEUNIT_GROUP) || defined(_doxygen)
extern void runSuite(const TestSuite_t *const suite, AceGroupId_t group);
#else
extern void runSuite(const TestSuite_t *const suite);
Modified: trunk/src/native/Doxyfile
===================================================================
--- trunk/src/native/Doxyfile 2009-08-16 21:46:24 UTC (rev 523)
+++ trunk/src/native/Doxyfile 2009-08-18 14:22:03 UTC (rev 524)
@@ -1115,7 +1115,7 @@
# undefined via #undef or recursively expanded use the := operator
# instead of the = operator.
-PREDEFINED = DOXYGEN
+PREDEFINED = _doxygen
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2009-08-16 21:46:32
|
Revision: 523
http://aceunit.svn.sourceforge.net/aceunit/?rev=523&view=rev
Author: christianhujer
Date: 2009-08-16 21:46:24 +0000 (Sun, 16 Aug 2009)
Log Message:
-----------
Add doc target. Fix javadoc issues.
Modified Paths:
--------------
trunk/src/java/build.xml
trunk/src/java/src/prj/net/sf/aceunit/Fixture.java
trunk/src/java/src/prj/net/sf/aceunit/package-info.java
Added Paths:
-----------
trunk/src/java/lib/japi-lib-taglets-trunk-1374M.jar
Modified: trunk/src/java/build.xml
===================================================================
--- trunk/src/java/build.xml 2009-08-16 21:35:33 UTC (rev 522)
+++ trunk/src/java/build.xml 2009-08-16 21:46:24 UTC (rev 523)
@@ -134,4 +134,44 @@
<report format="frames" todir="docs/test" />
</junitreport>
</target>
+
+ <target
+ name="doc"
+ description="Generates javadoc documentation."
+ depends="compile"
+ >
+ <mkdir dir="docs/api" />
+ <javadoc
+ access = "private"
+ author = "yes"
+ version = "yes"
+ destdir = "docs/api"
+ serialwarn = "yes"
+ charset = "utf-8"
+ docencoding = "utf-8"
+ encoding = "utf-8"
+ source = "1.5"
+ linksource = "yes"
+ >
+ <classpath>
+ <pathelement location="lib/annotations.jar" />
+ <pathelement location="lib/japi-lib-argparser-0.3.0.jar" />
+ </classpath>
+ <packageset
+ dir="src/prj"
+ defaultexcludes="yes"
+ />
+ <taglet name="net.sf.japi.taglets.FixmeTaglet" path="lib/japi-lib-taglets-trunk-1374M.jar" />
+ <taglet name="net.sf.japi.taglets.HistoryTaglet" path="lib/japi-lib-taglets-trunk-1374M.jar" />
+ <taglet name="net.sf.japi.taglets.InvariantTaglet" path="lib/japi-lib-taglets-trunk-1374M.jar" />
+ <taglet name="net.sf.japi.taglets.NoteTaglet" path="lib/japi-lib-taglets-trunk-1374M.jar" />
+ <taglet name="net.sf.japi.taglets.PostconditionTaglet" path="lib/japi-lib-taglets-trunk-1374M.jar" />
+ <taglet name="net.sf.japi.taglets.PreconditionTaglet" path="lib/japi-lib-taglets-trunk-1374M.jar" />
+ <taglet name="net.sf.japi.taglets.ReturnValueTaglet" path="lib/japi-lib-taglets-trunk-1374M.jar" />
+ <taglet name="net.sf.japi.taglets.TodoTaglet" path="lib/japi-lib-taglets-trunk-1374M.jar" />
+ <taglet name="net.sf.japi.taglets.WarningTaglet" path="lib/japi-lib-taglets-trunk-1374M.jar" />
+ <taglet name="net.sf.japi.taglets.XxxTaglet" path="lib/japi-lib-taglets-trunk-1374M.jar" />
+ </javadoc>
+ </target>
+
</project>
Added: trunk/src/java/lib/japi-lib-taglets-trunk-1374M.jar
===================================================================
(Binary files differ)
Property changes on: trunk/src/java/lib/japi-lib-taglets-trunk-1374M.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/src/java/src/prj/net/sf/aceunit/Fixture.java
===================================================================
--- trunk/src/java/src/prj/net/sf/aceunit/Fixture.java 2009-08-16 21:35:33 UTC (rev 522)
+++ trunk/src/java/src/prj/net/sf/aceunit/Fixture.java 2009-08-16 21:46:24 UTC (rev 523)
@@ -237,7 +237,7 @@
return out.toString();
}
- /** @{inheritDoc} */
+ /** {@inheritDoc} */
@Override public String getGlobalVariablename() {
return fixtureName + "Fixture";
}
Modified: trunk/src/java/src/prj/net/sf/aceunit/package-info.java
===================================================================
--- trunk/src/java/src/prj/net/sf/aceunit/package-info.java 2009-08-16 21:35:33 UTC (rev 522)
+++ trunk/src/java/src/prj/net/sf/aceunit/package-info.java 2009-08-16 21:46:24 UTC (rev 523)
@@ -27,7 +27,7 @@
/** This is the Java Generator of AceUnit.
* The Java Generator scans suites (c sources with fixtures and directories containing them) and generates the required header files.
- * For more information, see {@link GenTest}.
+ * For more information, see {@link net.sf.aceunit.GenTest}.
* @author <a href="mailto:ch...@ri...">Christian Hujer</a>
*/
package net.sf.aceunit;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2009-08-16 21:35:47
|
Revision: 522
http://aceunit.svn.sourceforge.net/aceunit/?rev=522&view=rev
Author: christianhujer
Date: 2009-08-16 21:35:33 +0000 (Sun, 16 Aug 2009)
Log Message:
-----------
Fix javadoc error.
Modified Paths:
--------------
trunk/src/java/src/prj/net/sf/aceunit/Fixture.java
Modified: trunk/src/java/src/prj/net/sf/aceunit/Fixture.java
===================================================================
--- trunk/src/java/src/prj/net/sf/aceunit/Fixture.java 2009-08-16 18:14:59 UTC (rev 521)
+++ trunk/src/java/src/prj/net/sf/aceunit/Fixture.java 2009-08-16 21:35:33 UTC (rev 522)
@@ -237,7 +237,7 @@
return out.toString();
}
- /** @inheritDoc} */
+ /** @{inheritDoc} */
@Override public String getGlobalVariablename() {
return fixtureName + "Fixture";
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2009-08-16 18:15:06
|
Revision: 521
http://aceunit.svn.sourceforge.net/aceunit/?rev=521&view=rev
Author: christianhujer
Date: 2009-08-16 18:14:59 +0000 (Sun, 16 Aug 2009)
Log Message:
-----------
Generate ids only for the first package or those suites which contained test cases.
This keeps the id space used smaller.
So an 8 or 16 bit test id value lasts longer (no more gaps).
Modified Paths:
--------------
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/Pckg.java
trunk/src/java/src/prj/net/sf/aceunit/Suite.java
trunk/src/java/src/prj/net/sf/aceunit/Test.java
trunk/src/java/src/prj/net/sf/aceunit/TestCase.java
trunk/src/java/src/tst/test/net/sf/aceunit/FixtureTest.java
trunk/src/java/src/tst/test/net/sf/aceunit/IdGeneratorTest.java
trunk/src/java/src/tst/test/net/sf/aceunit/PckgTest.java
trunk/src/java/src/tst/test/net/sf/aceunit/SuiteTest.java
Modified: trunk/src/java/src/prj/net/sf/aceunit/Fixture.java
===================================================================
--- trunk/src/java/src/prj/net/sf/aceunit/Fixture.java 2009-08-16 18:07:10 UTC (rev 520)
+++ trunk/src/java/src/prj/net/sf/aceunit/Fixture.java 2009-08-16 18:14:59 UTC (rev 521)
@@ -79,12 +79,10 @@
/**
* 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.
*/
- public Fixture(final int id, @NotNull final File file) throws IOException {
- super(id);
+ public Fixture(@NotNull final File file) throws IOException {
findMethods(SourceFiles.readSourceWithoutComments(file));
this.fixtureName = file.getName().replaceAll("\\.c(pp)?$", "");
}
@@ -92,12 +90,10 @@
/**
* Creates a Fixture with the specified id.
*
- * @param id The id of this Fixture.
* @param file File to create fixture for.
* @param source The source of this Fixture.
*/
- public Fixture(final int id, @Nullable final File file, @Nullable final String source) {
- super(id);
+ public Fixture(@Nullable final File file, @Nullable final String source) {
if (source != null) {
findMethods(source);
}
@@ -247,11 +243,10 @@
}
/** Creates a TestCase for each contained test method.
- * @param idGenerator IdGenerator for generating unique ids for the test cases.
*/
- public void createTestCases(@NotNull final IdGenerator idGenerator) {
+ public void createTestCases() {
for (final String method : testMethods) {
- add(new TestCase(idGenerator.getNextId(), method));
+ add(new TestCase(method));
}
}
Modified: trunk/src/java/src/prj/net/sf/aceunit/GenTest.java
===================================================================
--- trunk/src/java/src/prj/net/sf/aceunit/GenTest.java 2009-08-16 18:07:10 UTC (rev 520)
+++ trunk/src/java/src/prj/net/sf/aceunit/GenTest.java 2009-08-16 18:14:59 UTC (rev 521)
@@ -72,8 +72,8 @@
@NotNull
private final IdGenerator idGenerator = new IdGenerator();
- /** The table of all tests. */
- private final Map<Integer, String> allTests = new HashMap<Integer, String>();
+ /** The flattened list of all tests. */
+ private final List<String> allTests = new ArrayList<String>();
/**
* Creates a GenTest instance.
@@ -140,7 +140,7 @@
for (final File fixtureFile : fixtureFiles) {
if (fixtureFile.isFile()) {
baseFound = true;
- final boolean testsFoundInFile = performFixture(fixtureFile.getParentFile(), new Pckg(0), fixtureFile);
+ final boolean testsFoundInFile = performFixture(fixtureFile.getParentFile(), new Pckg(), fixtureFile);
testsFound |= testsFoundInFile;
if (!testsFoundInFile) {
System.err.println(fixtureFile + ": warning: No test cases found. Maybe the annotations are missing?");
@@ -171,7 +171,14 @@
private boolean performPckg(@NotNull final File base, @Nullable final Pckg parent, @NotNull final File pckgDir) throws IOException {
assert pckgDir.isDirectory();
boolean containedFixture = false;
- final Pckg pckg = new Pckg(idGenerator.getNextId());
+ final Pckg pckg = new Pckg();
+ // XXX:2009-08-16:christianhujer:Hack to keep the first suite id "1".
+ // The correct solution would be to separate scan and output.
+ // However, that solution might require more memory.
+ // So before that solution is implemented, a footprint analysis is required.
+ if (parent == null) {
+ pckg.setId(idGenerator);
+ }
for (final File dir : pckgDir.listFiles(SourceFiles.DIR_FILTER)) {
containedFixture |= performPckg(base, pckg, dir);
}
@@ -182,13 +189,17 @@
containedFixture |= performFixture(base, pckg, fixtureFile);
}
if (containedFixture) {
+ // XXX:2009-08-16:christianhujer:The id is already set above if there is no parent.
+ if (parent != null) {
+ pckg.setId(idGenerator);
+ }
final File cFile = new File(pckgDir, "Suite" + pckg.getId() + ".c");
if (printSet.contains(Print.sources) || printSet.contains(Print.suites) || printSet.contains(Print.generated)) {
System.out.println(cFile);
}
final String hSource = pckg.getCode("foo");
SourceFiles.writeIfChanged(cFile, hSource, force);
- allTests.put(pckg.getId(), pckgDir.toString().replaceAll("^\\./", "").replaceAll("[\\/]", "."));
+ allTests.add(pckgDir.toString().replaceAll("^\\./", "").replaceAll("[\\/]", "."));
}
if (containedFixture && parent != null) {
parent.addSuite(pckg);
@@ -210,14 +221,12 @@
return false;
}
final String fixtureName = fixtureFile.getName().replaceAll("\\.c(pp)?$", "");
- final Fixture fixture = new Fixture(idGenerator.getNextId(), fixtureFile);
+ final Fixture fixture = new Fixture(fixtureFile);
final boolean containedFixture = fixture.containsTests();
if (containedFixture) {
- fixture.createTestCases(idGenerator);
+ fixture.createTestCases();
for (final TestCase testCase : fixture.getTests()) {
- final Integer id = testCase.getId();
- assert !allTests.containsKey(id) : "IDs must be unique, especially within allTests.";
- allTests.put(testCase.getId(), testCase.getName());
+ allTests.add(testCase.getName());
}
final File hFile = new File(fixtureFile.getParent(), fixtureName + ".h");
if (printSet.contains(Print.sources) || printSet.contains(Print.fixtures)) {
@@ -226,10 +235,11 @@
if (printSet.contains(Print.headers) || printSet.contains(Print.generated)) {
System.out.println(hFile);
}
+ fixture.setId(idGenerator);
final String hSource = fixture.getCode(fixtureName);
SourceFiles.writeIfChanged(hFile, hSource, force);
pckg.addSuite(fixture);
- allTests.put(fixture.getId(), fixtureName.replaceAll("[\\/]", "."));
+ allTests.add(fixtureName.replaceAll("[\\/]", "."));
}
return containedFixture;
}
@@ -247,9 +257,10 @@
System.out.println(allTestsFilename);
}
try {
- for (final Integer id : new TreeSet<Integer>(allTests.keySet())) {
- out.format("%d: %s%n", id, allTests.get(id));
- }
+ // TODO:2009-08-16:christianhujer:Create list of test / suite ids.
+ //for (final Integer id : new TreeSet<Integer>(allTests.keySet())) {
+ // out.format("%d: %s%n", id, allTests.get(id));
+ //}
} finally {
out.close();
}
@@ -257,7 +268,7 @@
/** {@inheritDoc} */
public int run(@NotNull final List<String> args) throws Exception {
- if (args.size() == 0) {
+ if (args.isEmpty()) {
help();
return 1;
}
Modified: trunk/src/java/src/prj/net/sf/aceunit/Pckg.java
===================================================================
--- trunk/src/java/src/prj/net/sf/aceunit/Pckg.java 2009-08-16 18:07:10 UTC (rev 520)
+++ trunk/src/java/src/prj/net/sf/aceunit/Pckg.java 2009-08-16 18:14:59 UTC (rev 521)
@@ -40,11 +40,8 @@
/**
* Creates a Pckg with the specified id.
- *
- * @param id The id for this Pckg.
*/
- public Pckg(final int id) {
- super(id);
+ public Pckg() {
}
/** {@inheritDoc} */
Modified: trunk/src/java/src/prj/net/sf/aceunit/Suite.java
===================================================================
--- trunk/src/java/src/prj/net/sf/aceunit/Suite.java 2009-08-16 18:07:10 UTC (rev 520)
+++ trunk/src/java/src/prj/net/sf/aceunit/Suite.java 2009-08-16 18:14:59 UTC (rev 521)
@@ -46,11 +46,8 @@
/**
* Creates a Suite.
- *
- * @param id Id for this Suite.
*/
- protected Suite(final int id) {
- super(id);
+ protected Suite() {
}
/**
@@ -68,6 +65,21 @@
*/
public abstract boolean containsTests();
+ /** {@inheritDoc} */
+ @Override
+ public void setId(@NotNull final IdGenerator generator) throws IllegalStateException {
+ super.setId(generator);
+ // XXX:2009-08-16:christianhujer:For packages the id is set other than for fixtures.
+ // Of course it would be nicer to have it clean, and that's the plan.
+ // See the XXX comments in GenTest.java for more information.
+ // Until then, the ugly instanceof is kept - the smell shouldn't be covered by a OO parfume.
+ if (this instanceof Fixture) {
+ for (final T test : tests) {
+ test.setId(generator);
+ }
+ }
+ }
+
/**
* Returns a String repsuites.size() > 0;C-Source code for this Suite.
*
Modified: trunk/src/java/src/prj/net/sf/aceunit/Test.java
===================================================================
--- trunk/src/java/src/prj/net/sf/aceunit/Test.java 2009-08-16 18:07:10 UTC (rev 520)
+++ trunk/src/java/src/prj/net/sf/aceunit/Test.java 2009-08-16 18:14:59 UTC (rev 521)
@@ -26,30 +26,47 @@
*/
package net.sf.aceunit;
+import org.jetbrains.annotations.NotNull;
+
/** A test, which can be anything that actually is a Test.
* @author <a href="mailto:ch...@ri...">Christian Hujer</a>
*/
public abstract class Test {
/** The id of this Suite. */
- private final int id;
+ private int id;
/**
* Creates a Test.
- *
- * @param id Id for this Test.
*/
- protected Test(final int id) {
- this.id = id;
+ protected Test() {
}
/**
* Returns the id of this Test.
*
* @return The id of this Test.
+ *
+ * @throws IllegalStateException in case the id is not yet set.
*/
- public int getId() {
+ public int getId() throws IllegalStateException {
+ if (id == 0) {
+ throw new IllegalStateException("Id not yet set.");
+ }
return id;
}
+ /**
+ * Sets the id of this test.
+ *
+ * @param generator IdGenerator from which the id to set is retrieved.
+ *
+ * @throws IllegalStateException in case the id is already set.
+ */
+ public void setId(@NotNull final IdGenerator generator) throws IllegalStateException {
+ if (id != 0) {
+ throw new IllegalStateException("Id already set.");
+ }
+ id = generator.getNextId();
+ }
}
Modified: trunk/src/java/src/prj/net/sf/aceunit/TestCase.java
===================================================================
--- trunk/src/java/src/prj/net/sf/aceunit/TestCase.java 2009-08-16 18:07:10 UTC (rev 520)
+++ trunk/src/java/src/prj/net/sf/aceunit/TestCase.java 2009-08-16 18:14:59 UTC (rev 521)
@@ -39,11 +39,9 @@
/**
* Creates a TestCase.
*
- * @param id Id for this TestCase.
* @param name Name for this TestCase.
*/
- protected TestCase(final int id, @NotNull final String name) {
- super(id);
+ protected TestCase(@NotNull final String name) {
this.name = name;
}
Modified: trunk/src/java/src/tst/test/net/sf/aceunit/FixtureTest.java
===================================================================
--- trunk/src/java/src/tst/test/net/sf/aceunit/FixtureTest.java 2009-08-16 18:07:10 UTC (rev 520)
+++ trunk/src/java/src/tst/test/net/sf/aceunit/FixtureTest.java 2009-08-16 18:14:59 UTC (rev 521)
@@ -36,8 +36,8 @@
public class FixtureTest extends SuiteTest {
/** {@inheritDoc} */
- public Fixture createSuite(final int id) {
- return new Fixture(id, null, null);
+ public Fixture createSuite() {
+ return new Fixture(null, null);
}
/** Dummy Test to workaround a bug in IntelliJ IDEA. */
Modified: trunk/src/java/src/tst/test/net/sf/aceunit/IdGeneratorTest.java
===================================================================
--- trunk/src/java/src/tst/test/net/sf/aceunit/IdGeneratorTest.java 2009-08-16 18:07:10 UTC (rev 520)
+++ trunk/src/java/src/tst/test/net/sf/aceunit/IdGeneratorTest.java 2009-08-16 18:14:59 UTC (rev 521)
@@ -21,7 +21,7 @@
}
Arrays.sort(testArray);
for (int i = 1; i < testArray.length; i++) {
- Assert.assertFalse("IdGenerator MUST return distinct ids.", testArray[i - 1] == testArray[i]);
+ Assert.assertNotSame("IdGenerator MUST return distinct ids.", testArray[i - 1], testArray[i]);
}
}
Modified: trunk/src/java/src/tst/test/net/sf/aceunit/PckgTest.java
===================================================================
--- trunk/src/java/src/tst/test/net/sf/aceunit/PckgTest.java 2009-08-16 18:07:10 UTC (rev 520)
+++ trunk/src/java/src/tst/test/net/sf/aceunit/PckgTest.java 2009-08-16 18:14:59 UTC (rev 521)
@@ -39,22 +39,22 @@
public class PckgTest extends SuiteTest {
/** {@inheritDoc} */
- public Suite createSuite(final int id) {
- return new Pckg(id);
+ public Suite createSuite() {
+ return new Pckg();
}
/** Tests that {@link Pckg#addSuite(Suite)} works. */
@Test
public void testAdd() {
- final Pckg testling = new Pckg(1);
+ final Pckg testling = new Pckg();
Assert.assertFalse("After creation, a package is empty.", testling.containsTests());
- final Pckg pckg = new Pckg(2);
+ final Pckg pckg = new Pckg();
testling.addSuite(pckg);
Assert.assertFalse("After adding an empty package, a package is still empty.", testling.containsTests());
- final Fixture emptyFixture = new Fixture(3, null, "");
+ final Fixture emptyFixture = new Fixture(null, "");
pckg.addSuite(emptyFixture);
Assert.assertFalse("After adding a fixture with no test cases, a package is still empty.", testling.containsTests());
- final Fixture fixture = new Fixture(3, null, "A_Test void aTest() {\n}\n");
+ final Fixture fixture = new Fixture(null, "A_Test void aTest() {\n}\n");
pckg.addSuite(fixture);
Assert.assertTrue("After adding a fixture with test cases, a package is no longer empty.", testling.containsTests());
}
Modified: trunk/src/java/src/tst/test/net/sf/aceunit/SuiteTest.java
===================================================================
--- trunk/src/java/src/tst/test/net/sf/aceunit/SuiteTest.java 2009-08-16 18:07:10 UTC (rev 520)
+++ trunk/src/java/src/tst/test/net/sf/aceunit/SuiteTest.java 2009-08-16 18:14:59 UTC (rev 521)
@@ -38,11 +38,10 @@
public class SuiteTest {
/** Creates a Suite with the specified id.
- * @param id Id to use for the Suite.
* @return Suite with the specified id.
*/
- public Suite createSuite(final int id) {
- return new Suite(10) {
+ public Suite createSuite() {
+ return new Suite() {
/** {@inheritDoc} */
public boolean containsTests() {
return false;
@@ -55,11 +54,12 @@
};
}
- /** Tests that ids are stored properly. */
- @Test
+ /** Tests that an IllegalStateException is thrown if the id is not yet set.
+ * @throws IllegalStateException (expected).
+ */
+ @Test(expected = IllegalStateException.class)
public void testId() {
- final Suite suite = createSuite(10);
- Assert.assertEquals("Id must be stored properly.", 10, suite.getId());
+ createSuite().getId();
}
} // class SuiteTest
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2009-08-16 18:07:18
|
Revision: 520
http://aceunit.svn.sourceforge.net/aceunit/?rev=520&view=rev
Author: christianhujer
Date: 2009-08-16 18:07:10 +0000 (Sun, 16 Aug 2009)
Log Message:
-----------
Update AceUnit.jar invocation to exit with a non-zero return code in case of errors.
Modified Paths:
--------------
trunk/src/native/test/common.mak
Modified: trunk/src/native/test/common.mak
===================================================================
--- trunk/src/native/test/common.mak 2009-08-16 17:53:24 UTC (rev 519)
+++ trunk/src/native/test/common.mak 2009-08-16 18:07:10 UTC (rev 520)
@@ -9,7 +9,7 @@
VPATH=$(ACEUNIT_NATIVE_PATH)
-GENERATED:=$(shell java -ea -jar $(ACEUNIT_JAVA_PATH)/AceUnit.jar --print=generated -o alltests.txt .)
+GENERATED:=$(shell java -ea -jar $(ACEUNIT_JAVA_PATH)/AceUnit.jar --exit true --print=generated -o alltests.txt .)
SUITES:=$(filter *.c,$(GENERATED))
CSOURCES:=$(sort $(shell find . -name "*.c")) $(SUITES)
CXXSOURCES:=$(sort $(shell find . -name "*.cpp"))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2009-08-16 17:53:35
|
Revision: 519
http://aceunit.svn.sourceforge.net/aceunit/?rev=519&view=rev
Author: christianhujer
Date: 2009-08-16 17:53:24 +0000 (Sun, 16 Aug 2009)
Log Message:
-----------
Update argparser version used by AceUnit.
Modified Paths:
--------------
trunk/src/java/AceUnit.iml
trunk/src/java/build.xml
Added Paths:
-----------
trunk/src/java/lib/japi-lib-argparser-0.3.0.jar
Removed Paths:
-------------
trunk/src/java/lib/japi-lib-argparser-trunk-627.jar
Modified: trunk/src/java/AceUnit.iml
===================================================================
--- trunk/src/java/AceUnit.iml 2009-08-16 17:52:31 UTC (rev 518)
+++ trunk/src/java/AceUnit.iml 2009-08-16 17:53:24 UTC (rev 519)
@@ -11,7 +11,7 @@
<orderEntry type="module-library">
<library name="japi-lib-argparser">
<CLASSES>
- <root url="jar://$MODULE_DIR$/lib/japi-lib-argparser-trunk-627.jar!/" />
+ <root url="jar://$MODULE_DIR$/lib/japi-lib-argparser-0.3.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
Modified: trunk/src/java/build.xml
===================================================================
--- trunk/src/java/build.xml 2009-08-16 17:52:31 UTC (rev 518)
+++ trunk/src/java/build.xml 2009-08-16 17:53:24 UTC (rev 519)
@@ -51,7 +51,7 @@
>
<classpath>
<pathelement location="lib/annotations.jar" />
- <pathelement location="lib/japi-lib-argparser-trunk-627.jar" />
+ <pathelement location="lib/japi-lib-argparser-0.3.0.jar" />
</classpath>
</javac>
<copy todir="classes/production">
@@ -75,7 +75,7 @@
</manifest>
<zipfileset dir="classes/production" />
<zipfileset src="lib/annotations.jar" />
- <zipfileset src="lib/japi-lib-argparser-trunk-627.jar" />
+ <zipfileset src="lib/japi-lib-argparser-0.3.0.jar" />
</jar>
</target>
@@ -97,7 +97,7 @@
<classpath>
<pathelement location="classes/production" />
<pathelement location="lib/annotations.jar" />
- <pathelement location="lib/japi-lib-argparser-trunk-627.jar" />
+ <pathelement location="lib/japi-lib-argparser-0.3.0.jar" />
<pathelement location="lib/junit-4.4.jar" />
</classpath>
</javac>
@@ -115,7 +115,7 @@
<pathelement location="classes/production" />
<pathelement location="classes/test" />
<pathelement location="lib/annotations.jar" />
- <pathelement location="lib/japi-lib-argparser-trunk-627.jar" />
+ <pathelement location="lib/japi-lib-argparser-0.3.0.jar" />
<pathelement location="lib/junit-4.4.jar" />
</classpath>
<formatter type="plain" />
Added: trunk/src/java/lib/japi-lib-argparser-0.3.0.jar
===================================================================
(Binary files differ)
Property changes on: trunk/src/java/lib/japi-lib-argparser-0.3.0.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: trunk/src/java/lib/japi-lib-argparser-trunk-627.jar
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2009-08-16 17:52:40
|
Revision: 518
http://aceunit.svn.sourceforge.net/aceunit/?rev=518&view=rev
Author: christianhujer
Date: 2009-08-16 17:52:31 +0000 (Sun, 16 Aug 2009)
Log Message:
-----------
Update IntelliJ IDEA project files.
Modified Paths:
--------------
trunk/src/java/AceUnit.iml
trunk/src/java/AceUnit.ipr
Modified: trunk/src/java/AceUnit.iml
===================================================================
--- trunk/src/java/AceUnit.iml 2009-08-16 16:34:25 UTC (rev 517)
+++ trunk/src/java/AceUnit.iml 2009-08-16 17:52:31 UTC (rev 518)
@@ -40,7 +40,7 @@
<Base>
<setting name="state" value="2" />
</Base>
- <LanguageOptions name="$TEMPLATE$">
+ <LanguageOptions name="HTML">
<option name="templateOptions">
<value>
<option name="block" value="true" />
@@ -50,18 +50,18 @@
<option name="lenBefore" value="80" />
<option name="lenAfter" value="80" />
<option name="box" value="false" />
- <option name="filler" value=" " />
+ <option name="filler" value="$TEMPLATE$" />
</value>
</option>
<option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
<option name="keyword" value="Copyright" />
- <option name="fileTypeOverride" value="4" />
+ <option name="fileTypeOverride" value="2" />
<option name="relativeBefore" value="true" />
<option name="addBlankAfter" value="true" />
<option name="fileLocation" value="1" />
<option name="useAlternate" value="false" />
</LanguageOptions>
- <LanguageOptions name="HTML">
+ <LanguageOptions name="JAVA">
<option name="templateOptions">
<value>
<option name="block" value="true" />
@@ -71,7 +71,7 @@
<option name="lenBefore" value="80" />
<option name="lenAfter" value="80" />
<option name="box" value="false" />
- <option name="filler" value=" " />
+ <option name="filler" value="$TEMPLATE$" />
</value>
</option>
<option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
@@ -82,7 +82,7 @@
<option name="fileLocation" value="1" />
<option name="useAlternate" value="false" />
</LanguageOptions>
- <LanguageOptions name="JAVA">
+ <LanguageOptions name="JSP">
<option name="templateOptions">
<value>
<option name="block" value="true" />
@@ -92,7 +92,7 @@
<option name="lenBefore" value="80" />
<option name="lenAfter" value="80" />
<option name="box" value="false" />
- <option name="filler" value=" " />
+ <option name="filler" value="$TEMPLATE$" />
</value>
</option>
<option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
@@ -103,7 +103,7 @@
<option name="fileLocation" value="1" />
<option name="useAlternate" value="false" />
</LanguageOptions>
- <LanguageOptions name="JSP">
+ <LanguageOptions name="JavaScript">
<option name="templateOptions">
<value>
<option name="block" value="true" />
@@ -113,7 +113,7 @@
<option name="lenBefore" value="80" />
<option name="lenAfter" value="80" />
<option name="box" value="false" />
- <option name="filler" value=" " />
+ <option name="filler" value="$TEMPLATE$" />
</value>
</option>
<option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
@@ -124,7 +124,7 @@
<option name="fileLocation" value="1" />
<option name="useAlternate" value="false" />
</LanguageOptions>
- <LanguageOptions name="JavaScript">
+ <LanguageOptions name="Properties">
<option name="templateOptions">
<value>
<option name="block" value="true" />
@@ -134,7 +134,7 @@
<option name="lenBefore" value="80" />
<option name="lenAfter" value="80" />
<option name="box" value="false" />
- <option name="filler" value=" " />
+ <option name="filler" value="$TEMPLATE$" />
</value>
</option>
<option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
@@ -145,7 +145,7 @@
<option name="fileLocation" value="1" />
<option name="useAlternate" value="false" />
</LanguageOptions>
- <LanguageOptions name="Properties">
+ <LanguageOptions name="XML">
<option name="templateOptions">
<value>
<option name="block" value="true" />
@@ -155,7 +155,7 @@
<option name="lenBefore" value="80" />
<option name="lenAfter" value="80" />
<option name="box" value="false" />
- <option name="filler" value=" " />
+ <option name="filler" value="$TEMPLATE$" />
</value>
</option>
<option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
@@ -166,7 +166,7 @@
<option name="fileLocation" value="1" />
<option name="useAlternate" value="false" />
</LanguageOptions>
- <LanguageOptions name="XML">
+ <LanguageOptions name="__TEMPLATE__">
<option name="templateOptions">
<value>
<option name="block" value="true" />
@@ -176,12 +176,12 @@
<option name="lenBefore" value="80" />
<option name="lenAfter" value="80" />
<option name="box" value="false" />
- <option name="filler" value=" " />
+ <option name="filler" value="$TEMPLATE$" />
</value>
</option>
<option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
<option name="keyword" value="Copyright" />
- <option name="fileTypeOverride" value="2" />
+ <option name="fileTypeOverride" value="4" />
<option name="relativeBefore" value="true" />
<option name="addBlankAfter" value="true" />
<option name="fileLocation" value="1" />
Modified: trunk/src/java/AceUnit.ipr
===================================================================
--- trunk/src/java/AceUnit.ipr 2009-08-16 16:34:25 UTC (rev 517)
+++ trunk/src/java/AceUnit.ipr 2009-08-16 17:52:31 UTC (rev 518)
@@ -245,6 +245,9 @@
<option name="projectName" value="AceUnit" />
</component>
<component name="ProjectFileVersion" converted="true" />
+ <component name="ProjectKey">
+ <option name="state" value="https://aceunit.svn.sourceforge.net/svnroot/aceunit/trunk/src/java/AceUnit.ipr" />
+ </component>
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/AceUnit.iml" filepath="$PROJECT_DIR$/AceUnit.iml" />
@@ -286,6 +289,7 @@
</component>
<component name="SvnBranchConfigurationManager">
<option name="myVersion" value="124" />
+ <option name="mySupportsUserInfoFilter" value="true" />
</component>
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="svn" />
@@ -312,5 +316,8 @@
<setting name="state" value="2" />
</Base>
</component>
+ <UsedPathMacros>
+ <macro name="TEMPLATE" description="" />
+ </UsedPathMacros>
</project>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2009-08-16 16:34:36
|
Revision: 517
http://aceunit.svn.sourceforge.net/aceunit/?rev=517&view=rev
Author: christianhujer
Date: 2009-08-16 16:34:25 +0000 (Sun, 16 Aug 2009)
Log Message:
-----------
Refactoring: pull up list of contained test cases / suites.
Preparation for an id scheme without gaps.
Modified Paths:
--------------
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/Pckg.java
trunk/src/java/src/prj/net/sf/aceunit/Suite.java
Modified: trunk/src/java/src/prj/net/sf/aceunit/Fixture.java
===================================================================
--- trunk/src/java/src/prj/net/sf/aceunit/Fixture.java 2009-08-16 15:19:56 UTC (rev 516)
+++ trunk/src/java/src/prj/net/sf/aceunit/Fixture.java 2009-08-16 16:34:25 UTC (rev 517)
@@ -41,13 +41,8 @@
*
* @author <a href="mailto:ch...@ri...">Christian Hujer</a>
*/
-public class Fixture extends Suite {
+public class Fixture extends Suite<TestCase> {
- /** The list of TestCases.
- * Initially empty, filled by {@link #createTestCases(IdGenerator)}.
- */
- private final List<TestCase> testCases = new ArrayList<TestCase>();
-
/** The list of {@code @Test} methods. */
private final MethodList testMethods = MethodList.createTestMethodList();
@@ -166,7 +161,7 @@
out.format("/** The test case ids of this fixture. */%n");
out.format("static const TestCaseId_t testIds[] = {%n");
final String formatString = String.format(" %%%dd, /* %%s */%%n", (int) (Math.log10(testMethods.size()) + 1));
- for (final TestCase testCase : testCases) {
+ for (final TestCase testCase : getTests()) {
out.format(formatString, testCase.getId(), testCase.getName());
}
out.format("};%n");
@@ -256,15 +251,8 @@
*/
public void createTestCases(@NotNull final IdGenerator idGenerator) {
for (final String method : testMethods) {
- testCases.add(new TestCase(idGenerator.getNextId(), method));
+ add(new TestCase(idGenerator.getNextId(), method));
}
}
- /** Returns an unmodifiable list of test cases.
- * @return An unmodifiable list of test cases.
- */
- public List<TestCase> getTestCases() {
- return Collections.unmodifiableList(testCases);
- }
-
} // class MethodLists
Modified: trunk/src/java/src/prj/net/sf/aceunit/GenTest.java
===================================================================
--- trunk/src/java/src/prj/net/sf/aceunit/GenTest.java 2009-08-16 15:19:56 UTC (rev 516)
+++ trunk/src/java/src/prj/net/sf/aceunit/GenTest.java 2009-08-16 16:34:25 UTC (rev 517)
@@ -214,7 +214,7 @@
final boolean containedFixture = fixture.containsTests();
if (containedFixture) {
fixture.createTestCases(idGenerator);
- for (final TestCase testCase : fixture.getTestCases()) {
+ for (final TestCase testCase : fixture.getTests()) {
final Integer id = testCase.getId();
assert !allTests.containsKey(id) : "IDs must be unique, especially within allTests.";
allTests.put(testCase.getId(), testCase.getName());
Modified: trunk/src/java/src/prj/net/sf/aceunit/Pckg.java
===================================================================
--- trunk/src/java/src/prj/net/sf/aceunit/Pckg.java 2009-08-16 15:19:56 UTC (rev 516)
+++ trunk/src/java/src/prj/net/sf/aceunit/Pckg.java 2009-08-16 16:34:25 UTC (rev 517)
@@ -30,20 +30,14 @@
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.
*
* @author <a href="mailto:ch...@ri...">Christian Hujer</a>
*/
-public class Pckg extends Suite {
+public class Pckg extends Suite<Suite> {
- /** The list of suites found. */
- @NotNull
- private final List<Suite> suites = new ArrayList<Suite>();
-
/**
* Creates a Pckg with the specified id.
*
@@ -56,7 +50,7 @@
/** {@inheritDoc} */
public boolean containsTests() {
boolean containsTests = false;
- for (final Suite suite : suites) {
+ for (final Suite suite : getTests()) {
containsTests = containsTests || suite.containsTests();
}
return containsTests;
@@ -68,7 +62,7 @@
* @param suite Suite to add
*/
public void addSuite(@NotNull final Suite suite) {
- suites.add(suite);
+ add(suite);
}
/** {@inheritDoc} */
@@ -85,12 +79,12 @@
out.format("%n");
out.format("#ifdef ACEUNIT_SUITES%n");
out.format("%n");
- for (final Suite suite : suites) {
+ for (final Suite suite : getTests()) {
out.format("extern TestSuite_t %s;%n", suite.getGlobalVariablename());
}
out.format("%n");
out.format("const TestSuite_t *suitesOf%d[] = {%n", getId());
- for (final Suite suite : suites) {
+ for (final Suite suite : getTests()) {
out.format(" &%s,%n", suite.getGlobalVariablename());
}
out.format(" NULL%n");
Modified: trunk/src/java/src/prj/net/sf/aceunit/Suite.java
===================================================================
--- trunk/src/java/src/prj/net/sf/aceunit/Suite.java 2009-08-16 15:19:56 UTC (rev 516)
+++ trunk/src/java/src/prj/net/sf/aceunit/Suite.java 2009-08-16 16:34:25 UTC (rev 517)
@@ -28,6 +28,9 @@
package net.sf.aceunit;
import org.jetbrains.annotations.NotNull;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Collections;
/**
* A Suite is a collection of Test Cases.
@@ -36,8 +39,11 @@
*
* @author <a href="mailto:ch...@ri...">Christian Hujer</a>
*/
-public abstract class Suite extends Test {
+public abstract class Suite<T extends Test> extends Test {
+ /** The Tests contained in this Suite. */
+ private final List<T> tests = new ArrayList<T>();
+
/**
* Creates a Suite.
*
@@ -71,4 +77,20 @@
@NotNull
public abstract String getCode(@NotNull final String basename);
-} // class Pckg
+ /**
+ * Returns an iteratable of contained tests.
+ * @return An iterable of contained tests.
+ */
+ public List<T> getTests() {
+ return Collections.unmodifiableList(tests);
+ }
+
+ /**
+ * Adds a Test to this Suite.
+ * @param test Test to add.
+ */
+ public void add(@NotNull final T test) {
+ tests.add(test);
+ }
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2009-08-16 15:20:05
|
Revision: 516
http://aceunit.svn.sourceforge.net/aceunit/?rev=516&view=rev
Author: christianhujer
Date: 2009-08-16 15:19:56 +0000 (Sun, 16 Aug 2009)
Log Message:
-----------
Remove redundant prototype from .c file.
Modified Paths:
--------------
trunk/src/native/AceUnitMain.c
Modified: trunk/src/native/AceUnitMain.c
===================================================================
--- trunk/src/native/AceUnitMain.c 2009-08-16 15:05:13 UTC (rev 515)
+++ trunk/src/native/AceUnitMain.c 2009-08-16 15:19:56 UTC (rev 516)
@@ -55,11 +55,6 @@
#define TEST_FAILURES_FOR_VERIFICATION 0
#endif
-/** Prototype for running a suite.
- * @param suite Suite to run.
- */
-extern void runSuite(const TestSuite_t *const suite);
-
/** This always is the first suite. */
extern TestSuite_t suite1;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2009-08-16 15:05:20
|
Revision: 515
http://aceunit.svn.sourceforge.net/aceunit/?rev=515&view=rev
Author: christianhujer
Date: 2009-08-16 15:05:13 +0000 (Sun, 16 Aug 2009)
Log Message:
-----------
Make IdGenerator synchronized, so it can be used in a multithreading environment.
Modified Paths:
--------------
trunk/src/java/src/prj/net/sf/aceunit/IdGenerator.java
Modified: trunk/src/java/src/prj/net/sf/aceunit/IdGenerator.java
===================================================================
--- trunk/src/java/src/prj/net/sf/aceunit/IdGenerator.java 2009-08-09 13:35:59 UTC (rev 514)
+++ trunk/src/java/src/prj/net/sf/aceunit/IdGenerator.java 2009-08-16 15:05:13 UTC (rev 515)
@@ -32,7 +32,7 @@
*
* @return The next id.
*/
- public int getNextId() {
+ public synchronized int getNextId() {
return ++lastId;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2009-08-09 13:36:13
|
Revision: 514
http://aceunit.svn.sourceforge.net/aceunit/?rev=514&view=rev
Author: christianhujer
Date: 2009-08-09 13:35:59 +0000 (Sun, 09 Aug 2009)
Log Message:
-----------
Add Check to glossary.
Modified Paths:
--------------
trunk/src/doc/glossary.xhtml
Modified: trunk/src/doc/glossary.xhtml
===================================================================
--- trunk/src/doc/glossary.xhtml 2009-06-06 11:42:20 UTC (rev 513)
+++ trunk/src/doc/glossary.xhtml 2009-08-09 13:35:59 UTC (rev 514)
@@ -33,6 +33,11 @@
<br />
URL: <a href="http://embunit.sourceforge.net/">http://embunit.sourceforge.net/</a>
</dd>
+ <dt>Check</dt>
+ <dd>
+ A framework for Unit Testing in C, based on the ideas of JUnit 3.x.
+ Well suited for POSIX environments (takes advantage of <code>fork()</code>).
+ </dd>
<dt>JUnit</dt>
<dd>
A framework for Unit Testing in Java.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2009-06-06 11:42:34
|
Revision: 513
http://aceunit.svn.sourceforge.net/aceunit/?rev=513&view=rev
Author: christianhujer
Date: 2009-06-06 11:42:20 +0000 (Sat, 06 Jun 2009)
Log Message:
-----------
Fix error in comment.
Modified Paths:
--------------
trunk/src/java/src/prj/net/sf/aceunit/Pckg.java
Modified: trunk/src/java/src/prj/net/sf/aceunit/Pckg.java
===================================================================
--- trunk/src/java/src/prj/net/sf/aceunit/Pckg.java 2009-02-17 10:09:33 UTC (rev 512)
+++ trunk/src/java/src/prj/net/sf/aceunit/Pckg.java 2009-06-06 11:42:20 UTC (rev 513)
@@ -75,7 +75,7 @@
@NotNull
public String getCode(@NotNull final String basename) {
final Formatter out = new Formatter();
- out.format("/** AceUnit test header file for suite %s.%n", basename);
+ out.format("/** AceUnit test header file for package %s.%n", basename);
out.format(" *%n");
out.format(" * @warning This is a generated file. Do not edit. Your changes will be lost.%n");
out.format(" * @file %s.h%n", basename);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2009-02-17 10:09:38
|
Revision: 512
http://aceunit.svn.sourceforge.net/aceunit/?rev=512&view=rev
Author: christianhujer
Date: 2009-02-17 10:09:33 +0000 (Tue, 17 Feb 2009)
Log Message:
-----------
Added copyright comment to release.sh.
Modified Paths:
--------------
release.sh
Modified: release.sh
===================================================================
--- release.sh 2009-01-31 13:04:07 UTC (rev 511)
+++ release.sh 2009-02-17 10:09:33 UTC (rev 512)
@@ -1,5 +1,31 @@
#!/bin/sh
+# Copyright (c) 2007 - 2009 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.
+
# TODO: Use freshmeat-submit
# TODO: Support release levels
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2009-01-31 13:04:09
|
Revision: 511
http://aceunit.svn.sourceforge.net/aceunit/?rev=511&view=rev
Author: christianhujer
Date: 2009-01-31 13:04:07 +0000 (Sat, 31 Jan 2009)
Log Message:
-----------
Include generated file with test list in file list if printSet includes Print.generated.
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 2009-01-31 13:03:31 UTC (rev 510)
+++ trunk/src/java/src/prj/net/sf/aceunit/GenTest.java 2009-01-31 13:04:07 UTC (rev 511)
@@ -243,6 +243,9 @@
return;
}
final PrintWriter out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(filename)));
+ if (printSet.contains(Print.generated)) {
+ System.out.println(allTestsFilename);
+ }
try {
for (final Integer id : new TreeSet<Integer>(allTests.keySet())) {
out.format("%d: %s%n", id, allTests.get(id));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2009-01-31 13:03:34
|
Revision: 510
http://aceunit.svn.sourceforge.net/aceunit/?rev=510&view=rev
Author: christianhujer
Date: 2009-01-31 13:03:31 +0000 (Sat, 31 Jan 2009)
Log Message:
-----------
Generate lists of available tests.
Modified Paths:
--------------
trunk/src/native/test/common.mak
Modified: trunk/src/native/test/common.mak
===================================================================
--- trunk/src/native/test/common.mak 2009-01-31 12:59:26 UTC (rev 509)
+++ trunk/src/native/test/common.mak 2009-01-31 13:03:31 UTC (rev 510)
@@ -9,7 +9,7 @@
VPATH=$(ACEUNIT_NATIVE_PATH)
-GENERATED:=$(shell java -ea -jar $(ACEUNIT_JAVA_PATH)/AceUnit.jar --print=generated .)
+GENERATED:=$(shell java -ea -jar $(ACEUNIT_JAVA_PATH)/AceUnit.jar --print=generated -o alltests.txt .)
SUITES:=$(filter *.c,$(GENERATED))
CSOURCES:=$(sort $(shell find . -name "*.c")) $(SUITES)
CXXSOURCES:=$(sort $(shell find . -name "*.cpp"))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2009-01-31 12:59:29
|
Revision: 509
http://aceunit.svn.sourceforge.net/aceunit/?rev=509&view=rev
Author: christianhujer
Date: 2009-01-31 12:59:26 +0000 (Sat, 31 Jan 2009)
Log Message:
-----------
Add option to write a table of all tests to a file.
Modified Paths:
--------------
trunk/src/java/src/prj/net/sf/aceunit/GenTest.java
trunk/src/java/src/prj/net/sf/aceunit/GenTest.properties
trunk/src/java/src/prj/net/sf/aceunit/GenTest_de.properties
Modified: trunk/src/java/src/prj/net/sf/aceunit/GenTest.java
===================================================================
--- trunk/src/java/src/prj/net/sf/aceunit/GenTest.java 2009-01-31 12:58:51 UTC (rev 508)
+++ trunk/src/java/src/prj/net/sf/aceunit/GenTest.java 2009-01-31 12:59:26 UTC (rev 509)
@@ -27,12 +27,8 @@
package net.sf.aceunit;
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-import java.util.EnumSet;
-import java.util.Map;
-import java.util.HashMap;
+import java.io.*;
+import java.util.*;
import net.sf.japi.io.args.ArgParser;
import net.sf.japi.io.args.BasicCommand;
@@ -64,8 +60,10 @@
private boolean force;
/** What to print. */
- private EnumSet<Print> printSet = EnumSet.noneOf(Print.class);
+ private final EnumSet<Print> printSet = EnumSet.noneOf(Print.class);
+ /** Filename to which a table of all tests is written. */
+ @Nullable private String allTestsFilename;
/**
* The IdGenerator which is used for generating unique ids for Suites.
@@ -108,6 +106,15 @@
}
/**
+ * Sets the filename of the file to which a table of all tests is written.
+ * @param allTestsFilename Filename of the file to which a table of all tests shall be written.
+ */
+ @Option({"o"})
+ public void setAllTestsFilename(@Nullable final String allTestsFilename) {
+ this.allTestsFilename = allTestsFilename;
+ }
+
+ /**
* Performs the generation of tests.
*
* @param basename Base name to generate tests for.
@@ -181,7 +188,7 @@
}
final String hSource = pckg.getCode("foo");
SourceFiles.writeIfChanged(cFile, hSource, force);
- allTests.put(pckg.getId(), pckgDir.toString().replaceAll("[^\\/]", "."));
+ allTests.put(pckg.getId(), pckgDir.toString().replaceAll("^\\./", "").replaceAll("[\\/]", "."));
}
if (containedFixture && parent != null) {
parent.addSuite(pckg);
@@ -222,11 +229,29 @@
final String hSource = fixture.getCode(fixtureName);
SourceFiles.writeIfChanged(hFile, hSource, force);
pckg.addSuite(fixture);
- allTests.put(fixture.getId(), fixtureFile.toString().replaceAll("[^\\/]", "."));
+ allTests.put(fixture.getId(), fixtureName.replaceAll("[\\/]", "."));
}
return containedFixture;
}
+ /** Writes all tests to the file in {@link #allTestsFilename} if it is not null.
+ * @throws IOException in case of I/O problems.
+ */
+ private void writeAllTests() throws IOException {
+ final String filename = allTestsFilename;
+ if (filename == null) {
+ return;
+ }
+ final PrintWriter out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(filename)));
+ try {
+ for (final Integer id : new TreeSet<Integer>(allTests.keySet())) {
+ out.format("%d: %s%n", id, allTests.get(id));
+ }
+ } finally {
+ out.close();
+ }
+ }
+
/** {@inheritDoc} */
public int run(@NotNull final List<String> args) throws Exception {
if (args.size() == 0) {
@@ -237,6 +262,7 @@
for (final String basename : args) {
okay &= perform(basename);
}
+ writeAllTests();
return okay ? 0 : 1;
}
Modified: trunk/src/java/src/prj/net/sf/aceunit/GenTest.properties
===================================================================
--- trunk/src/java/src/prj/net/sf/aceunit/GenTest.properties 2009-01-31 12:58:51 UTC (rev 508)
+++ trunk/src/java/src/prj/net/sf/aceunit/GenTest.properties 2009-01-31 12:59:26 UTC (rev 509)
@@ -25,6 +25,7 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
helpHeader=Usage: java -jar AceUnit.jar [OPTION]... [BASENAME]...\nCreate AceUnit unit test headers for one or more suites with the specified BASENAME(s) (omit .c suffix for fixtures).\n
-helpFooter=Examples:\n java -jar AceUnit.jar sortTest\n java -jar AceUnit.jar --print=generated src/test/\n
+helpFooter=Examples:\n java -jar AceUnit.jar sortTest\n java -jar AceUnit.jar --print=generated -o alltests.txt src/test/\n
setForce=Overwrite write-protected files.
-setPrint=Specifies what to print. Comman separated enum set.\n suites: Print suite file names.\n fixtures: Print fixture file names.\n generated: Print generated file names.\n headers: Print header file names.\n sources: Print source file names.
+setPrint=Specifies what to print. Comman separated enum set.\n suites: Print suite file names.
+setAllTestsFilename=Write a table of all tests and their ids to the specified file.
Modified: trunk/src/java/src/prj/net/sf/aceunit/GenTest_de.properties
===================================================================
--- trunk/src/java/src/prj/net/sf/aceunit/GenTest_de.properties 2009-01-31 12:58:51 UTC (rev 508)
+++ trunk/src/java/src/prj/net/sf/aceunit/GenTest_de.properties 2009-01-31 12:59:26 UTC (rev 509)
@@ -25,5 +25,5 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
helpHeader=Verwendung: java -jar AceUnit.jar [OPTION]... [BASENAME]...\nErzeuge AceUnit Unit Test Header-Dateien f\xFCr ein oder mehrere Test-Suiten mit den angegebenen BASENAME(s) (.c-Suffix bei Fixtures weglassen).\n
-helpFooter=Beispiele:\n java -jar AceUnit.jar sortTest\n java -jar AceUnit.jar src/test/\n
+helpFooter=Beispiele:\n java -jar AceUnit.jar sortTest\n java -jar AceUnit.jar --print=generated -o alltests.txt src/test/\n
setForce=Schreibgesch\xFCtzte Dateien \xFCberschreiben.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|