Enable more tests for wasm

- box2d test beds
- chipmunk test beds
This commit is contained in:
halx99 2023-09-06 10:11:48 +08:00
parent 3fa70d602b
commit 0c42b9370b
29 changed files with 31 additions and 37 deletions

View File

@ -449,7 +449,6 @@ macro (ax_setup_wasm_app_config app_name)
"-sEXPORTED_FUNCTIONS=[_main]" "-sEXPORTED_FUNCTIONS=[_main]"
"-sEXPORTED_RUNTIME_METHODS=[ccall,cwrap]" "-sEXPORTED_RUNTIME_METHODS=[ccall,cwrap]"
) )
message(STATUS "===== wasm app ${app_name} ${_APP_SOURCE_DIR}/index.html ... ")
set(EMSCRIPTEN_LINK_FLAGS "-lidbfs.js -s MIN_WEBGL_VERSION=2 -s MAX_WEBGL_VERSION=2 -s STACK_SIZE=4mb -s INITIAL_MEMORY=512MB --shell-file ${_APP_SOURCE_DIR}/index.html --use-preload-cache") set(EMSCRIPTEN_LINK_FLAGS "-lidbfs.js -s MIN_WEBGL_VERSION=2 -s MAX_WEBGL_VERSION=2 -s STACK_SIZE=4mb -s INITIAL_MEMORY=512MB --shell-file ${_APP_SOURCE_DIR}/index.html --use-preload-cache")
# Disable wasm, generate js build? # Disable wasm, generate js build?
# string(APPEND EMSCRIPTEN_LINK_FLAGS " -s WASM=0") # string(APPEND EMSCRIPTEN_LINK_FLAGS " -s WASM=0")

View File

@ -404,7 +404,7 @@ list(APPEND GAME_SOURCE
Source/Box2DTest/Box2dTest.cpp Source/Box2DTest/Box2dTest.cpp
) )
if((WINDOWS OR MACOSX OR LINUX) AND (NOT WINRT)) if((WINDOWS OR MACOSX OR LINUX OR WASM) AND (NOT WINRT))
list(APPEND GAME_HEADER list(APPEND GAME_HEADER
Source/Box2DTestBed/tests/test.h Source/Box2DTestBed/tests/test.h
Source/Box2DTestBed/tests/settings.h Source/Box2DTestBed/tests/settings.h
@ -493,42 +493,37 @@ list(APPEND GAME_SOURCE
Source/ChipmunkTest/ChipmunkTest.cpp Source/ChipmunkTest/ChipmunkTest.cpp
) )
if(WINDOWS OR MACOSX OR LINUX) if(WINDOWS OR MACOSX OR LINUX OR WASM)
list(APPEND GAME_HEADER list(APPEND GAME_HEADER
Source/ChipmunkTestBed/demo/ChipmunkDemo.h Source/ChipmunkTestBed/demo/ChipmunkDemo.h
Source/ChipmunkTestBed/ChipmunkTestBed.h Source/ChipmunkTestBed/ChipmunkTestBed.h
) )
set (TESTBED_C_SORUCES set (TESTBED_C_SORUCES
Source/ChipmunkTestBed/demo/Bench.c Source/ChipmunkTestBed/demo/Bench.cpp
Source/ChipmunkTestBed/demo/Chains.c Source/ChipmunkTestBed/demo/Chains.cpp
Source/ChipmunkTestBed/demo/Convex.c Source/ChipmunkTestBed/demo/Convex.cpp
Source/ChipmunkTestBed/demo/Crane.c Source/ChipmunkTestBed/demo/Crane.cpp
Source/ChipmunkTestBed/demo/Joints.c Source/ChipmunkTestBed/demo/Joints.cpp
Source/ChipmunkTestBed/demo/LogoSmash.c Source/ChipmunkTestBed/demo/LogoSmash.cpp
Source/ChipmunkTestBed/demo/OneWay.c Source/ChipmunkTestBed/demo/OneWay.cpp
Source/ChipmunkTestBed/demo/Planet.c Source/ChipmunkTestBed/demo/Planet.cpp
Source/ChipmunkTestBed/demo/Player.c Source/ChipmunkTestBed/demo/Player.cpp
Source/ChipmunkTestBed/demo/Plink.c Source/ChipmunkTestBed/demo/Plink.cpp
Source/ChipmunkTestBed/demo/Pump.c Source/ChipmunkTestBed/demo/Pump.cpp
Source/ChipmunkTestBed/demo/PyramidStack.c Source/ChipmunkTestBed/demo/PyramidStack.cpp
Source/ChipmunkTestBed/demo/PyramidTopple.c Source/ChipmunkTestBed/demo/PyramidTopple.cpp
Source/ChipmunkTestBed/demo/Shatter.c Source/ChipmunkTestBed/demo/Shatter.cpp
Source/ChipmunkTestBed/demo/Springies.c Source/ChipmunkTestBed/demo/Springies.cpp
Source/ChipmunkTestBed/demo/Sticky.c Source/ChipmunkTestBed/demo/Sticky.cpp
Source/ChipmunkTestBed/demo/Tank.c Source/ChipmunkTestBed/demo/Tank.cpp
Source/ChipmunkTestBed/demo/TheoJansen.c Source/ChipmunkTestBed/demo/TheoJansen.cpp
Source/ChipmunkTestBed/demo/Buoyancy.c Source/ChipmunkTestBed/demo/Buoyancy.cpp
Source/ChipmunkTestBed/demo/ContactGraph.c Source/ChipmunkTestBed/demo/ContactGraph.cpp
Source/ChipmunkTestBed/demo/Example.c Source/ChipmunkTestBed/demo/Example.cpp
Source/ChipmunkTestBed/demo/Query.c Source/ChipmunkTestBed/demo/Query.cpp
Source/ChipmunkTestBed/demo/Slice.c Source/ChipmunkTestBed/demo/Slice.cpp
Source/ChipmunkTestBed/demo/Unicycle.c Source/ChipmunkTestBed/demo/Unicycle.cpp
Source/ChipmunkTestBed/demo/Tumble.c) Source/ChipmunkTestBed/demo/Tumble.cpp)
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set_source_files_properties(${TESTBED_C_SORUCES} PROPERTIES COMPILE_FLAGS "/TP")
else()
set_source_files_properties(${TESTBED_C_SORUCES} PROPERTIES LANGUAGE CXX)
endif()
list(APPEND GAME_SOURCE list(APPEND GAME_SOURCE
${TESTBED_C_SORUCES} ${TESTBED_C_SORUCES}
Source/ChipmunkTestBed/ChipmunkTestBed.cpp Source/ChipmunkTestBed/ChipmunkTestBed.cpp

View File

@ -60,18 +60,18 @@ public:
addTest("Audio - NewAudioEngine", []() { return new AudioEngineTests(); }); addTest("Audio - NewAudioEngine", []() { return new AudioEngineTests(); });
addTest("Box2D - Basic", []() { return new Box2DTests(); }); addTest("Box2D - Basic", []() { return new Box2DTests(); });
#if defined(AX_PLATFORM_PC) #if defined(AX_PLATFORM_PC) || defined(__EMSCRIPTEN__)
addTest("Box2D - TestBed", []() { return new Box2DTestBedTests(); }); addTest("Box2D - TestBed", []() { return new Box2DTestBedTests(); });
#endif #endif
addTest("Chipmunk2D - Basic", []() { return new ChipmunkTests(); }); addTest("Chipmunk2D - Basic", []() { return new ChipmunkTests(); });
#if defined(AX_PLATFORM_PC) #if defined(AX_PLATFORM_PC) || defined(__EMSCRIPTEN__)
addTest("Chipmunk2D - TestBed", []() { return new ChipmunkTestBedTests(); }); addTest("Chipmunk2D - TestBed", []() { return new ChipmunkTestBedTests(); });
#endif #endif
addTest("Bugs", []() { return new BugsTests(); }); addTest("Bugs", []() { return new BugsTests(); });
addTest("Click and Move", []() { return new ClickAndMoveTest(); }); addTest("Click and Move", []() { return new ClickAndMoveTest(); });
addTest("Configuration", []() { return new ConfigurationTests(); }); addTest("Configuration", []() { return new ConfigurationTests(); });
addTest("Console", []() { return new ConsoleTests(); }); addTest("Console", []() { return new ConsoleTests(); });
#if !defined(AX_PLATFORM_WASM) #if !defined(__EMSCRIPTEN__)
addTest("Curl", []() { return new CurlTests(); }); addTest("Curl", []() { return new CurlTests(); });
#endif #endif
addTest("Current Language", []() { return new CurrentLanguageTests(); }); addTest("Current Language", []() { return new CurrentLanguageTests(); });

View File

@ -29,7 +29,7 @@
#include "Box2DTestBed/Box2DTestBed.h" #include "Box2DTestBed/Box2DTestBed.h"
#include "ChipmunkTest/ChipmunkTest.h" #include "ChipmunkTest/ChipmunkTest.h"
#if defined(AX_PLATFORM_PC) #if defined(AX_PLATFORM_PC) || defined(__EMSCRIPTEN__)
# include "ChipmunkTestBed/ChipmunkTestBed.h" # include "ChipmunkTestBed/ChipmunkTestBed.h"
#endif #endif