mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-02 09:57:40 +00:00
ctest/emscripten: make audio and video driver configurable
This commit is contained in:
parent
ef2a30e415
commit
9eac3a434e
2 changed files with 21 additions and 7 deletions
|
@ -615,13 +615,23 @@ if(APPLE)
|
||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(TESTS_ENVIRONMENT
|
|
||||||
SDL_AUDIO_DRIVER=dummy
|
|
||||||
SDL_VIDEO_DRIVER=dummy
|
|
||||||
)
|
|
||||||
|
|
||||||
set(SDLTEST_TIMEOUT_MULTIPLIER "1" CACHE STRING "SDL test time-out multiplier")
|
set(SDLTEST_TIMEOUT_MULTIPLIER "1" CACHE STRING "SDL test time-out multiplier")
|
||||||
|
|
||||||
|
set(SDLTEST_AUDIO_DRIVER_DEFAULT "dummy")
|
||||||
|
set(SDLTEST_VIDEO_DRIVER_DEFAULT "dummy")
|
||||||
|
if(EMSCRIPTEN)
|
||||||
|
set(SDLTEST_AUDIO_DRIVER_DEFAULT "emscripten")
|
||||||
|
set(SDLTEST_VIDEO_DRIVER_DEFAULT "emscripten")
|
||||||
|
endif()
|
||||||
|
set(SDLTEST_AUDIO_DRIVER "${SDLTEST_AUDIO_DRIVER_DEFAULT}" CACHE STRING "SDL audio driver for CTest")
|
||||||
|
set(SDLTEST_VIDEO_DRIVER "${SDLTEST_VIDEO_DRIVER_DEFAULT}" CACHE STRING "SDL video driver for CTest")
|
||||||
|
|
||||||
|
set(TESTS_ENVIRONMENT
|
||||||
|
"SDL_AUDIO_DRIVER=${SDLTEST_AUDIO_DRIVER}"
|
||||||
|
"SDL_VIDEO_DRIVER=${SDLTEST_VIDEO_DRIVER}"
|
||||||
|
"SDL_ASSERT=abort"
|
||||||
|
)
|
||||||
|
|
||||||
function(add_sdl_test TEST TARGET)
|
function(add_sdl_test TEST TARGET)
|
||||||
cmake_parse_arguments(ast "INSTALL" "" "" ${ARGN})
|
cmake_parse_arguments(ast "INSTALL" "" "" ${ARGN})
|
||||||
get_property(noninteractive TARGET ${TARGET} PROPERTY SDL_NONINTERACTIVE)
|
get_property(noninteractive TARGET ${TARGET} PROPERTY SDL_NONINTERACTIVE)
|
||||||
|
|
|
@ -3,12 +3,13 @@
|
||||||
import argparse
|
import argparse
|
||||||
import contextlib
|
import contextlib
|
||||||
import logging
|
import logging
|
||||||
import urllib.parse
|
import os
|
||||||
|
import pathlib
|
||||||
import shlex
|
import shlex
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import pathlib
|
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
import urllib.parse
|
||||||
|
|
||||||
from selenium import webdriver
|
from selenium import webdriver
|
||||||
import selenium.common.exceptions
|
import selenium.common.exceptions
|
||||||
|
@ -68,6 +69,9 @@ class SDLSeleniumTestDriver:
|
||||||
"loghtml": "1",
|
"loghtml": "1",
|
||||||
"SDL_ASSERT": "abort",
|
"SDL_ASSERT": "abort",
|
||||||
}
|
}
|
||||||
|
for key, value in os.environ.items():
|
||||||
|
if key.startswith("SDL_"):
|
||||||
|
req[key] = value
|
||||||
req.update({f"arg_{i}": a for i, a in enumerate(self.arguments, 1) })
|
req.update({f"arg_{i}": a for i, a in enumerate(self.arguments, 1) })
|
||||||
req_str = urllib.parse.urlencode(req)
|
req_str = urllib.parse.urlencode(req)
|
||||||
return f"{self.server}/{self.test}.html?{req_str}"
|
return f"{self.server}/{self.test}.html?{req_str}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue