aboutsummaryrefslogtreecommitdiffstats
path: root/tests/build.xml
blob: aed5613f7907c4aba208bd988fb775c59a5c0907 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?xml version="1.0"?>
<project name="tests" default="all" basedir=".">

    <import file="../build/build-common.xml"/>
    <import file="../ajde/build.xml"/>
    <import file="../asm/build.xml"/>
    <import file="../bridge/build.xml"/>
    <import file="../testing/build.xml"/>
    <import file="../testing-drivers/build.xml"/>
    <import file="../org.aspectj.ajdt.core/build.xml"/>

    <path id="tests.test.src.path">
        <!-- all are for test run -->
        <path refid="tests.src.path"/>
        <pathelement path="../runtime/bin"/>
        <pathelement path="../weaver/bin"/>
        <fileset dir="${basedir}/../lib">
            <include name="junit/*.jar"/>
            <include name="commons/*.jar"/>
        </fileset>
        <fileset dir="${basedir}/../org.eclipse.jdt.core">
            <include name="*.jar"/>
        </fileset>
    </path>

    <path id="tests.src.path">
        <pathelement path="../ajde/bin"/>
        <pathelement path="../asm/bin"/>
        <pathelement path="../bridge/bin"/>
        <pathelement path="../org.aspectj.ajdt.core/bin"/>
        <pathelement path="../org.aspectj.ajdt.core/bintest"/>
        <pathelement path="../testing/bin"/>
        <pathelement path="../testing-drivers/bin"/>
        <pathelement path="../util/bin"/>
        <fileset dir="${basedir}/../lib">
            <include name="bcel/*.jar"/>
        </fileset>
    </path>

    <target name="compile" depends="init,
                                    ajde.compile,
                                    asm.compile,
                                    bridge.compile,
                                    org.aspectj.ajdt.core.compile,
                                    testing.compile,
                                    testing-drivers.compile,
                                    testing-util.compile,
                                    weaver.compile">
        <!-- we cannot use dependancies on any xxx.test:compile since it refers back xxx.compile that Ants
             interprets as this.compile due to <import directives, thus circular -->
        <testcompile project="weaver" path="weaver.test.src.path"/>
        <testcompile project="org.aspectj.ajdt.core" path="org.aspectj.ajdt.core.test.src.path"/>
        <srccompile project="tests" path="tests.src.path"/>
    </target>

    <target name="test:compile" depends="compile">
        <!-- no testsrc here (all should actually be a testsrc to ease Ant import things..) -->
    </target>

    <target name="test" depends="test:compile,
                                 runtime.compile,
                                 weaver.compile,
                                 tests.test.jdk13,
                                 tests.test.jdk14,
                                 tests.test.jdk15">
        <!-- Note: AllTests15 does run Java 1.3 and 1.4 test and so on -->
    </target>

    <!-- local target since macro does not support "if" -->
    <!-- FIXME remove macro usage here to use vmarg for -Dorg.aspectj.tools.ajc.Ajc.verbose=true support
         since it helps when test fails -->
    <target name="tests.test.jdk15" if="jdk15">
        <testrun project="tests" path="tests.test.src.path" suite="org.aspectj.systemtest.AllTests15"/>
    </target>
    <target name="tests.test.jdk14" if="jdk14">
        <testrun project="tests" path="tests.test.src.path" suite="org.aspectj.systemtest.AllTests14"/>
    </target>
    <target name="tests.test.jdk13" if="jdk13">
        <testrun project="tests" path="tests.test.src.path" suite="org.aspectj.systemtest.AllTests"/>
    </target>

    <!-- run a single test with "ant -Dtest=org.aspectj.systemtest.AllTests15 atest" -->
    <target name="atest" depends="test:compile,
                                 runtime.compile,
                                 weaver.compile">
        <junit showoutput="on" fork="on" haltonfailure="on" haltonerror="on" printsummary="on">
            <classpath>
                <pathelement path="../tests/bin"/>
                <pathelement path="../tests/bintest"/>
                <path refid="tests.test.src.path"/>
            </classpath>
            <test name="${test}"/>
        </junit>
    </target>

</project>