From 91fb6f84cdff65d7129549af8706916e83698ac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Mon, 8 Aug 2022 20:01:07 -0700 Subject: [PATCH] Cleanup. --- scripts/toolchain.lua | 4 ++-- tests/os_test.cpp | 14 +++++++++----- tests/thread_test.cpp | 4 ++++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index a8b5a78..6fb00cc 100644 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -941,7 +941,7 @@ function toolchain(_buildDir, _libDir) } linkoptions { - "-s MAX_WEBGL_VERSION=2" + "-s MAX_WEBGL_VERSION=2", } configuration { "wasm2js" } @@ -949,7 +949,7 @@ function toolchain(_buildDir, _libDir) objdir (path.join(_buildDir, "wasm2js/obj")) libdirs { path.join(_libDir, "lib/wasm2js") } linkoptions { - "-s WASM=0" + "-s WASM=0", } configuration { "wasm" } diff --git a/tests/os_test.cpp b/tests/os_test.cpp index c332b52..6f11515 100644 --- a/tests/os_test.cpp +++ b/tests/os_test.cpp @@ -14,15 +14,19 @@ TEST_CASE("getProcessMemoryUsed", "") // DBG("bx::getProcessMemoryUsed %d", bx::getProcessMemoryUsed() ); } +#if BX_CONFIG_SUPPORTS_THREADING + TEST_CASE("semaphore_timeout", "") { bx::Semaphore sem; - int64_t start = bx::getHPCounter(); - bool ok = sem.wait(900); - int64_t elapsed = bx::getHPCounter() - start; + int64_t start = bx::getHPCounter(); + bool ok = sem.wait(900); + int64_t elapsed = bx::getHPCounter() - start; int64_t frequency = bx::getHPFrequency(); - double ms = double(elapsed) / double(frequency) * 1000; - printf("%f\n", ms); + double ms = double(elapsed) / double(frequency) * 1000; + bx::printf("%f\n", ms); REQUIRE(!ok); } + +#endif // BX_CONFIG_SUPPORTS_THREADING diff --git a/tests/thread_test.cpp b/tests/thread_test.cpp index d238db1..b517eac 100644 --- a/tests/thread_test.cpp +++ b/tests/thread_test.cpp @@ -6,6 +6,8 @@ #include "test.h" #include +#if BX_CONFIG_SUPPORTS_THREADING + bx::DefaultAllocator s_allocator; bx::MpScUnboundedBlockingQueue s_mpsc(&s_allocator); @@ -69,3 +71,5 @@ TEST_CASE("MpScUnboundedBlockingQueue", "") REQUIRE(result == 0x1389); } + +#endif // BX_CONFIG_SUPPORTS_THREADING