Browse Source

runBeforeCommit build.xml as per Andy request

patch target in top build.xml for cvs patch creation (nice to see what changed before commiting since no cvsspam)
AspectJ5_Development
avasseur 19 years ago
parent
commit
7a82de84b0

+ 1
- 1
ajbrowser/testsrc/org/aspectj/tools/ajbrowser/AjbrowserTests.java View File

@@ -31,4 +31,4 @@ public class AjbrowserTests extends TestCase {
public AjbrowserTests(String name) { super(name); }

public void testNothing() {}
}
}

+ 9
- 0
build-common.xml View File

@@ -107,6 +107,15 @@
</classpath>
<test name="@{suite}"/>
</junit>
<!-- TODO AV - using java to invoke JUnit since the junit task is hidding errors - don't know why -->
<!-- <java classname="@{suite}" fork="on" dir="../@{project}">-->
<!-- <jvmarg line=""/>-->
<!-- <classpath>-->
<!-- <pathelement path="../@{project}/${build.dir}"/>-->
<!-- <pathelement path="../@{project}/${test.build.dir}"/>-->
<!-- <path refid="@{path}"/>-->
<!-- </classpath>-->
<!-- </java>-->
</sequential>
</macrodef>


+ 9
- 0
build.xml View File

@@ -1,11 +1,20 @@
<?xml version="1.0"?>
<project name="aspectj" basedir=".">

<target name="patch">
<cvs output="patch">
<commandline>
<argument line="-q diff -u -N"/>
</commandline>
</cvs>
</target>

<macrodef name="targets">
<attribute name="name"/>
<sequential>
<subant target="@{name}">
<!-- TODO ant 1.7 stuff here would be better.. -->
<!-- TODO: we do not call RunBeforeCommit since all test will be run thru each module separately -->
<filelist dir="."
files="runtime/build.xml,
util/build.xml,

+ 106
- 0
run-all-junit-tests/build.xml View File

@@ -0,0 +1,106 @@
<?xml version="1.0"?>
<project name="run-all-junit-tests" default="all" basedir=".">

<import file="../build-common.xml"/>
<import file="../ajbrowser/build.xml"/>
<import file="../ajde/build.xml"/>
<import file="../asm/build.xml"/>
<import file="../bridge/build.xml"/>
<import file="../org.aspectj.ajdt.core/build.xml"/>
<import file="../runtime/build.xml"/>
<import file="../taskdefs/build.xml"/>
<import file="../testing/build.xml"/>
<import file="../testing-drivers/build.xml"/>
<import file="../tests/build.xml"/>
<import file="../util/build.xml"/>
<!-- <import file="../ajde/build.xml"/>-->
<!-- <import file="../asm/build.xml"/>-->
<!-- <import file="../bridge/build.xml"/>-->
<!-- <import file="../testing/build.xml"/>-->

<path id="run-all-junit-tests.test.src.path">
<!-- <path refid="run-all-junit-tests.src.path"/>-->
<pathelement path="../ajde/bintest"/>
<pathelement path="../ajde/bin"/>
<pathelement path="../ajbrowser/bintest"/>
<pathelement path="../ajbrowser/bin"/>
<pathelement path="../asm/bintest"/>
<pathelement path="../asm/bin"/>
<pathelement path="../bridge/bintest"/>
<pathelement path="../bridge/bin"/>
<pathelement path="../org.aspectj.ajdt.core/bintest"/>
<pathelement path="../org.aspectj.ajdt.core/bin"/>
<pathelement path="../taskdefs/bintest"/>
<pathelement path="../taskdefs/bin"/>
<pathelement path="../runtime/bintest"/>
<pathelement path="../runtime/bin"/>
<pathelement path="../testing/bintest"/>
<pathelement path="../testing/bin"/>
<pathelement path="../testing-drivers/bintest"/>
<pathelement path="../testing-drivers/bin"/>
<pathelement path="../testing-util/bintest"/>
<pathelement path="../testing-util/bin"/>
<pathelement path="../tests/bin"/>
<pathelement path="../util/bintest"/>
<pathelement path="../util/bin"/>
<!-- below are libs / deps required for test run -->
<fileset dir="${basedir}/../lib">
<include name="junit/*.jar"/>
<include name="ant/lib/*.jar"/>
<include name="commons/*.jar"/>
<include name="bcel/*.jar"/>
</fileset>
<fileset dir="${basedir}/../org.eclipse.jdt.core">
<include name="*.jar"/>
</fileset>
<pathelement path="../weaver/bin"/>
<pathelement path="../weaver/bintest"/>
</path>

<path id="run-all-junit-tests.src.path">
</path>

<target name="compile" depends="init">
<!-- empty - no src/ here -->
</target>

<target name="test:compile" depends="compile,
ajbrowser.compile,
ajbrowser.test:compile,
ajde.compile,
ajde.test:compile,
asm.compile,
asm.test:compile,
bridge.compile,
bridge.test:compile,
org.aspectj.ajdt.core.compile,
org.aspectj.ajdt.core.test:compile,
runtime.compile,
runtime.test:compile,
taskdefs.compile,
taskdefs.test:compile,
testing.compile,
testing.test:compile,
testing-drivers.compile,
testing-drivers.test:compile,
testing-util.compile,
testing-util.test:compile,
tests.compile,
util.compile,
util.test:compile,
weaver.compile,
weaver.test:compile">
<testcompile project="run-all-junit-tests" path="run-all-junit-tests.test.src.path"/>
</target>

<target name="test" depends="test:compile">
<testrun project="run-all-junit-tests" path="run-all-junit-tests.test.src.path"
suite="RunTheseBeforeYouCommitTests"/>
</target>

<target name="clean">

</target>

</project>


+ 41
- 0
run-all-junit-tests/testsrc/RunTheseBeforeYouCommitTests.java View File

@@ -2,6 +2,14 @@ import org.aspectj.systemtest.AllTests14;

import junit.framework.Test;
import junit.framework.TestSuite;
import junit.framework.AssertionFailedError;
import junit.framework.TestResult;
import junit.framework.TestListener;
import junit.textui.TestRunner;
import junit.textui.ResultPrinter;
import junit.extensions.TestDecorator;

import java.util.Iterator;

/*
* Created on 03-Aug-2004
@@ -26,4 +34,37 @@ public class RunTheseBeforeYouCommitTests {
//$JUnit-END$
return suite;
}

public static void main(String args[]) throws Throwable {
// TestRunner.run(suite());
junit.textui.TestRunner runner = new TestRunner();

// AV - for odd reason I could not have a proper error reporting
runner.doRun(new TestDecorator(suite()) {
public void run(final TestResult testResult) {
testResult.addListener(new TestListener() {
public void addError(Test test, Throwable throwable) {
System.err.println("******* ERROR ");
System.err.println("\t" + test);
throwable.printStackTrace();
}

public void addFailure(Test test, AssertionFailedError assertionFailedError) {
System.err.println("******* FAILURE ");
System.err.println("\t" + test);
assertionFailedError.printStackTrace();
}

public void endTest(Test test) {
}

public void startTest(Test test) {
System.out.println("->" + test);
}
});
super.run(testResult);
}
});
}

}

Loading…
Cancel
Save