From cc1bfeb0b8ace783e5c673178a214129bc9ed565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 19 Aug 2018 13:50:18 +0200 Subject: [PATCH] Platform: improve application tests for easier testing on Emscripten. --- src/Magnum/Platform/Test/CMakeLists.txt | 17 ++++++++++++++++- .../Platform/Test/Sdl2ApplicationTest.html | 18 ++++++++++++++++++ .../Test/WindowlessEglApplicationTest.html | 19 +++++++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 src/Magnum/Platform/Test/Sdl2ApplicationTest.html create mode 100644 src/Magnum/Platform/Test/WindowlessEglApplicationTest.html diff --git a/src/Magnum/Platform/Test/CMakeLists.txt b/src/Magnum/Platform/Test/CMakeLists.txt index 82f5128b7..e06c6f4a9 100644 --- a/src/Magnum/Platform/Test/CMakeLists.txt +++ b/src/Magnum/Platform/Test/CMakeLists.txt @@ -51,7 +51,14 @@ if(WITH_SDL2APPLICATION) add_executable(PlatformSdl2ApplicationTest Sdl2ApplicationTest.cpp) target_link_libraries(PlatformSdl2ApplicationTest PRIVATE MagnumSdl2Application) set_target_properties(PlatformSdl2ApplicationTest PROPERTIES FOLDER "Magnum/Platform/Test") - if(CORRADE_TARGET_IOS) + if(CORRADE_TARGET_EMSCRIPTEN) + # So we can spin up a webserver in the build dir for easy testing + file(COPY + ../EmscriptenApplication.js + ../WebApplication.css + Sdl2ApplicationTest.html + DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) + elseif(CORRADE_TARGET_IOS) set_target_properties(PlatformSdl2ApplicationTest PROPERTIES MACOSX_BUNDLE ON XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "YES") @@ -74,6 +81,14 @@ if(WITH_WINDOWLESSEGLAPPLICATION) add_executable(PlatformWindowlessEglApplicationTest WindowlessEglApplicationTest.cpp) target_link_libraries(PlatformWindowlessEglApplicationTest PRIVATE MagnumWindowlessEglApplication) set_target_properties(PlatformWindowlessEglApplicationTest PROPERTIES FOLDER "Magnum/Platform/Test") + if(CORRADE_TARGET_EMSCRIPTEN) + # So we can spin up a webserver in the build dir for easy testing + file(COPY + ../WindowlessEmscriptenApplication.js + ../WebApplication.css + WindowlessEglApplicationTest.html + DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) + endif() endif() if(WITH_WINDOWLESSGLXAPPLICATION) diff --git a/src/Magnum/Platform/Test/Sdl2ApplicationTest.html b/src/Magnum/Platform/Test/Sdl2ApplicationTest.html new file mode 100644 index 000000000..c65d07ca3 --- /dev/null +++ b/src/Magnum/Platform/Test/Sdl2ApplicationTest.html @@ -0,0 +1,18 @@ + + + + + Magnum Sdl2Application Test + + + +

Magnum Sdl2Application Test

+
+ +
Initialization...
+
+ + +
+ + diff --git a/src/Magnum/Platform/Test/WindowlessEglApplicationTest.html b/src/Magnum/Platform/Test/WindowlessEglApplicationTest.html new file mode 100644 index 000000000..96b63d442 --- /dev/null +++ b/src/Magnum/Platform/Test/WindowlessEglApplicationTest.html @@ -0,0 +1,19 @@ + + + + + Magnum WindowlessEglApplication Test + + + +

Magnum WindowlessEglApplication Test

+
+ +

+      
Initialization...
+
+ + +
+ +