Statistics
| Revision:

root / tmp / org.txm.core.tests / src / org / txm / scripts / macro / tests / RunAllTestsMacro.groovy @ 1626

History | View | Annotate | Download (690 Bytes)

1 1626 mdecorde
package org.txm.scripts.macro.tests
2 1626 mdecorde
3 1626 mdecorde
import java.io.File
4 1626 mdecorde
import org.kohsuke.args4j.*
5 1626 mdecorde
import groovy.transform.Field
6 1626 mdecorde
import org.txm.rcp.swt.widget.parameters.*
7 1626 mdecorde
import org.txm.Toolbox
8 1626 mdecorde
import org.txm.rcp.commands.tests.*
9 1626 mdecorde
10 1626 mdecorde
@Field @Option(name="step", usage="step to execute, 0=all 1=export&test 2=test", widget="Integer", required=true, def="0")
11 1626 mdecorde
int step
12 1626 mdecorde
13 1626 mdecorde
// Open the parameters input dialog box
14 1626 mdecorde
if (!ParametersDialog.open(this)) return;
15 1626 mdecorde
16 1626 mdecorde
if (step < 0) step = 0;
17 1626 mdecorde
if (step > 3) step = 2;
18 1626 mdecorde
19 1626 mdecorde
TestBench bench = GroovyTestBench.getTests();
20 1626 mdecorde
for (Test test : bench.getTests().values()) {
21 1626 mdecorde
        String name = test.getName()
22 1626 mdecorde
        if (test.run(step)) {
23 1626 mdecorde
                println "$name -> OK"
24 1626 mdecorde
        } else {
25 1626 mdecorde
                println "$name -> KO"
26 1626 mdecorde
        }
27 1626 mdecorde
}