Statistics
| Revision:

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

History | View | Annotate | Download (796 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="name", usage="The test name to run", widget="String", required=true, def="test1")
11 1626 mdecorde
String name
12 1626 mdecorde
13 1626 mdecorde
@Field @Option(name="step", usage="step to execute, 0=all 1=export&test 2=test", widget="Integer", required=true, def="0")
14 1626 mdecorde
int step
15 1626 mdecorde
16 1626 mdecorde
// Open the parameters input dialog box
17 1626 mdecorde
if (!ParametersDialog.open(this)) return;
18 1626 mdecorde
19 1626 mdecorde
if (step < 0) step = 0;
20 1626 mdecorde
if (step > 3) step = 2;
21 1626 mdecorde
22 1626 mdecorde
TestBench bench = GroovyTestBench.getTests();
23 1626 mdecorde
Test test = bench.getTest(name)
24 1626 mdecorde
25 1626 mdecorde
if (test.run(step)) {
26 1626 mdecorde
        println "$name -> OK see "+test.getLogs()
27 1626 mdecorde
} else {
28 1626 mdecorde
        println "$name -> KO see "+test.getLogs()
29 1626 mdecorde
}