Бранимир Караџић 3 yıl önce
ebeveyn
işleme
91fb6f84cd
3 değiştirilmiş dosya ile 15 ekleme ve 7 silme
  1. 2 2
      scripts/toolchain.lua
  2. 9 5
      tests/os_test.cpp
  3. 4 0
      tests/thread_test.cpp

+ 2 - 2
scripts/toolchain.lua

@@ -941,7 +941,7 @@ function toolchain(_buildDir, _libDir)
 		}
 		}
 
 
 		linkoptions {
 		linkoptions {
-			"-s MAX_WEBGL_VERSION=2"
+			"-s MAX_WEBGL_VERSION=2",
 		}
 		}
 
 
 	configuration { "wasm2js" }
 	configuration { "wasm2js" }
@@ -949,7 +949,7 @@ function toolchain(_buildDir, _libDir)
 		objdir (path.join(_buildDir, "wasm2js/obj"))
 		objdir (path.join(_buildDir, "wasm2js/obj"))
 		libdirs { path.join(_libDir, "lib/wasm2js") }
 		libdirs { path.join(_libDir, "lib/wasm2js") }
 		linkoptions {
 		linkoptions {
-			"-s WASM=0"
+			"-s WASM=0",
 		}
 		}
 
 
 	configuration { "wasm" }
 	configuration { "wasm" }

+ 9 - 5
tests/os_test.cpp

@@ -14,15 +14,19 @@ TEST_CASE("getProcessMemoryUsed", "")
 //	DBG("bx::getProcessMemoryUsed %d", bx::getProcessMemoryUsed() );
 //	DBG("bx::getProcessMemoryUsed %d", bx::getProcessMemoryUsed() );
 }
 }
 
 
+#if BX_CONFIG_SUPPORTS_THREADING
+
 TEST_CASE("semaphore_timeout", "")
 TEST_CASE("semaphore_timeout", "")
 {
 {
 	bx::Semaphore sem;
 	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();
 	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);
 	REQUIRE(!ok);
 }
 }
+
+#endif // BX_CONFIG_SUPPORTS_THREADING

+ 4 - 0
tests/thread_test.cpp

@@ -6,6 +6,8 @@
 #include "test.h"
 #include "test.h"
 #include <bx/thread.h>
 #include <bx/thread.h>
 
 
+#if BX_CONFIG_SUPPORTS_THREADING
+
 bx::DefaultAllocator s_allocator;
 bx::DefaultAllocator s_allocator;
 bx::MpScUnboundedBlockingQueue<void> s_mpsc(&s_allocator);
 bx::MpScUnboundedBlockingQueue<void> s_mpsc(&s_allocator);
 
 
@@ -69,3 +71,5 @@ TEST_CASE("MpScUnboundedBlockingQueue", "")
 
 
 	REQUIRE(result == 0x1389);
 	REQUIRE(result == 0x1389);
 }
 }
+
+#endif // BX_CONFIG_SUPPORTS_THREADING