@@ -1,5 +1,6 @@
import utest.Runner;
import utest.ui.Report;
+import utest.ui.common.HeaderDisplayMode;
class Main {
static public function main() {
@@ -10,7 +11,9 @@ class Main {
runner.addCase(new io.TestFileInput());
runner.addCase(new io.TestProcess());
runner.addCase(new net.TestSocket());
- Report.create(runner);
+ var report = Report.create(runner);
+ report.displayHeader = AlwaysShowHeader;
+ report.displaySuccessResults = NeverShowSuccessResults;
runner.run();
}
@@ -5,7 +5,7 @@ import utest.ui.Report;
/**
This test is intented to be used by TestSys and io.TestProcess.
*/
-class TestArguments {
+class TestArguments extends utest.Test {
// We may compare and update the test cases of other popular langs/libs: https://gist.github.com/andyli/d55ae9ea1327bbbf749d
static public var expectedArgs(default, never):Array<String> = [
"foo",
@@ -101,8 +101,6 @@ class TestArguments {
null;
#end
- function new() { }
-
function testArgs() {
var args = Sys.args();
for (i in 0...expectedArgs.length) {
@@ -113,7 +111,9 @@ class TestArguments {
static function main():Void {
var runner = new Runner();
runner.addCase(new TestArguments());
@@ -2,11 +2,9 @@ import sys.*;
import haxe.io.*;
import utest.Assert;
-class TestCommandBase {
+class TestCommandBase extends utest.Test {
var runInfo:{out:String, err:String} = null;
- public function new() { }
function run(cmd:String, ?args:Array<String>):Int {
throw "should be overridden";
@@ -1,7 +1,7 @@
import sys.FileSystem;
-class TestFileSystem {
+class TestFileSystem extends utest.Test {
Recursively remove a given directory.
@@ -25,14 +25,12 @@ class TestFileSystem {
case _: ["", "/"];
public function setup() {
removeDir(dir);
FileSystem.createDirectory(dir);
- public function tearDown() {
+ public function teardown() {
@@ -4,8 +4,7 @@ import utest.Assert;
import sys.io.File;
-class TestFile {
+class TestFile extends utest.Test {
public function testCopyOverwrite() {
var fileA = "temp/a.txt";
@@ -12,19 +12,17 @@ import sys.io.FileSeek;
*
* @author Maximilian Ruta <[email protected]>
-class TestFileInput {
+class TestFileInput extends utest.Test {
static var contentString = "test\n1234сюрприз!"; //that's total of 24 bytes
static var contentBytes = [116, 101, 115, 116, 10, 49, 50, 51, 52, 209, 129, 209, 142, 209, 128, 208, 191, 209, 128, 208, 184, 208, 183, 33];
private var path = 'temp/testcase-test-file.txt';
File.saveContent(path, contentString);
FileSystem.deleteFile(path);
@@ -3,7 +3,7 @@ package net;
import sys.net.*;
-class TestSocket {
+class TestSocket extends utest.Test {
var registeredSockets:Array<Socket> = [];
public function register<T:Socket>(socket:T):T {
@@ -11,7 +11,7 @@ class TestSocket {
return socket;
for(socket in registeredSockets) {
if(socket == null) continue;
socket.close();
@@ -19,8 +19,6 @@ class TestSocket {
registeredSockets = [];
public function testBind() {
var socket = register(new Socket());
socket.bind(new Host('localhost'), 34567);