diff options
author | wisberg <wisberg> | 2005-05-12 11:54:22 +0000 |
---|---|---|
committer | wisberg <wisberg> | 2005-05-12 11:54:22 +0000 |
commit | 9be6f2d8567da5ee7628049a452f989b1410402c (patch) | |
tree | ef74de054be1d06c9d1ce8a404c6bda5f16c6ab0 /tests | |
parent | 23571ff0520587189db0a64e035baa7eb63c7a35 (diff) | |
download | aspectj-9be6f2d8567da5ee7628049a452f989b1410402c.tar.gz aspectj-9be6f2d8567da5ee7628049a452f989b1410402c.zip |
harness LTW support - untested
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ajcHarnessTests.xml | 153 | ||||
-rw-r--r-- | tests/ajcTestSuite.dtd | 7 | ||||
-rw-r--r-- | tests/harness/fork/MainWriter.java | 14 |
3 files changed, 161 insertions, 13 deletions
diff --git a/tests/ajcHarnessTests.xml b/tests/ajcHarnessTests.xml index ebcee1d95..fc393ca3c 100644 --- a/tests/ajcHarnessTests.xml +++ b/tests/ajcHarnessTests.xml @@ -13,6 +13,15 @@ PASS fail {title..} # expect fail, actual pass Also pick out "incremental-test" keyword for incremental tests. + + Variant tests below: + - [fork|spoon]-[out|err|Error]-[detected|ignored] + - ltw-[base|jarAspectpath{-jarClasspath}] + + Issues: + - harness not stopping after unexpected-fails completes. + When exception thrown, everything cleaned up? + --> <suite> <!-- disabled so skipping expect-fail causes all to pass @@ -24,6 +33,7 @@ <compile files="NoSuchFile.java"/> </ajc-test> --> + <ajc-test dir="harness" title="pass 2 error"> <compile files="ErrorTest.java"> @@ -219,7 +229,7 @@ <inc-compile tag="same" fresh="true" /> <run class="packageOne.Main" - options="new-event"/> <!-- now expect new-event --> + options="new-event"/> </ajc-test> <ajc-test dir="harness" keywords="incremental-test" @@ -440,7 +450,7 @@ </inc-compile> </ajc-test> - <!--ajc-test dir="harness" + <ajc-test dir="harness" keywords="expect-fail" title="fail not forking or setting property"> <compile files="SystemPropertiesTest.java"/> @@ -461,29 +471,150 @@ fork="true" vmargs="-DPASS=true,-Dname=value"/> </ajc-test> + + <ajc-test dir="harness/fork" + title="pass fork verify Main runs"> + <compile files="MainWriter.java"/> + <run class="MainWriter" fork="true"/> + </ajc-test> + + <ajc-test dir="harness/fork" + title="pass spoon verify Main runs"> + <compile files="MainWriter.java"/> + <run class="MainWriter"/> + </ajc-test> + + <ajc-test dir="harness/fork" + keywords="expect-fail" + title="fail fork-err-detected Main runs, uses System.err, fails on err"> + <compile files="MainWriter.java"/> + <run class="MainWriter" options="err" fork="true"/> + </ajc-test> + + <ajc-test dir="harness/fork" + title="pass fork-err-ignored Main runs, uses System.err, err ignored"> + <compile files="MainWriter.java"/> + <run class="MainWriter" options="err" fork="true" errStreamIsError="false"/> + </ajc-test> + + <ajc-test dir="harness/fork" + keywords="expect-fail" + title="fail fork-out-detected Main runs, uses System.out, fails on out"> + <compile files="MainWriter.java"/> + <run class="MainWriter" options="out" fork="true" outStreamIsError="true"/> + </ajc-test> + + <ajc-test dir="harness/fork" + title="pass fork-out-ignored Main runs, uses System.out, out ignored"> + <compile files="MainWriter.java"/> + <run class="MainWriter" options="out" fork="true" outStreamIsError="false"/> + </ajc-test> + + <ajc-test dir="harness/fork" + keywords="expect-fail" + title="fail fork-Error-detected Main runs, throws Error, fails on Error"> + <compile files="MainWriter.java"/> + <run class="MainWriter" options="Error" fork="true" /> + </ajc-test> + + <ajc-test dir="harness/fork" + title="pass fork-Error-ignored Main runs, throws Error, expects Error"> + <compile files="MainWriter.java"/> + <run class="MainWriter" options="Error" fork="true" exception="Error"/> + </ajc-test> + + <ajc-test dir="harness/fork" + keywords="expect-fail" + title="fail fork-Error-missed Main runs, does not throws Error, expects Error"> + <compile files="MainWriter.java"/> + <run class="MainWriter" fork="true" exception="Error"/> + </ajc-test> + + <ajc-test dir="harness/fork" + keywords="expect-fail" + title="fail spoon-err-detected Main runs, uses System.err, fails on err"> + <compile files="MainWriter.java"/> + <run class="MainWriter" options="err" /> + </ajc-test> + + <ajc-test dir="harness/fork" + title="pass spoon-err-ignored Main runs, uses System.err, err ignored"> + <compile files="MainWriter.java"/> + <run class="MainWriter" options="err" errStreamIsError="false"/> + </ajc-test> + <ajc-test dir="harness/fork" + keywords="expect-fail" + title="fail spoon-out-detected Main runs, uses System.out, fails on out"> + <compile files="MainWriter.java"/> + <run class="MainWriter" options="out" outStreamIsError="true"/> + </ajc-test> + + <ajc-test dir="harness/fork" + title="pass spoon-out-ignored Main runs, uses System.out, out ignored"> + <compile files="MainWriter.java"/> + <run class="MainWriter" options="out" outStreamIsError="false"/> + </ajc-test> + + <ajc-test dir="harness/fork" + keywords="expect-fail" + title="fail spoon-Error-detected Main runs, throws Error, fails on Error"> + <compile files="MainWriter.java"/> + <run class="MainWriter" options="Error"/> + </ajc-test> + + <ajc-test dir="harness/fork" + title="pass spoon-Error-ignored Main runs, throws Error, expects Error"> + <compile files="MainWriter.java"/> + <run class="MainWriter" options="Error" exception="Error"/> + </ajc-test> + + <ajc-test dir="harness/fork" + keywords="expect-fail" + title="fail spoon-Error-missed Main runs, does not throws Error, expects Error"> + <compile files="MainWriter.java"/> + <run class="MainWriter" exception="Error"/> + </ajc-test> + <ajc-test dir="harness/aspectpath" - title="pass aspectpath LTW aspect works in one compile"> - <compile files="A.java,Main.java"/> + keywords="expect-fail" + title="fail ltw-base Main fails without aspect"> + <compile files="Main.java"/> <run class="Main"/> </ajc-test> <ajc-test dir="harness/aspectpath" - keywords="expect-fail" - title="fail aspectpath LTW failure case"> + title="pass ltw-base Main fails without aspect (expected)"> <compile files="Main.java"/> + <run class="Main" exception="Error"/> + </ajc-test> + + <ajc-test dir="harness/aspectpath" + title="pass ltw-base Main works with aspect"> + <compile files="A.java,Main.java"/> <run class="Main"/> - </ajc-test--> + </ajc-test> - <!-- uncomment after weaveinfo messages - (which cause false negatives) are suppressed <ajc-test dir="harness/aspectpath" - title="pass aspectpath LTW"> + title="pass ltw-jarAspectpath"> <compile files="A.java" outjar="out.jar"/> <compile files="Main.java"/> <run class="Main" aspectpath="out.jar"/> </ajc-test> - --> + <ajc-test dir="harness/aspectpath" + title="pass ltw-jarAspectpath-jarClasspath"> + <compile files="A.java" outjar="out.jar"/> + <compile files="Main.java" outjar="cl.zip"/> + <run class="Main" aspectpath="out.jar" classpath="cl.zip"/> + </ajc-test> + +<!-- reproduce hang from blocking IO read at JavaRun.java + <ajc-test dir="harness/fork" + title="pass fork-Error-ignored Main runs, throws Error, expects Error"> + <compile files="MainWriter.java"/> + <run class="MainWriter" options="Error" fork="true" exception="Error"/> + </ajc-test> +--> </suite> diff --git a/tests/ajcTestSuite.dtd b/tests/ajcTestSuite.dtd index e7c4f5918..44734a9cc 100644 --- a/tests/ajcTestSuite.dtd +++ b/tests/ajcTestSuite.dtd @@ -4,8 +4,8 @@ <!ELEMENT suite (ajc-test*)>
<!ATTLIST suite suiteDir CDATA #IMPLIED >
-
- <!ELEMENT ajc-test (compile, (compile | inc-compile | run)*)>
+ <!-- permits leading inc-compile, will fail -->
+ <!ELEMENT ajc-test ((compile | inc-compile | run)*)>
<!ATTLIST ajc-test title CDATA #REQUIRED >
<!ATTLIST ajc-test dir CDATA #REQUIRED >
<!ATTLIST ajc-test pr CDATA #IMPLIED >
@@ -42,6 +42,9 @@ <!ATTLIST run fork CDATA #IMPLIED >
<!ATTLIST run vmargs CDATA #IMPLIED >
<!ATTLIST run aspectpath CDATA #IMPLIED >
+ <!ATTLIST run classpath CDATA #IMPLIED >
+ <!ATTLIST run LTW CDATA #IMPLIED >
+ <!ATTLIST run exception CDATA #IMPLIED >
<!ELEMENT message (source*)>
<!ATTLIST message kind (abort | fail | error | warning | info | Xlint) #REQUIRED >
diff --git a/tests/harness/fork/MainWriter.java b/tests/harness/fork/MainWriter.java new file mode 100644 index 000000000..a7b3993da --- /dev/null +++ b/tests/harness/fork/MainWriter.java @@ -0,0 +1,14 @@ + +public class MainWriter { + public static void main(String[] args) { + if (args.length > 0) { + if ("err".equals(args[0])) { + System.err.println("System.err"); + } else if ("out".equals(args[0])) { + System.out.println("System.out"); + } else if ("Error".equals(args[0])) { + throw new Error(); + } + } + } +}
\ No newline at end of file |