From 41674a660526f6ccf51641aa8288f12e9f8ad6bc Mon Sep 17 00:00:00 2001 From: Aidan Lee Date: Tue, 25 Jun 2024 21:08:11 +0100 Subject: [PATCH] utest for telemetry --- test/telemetry/TestBasic.hx | 11 ++++++----- test/telemetry/TestMain.hx | 7 +------ test/telemetry/compile.hxml | 9 +++++---- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/test/telemetry/TestBasic.hx b/test/telemetry/TestBasic.hx index ad44bb60a..556403536 100644 --- a/test/telemetry/TestBasic.hx +++ b/test/telemetry/TestBasic.hx @@ -1,11 +1,12 @@ -class TestBasic extends haxe.unit.TestCase -{ - public function new() super(); +import utest.Test; +import utest.Assert; - function testStartTelemetry(string:String) +class TestBasic extends Test +{ + function testStartTelemetry() { var thread_id:Int = startTelemetry(true, true); - assertTrue(thread_id>=0); + Assert.isTrue(thread_id>=0); } function startTelemetry(with_profiler:Bool=true, diff --git a/test/telemetry/TestMain.hx b/test/telemetry/TestMain.hx index dfcea4aa8..f13d9e28a 100644 --- a/test/telemetry/TestMain.hx +++ b/test/telemetry/TestMain.hx @@ -3,11 +3,6 @@ package; class TestMain { static function main(){ - var r = new haxe.unit.TestRunner(); - r.add(new TestBasic()); - var t0 = haxe.Timer.stamp(); - var success = r.run(); - trace(" Time : " + (haxe.Timer.stamp()-t0)*1000 ); - Sys.exit(success ? 0 : 1); + utest.UTest.run([ new TestBasic() ]); } } diff --git a/test/telemetry/compile.hxml b/test/telemetry/compile.hxml index c908665c5..7562c3b50 100644 --- a/test/telemetry/compile.hxml +++ b/test/telemetry/compile.hxml @@ -1,6 +1,7 @@ --cpp bin --main TestMain --resource TestMain.hx +-m TestMain +-r TestMain.hx -D HXCPP_TELEMETRY -D HXCPP_STACK_TRACE --cp ../unit +-p ../unit +-L utest +--cpp bin \ No newline at end of file