Browse Source

Platform: improve application tests for easier testing on Emscripten.

pull/272/head
Vladimír Vondruš 8 years ago
parent
commit
cc1bfeb0b8
  1. 17
      src/Magnum/Platform/Test/CMakeLists.txt
  2. 18
      src/Magnum/Platform/Test/Sdl2ApplicationTest.html
  3. 19
      src/Magnum/Platform/Test/WindowlessEglApplicationTest.html

17
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)

18
src/Magnum/Platform/Test/Sdl2ApplicationTest.html

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Magnum Sdl2Application Test</title>
<link rel="stylesheet" href="WebApplication.css" />
</head>
<body>
<h1>Magnum Sdl2Application Test</h1>
<div id="listener">
<canvas id="module"></canvas>
<div id="status">Initialization...</div>
<div id="statusDescription"></div>
<script src="EmscriptenApplication.js"></script>
<script async="async" src="PlatformSdl2ApplicationTest.js"></script>
</div>
</body>
</html>

19
src/Magnum/Platform/Test/WindowlessEglApplicationTest.html

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Magnum WindowlessEglApplication Test</title>
<link rel="stylesheet" href="WebApplication.css" />
</head>
<body>
<h1>Magnum WindowlessEglApplication Test</h1>
<div id="listener">
<canvas id="module" class="hidden"></canvas>
<pre id="log"></pre>
<div id="status">Initialization...</div>
<div id="statusDescription"></div>
<script src="WindowlessEmscriptenApplication.js"></script>
<script async="async" src="PlatformWindowlessEglApplicationTest.js"></script>
</div>
</body>
</html>
Loading…
Cancel
Save