ability to run just one test case, finally
This commit is contained in:
@@ -2,12 +2,32 @@ package test;
|
|||||||
|
|
||||||
import utest.Runner;
|
import utest.Runner;
|
||||||
import utest.ui.Report;
|
import utest.ui.Report;
|
||||||
|
#if macro
|
||||||
|
import haxe.macro.Context;
|
||||||
|
#end
|
||||||
|
|
||||||
class TestMain {
|
class TestMain {
|
||||||
public static function main() {
|
public static function main() {
|
||||||
var runner = new Runner();
|
var runner = new Runner();
|
||||||
runner.addCases(test.cases);
|
addCases();
|
||||||
Report.create(runner);
|
Report.create(runner);
|
||||||
runner.run();
|
runner.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static macro function addCases() {
|
||||||
|
if (Context.defined("cases")) {
|
||||||
|
var cases = Context.definedValue("cases").split(",");
|
||||||
|
var block = [];
|
||||||
|
for (caseName in cases) {
|
||||||
|
var typePath = {
|
||||||
|
pack: ["test", "cases"],
|
||||||
|
name: caseName
|
||||||
|
};
|
||||||
|
block.push(macro runner.addCase(new $typePath()));
|
||||||
|
}
|
||||||
|
return macro $b{block};
|
||||||
|
} else {
|
||||||
|
return macro runner.addCases(test.cases);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
6
test.sh
6
test.sh
@@ -18,5 +18,9 @@ then
|
|||||||
./test-project.sh
|
./test-project.sh
|
||||||
# Test Kiss with utest cases in kiss/src/test/cases
|
# Test Kiss with utest cases in kiss/src/test/cases
|
||||||
else
|
else
|
||||||
haxe kiss/build-scripts/common-args.hxml kiss/build-scripts/common-test-args.hxml kiss/build-scripts/$KISS_TARGET/test.hxml
|
if [ ! -z "$2" ]; then
|
||||||
|
haxe -D cases=$2 kiss/build-scripts/common-args.hxml kiss/build-scripts/common-test-args.hxml kiss/build-scripts/$KISS_TARGET/test.hxml
|
||||||
|
else
|
||||||
|
haxe kiss/build-scripts/common-args.hxml kiss/build-scripts/common-test-args.hxml kiss/build-scripts/$KISS_TARGET/test.hxml
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user