mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-03 16:36:25 +00:00
Add test that verifies all SDL3 symbols are available
This commit is contained in:

committed by
Anonymous Maarten

parent
4718000dba
commit
9f721e8a9c
@@ -45,6 +45,7 @@ SDL_INCLUDE_DIR = SDL_ROOT / "include/SDL3"
|
|||||||
SDL_DYNAPI_PROCS_H = SDL_ROOT / "src/dynapi/SDL_dynapi_procs.h"
|
SDL_DYNAPI_PROCS_H = SDL_ROOT / "src/dynapi/SDL_dynapi_procs.h"
|
||||||
SDL_DYNAPI_OVERRIDES_H = SDL_ROOT / "src/dynapi/SDL_dynapi_overrides.h"
|
SDL_DYNAPI_OVERRIDES_H = SDL_ROOT / "src/dynapi/SDL_dynapi_overrides.h"
|
||||||
SDL_DYNAPI_SYM = SDL_ROOT / "src/dynapi/SDL_dynapi.sym"
|
SDL_DYNAPI_SYM = SDL_ROOT / "src/dynapi/SDL_dynapi.sym"
|
||||||
|
TESTSYMBOLS = SDL_ROOT / "test/testsymbols.c"
|
||||||
|
|
||||||
RE_EXTERN_C = re.compile(r'.*extern[ "]*C[ "].*')
|
RE_EXTERN_C = re.compile(r'.*extern[ "]*C[ "].*')
|
||||||
RE_COMMENT_REMOVE_CONTENT = re.compile(r'\/\*.*\*/')
|
RE_COMMENT_REMOVE_CONTENT = re.compile(r'\/\*.*\*/')
|
||||||
@@ -511,6 +512,20 @@ def add_dyn_api(proc: SdlProcedure) -> None:
|
|||||||
for line in new_input:
|
for line in new_input:
|
||||||
f.write(line)
|
f.write(line)
|
||||||
|
|
||||||
|
# File: test/testsymbols.c
|
||||||
|
#
|
||||||
|
# Add before "extra symbols go here" line
|
||||||
|
with TESTSYMBOLS.open() as f:
|
||||||
|
new_input = []
|
||||||
|
for line in f:
|
||||||
|
if "extra symbols go here" in line:
|
||||||
|
new_input.append(f" SDL_SYMBOL_ITEM({proc.name}),\n")
|
||||||
|
new_input.append(line)
|
||||||
|
|
||||||
|
with TESTSYMBOLS.open("w", newline="") as f:
|
||||||
|
for line in new_input:
|
||||||
|
f.write(line)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
|
@@ -319,6 +319,7 @@ add_sdl_test_executable(testdraw SOURCES testdraw.c)
|
|||||||
add_sdl_test_executable(testdrawchessboard SOURCES testdrawchessboard.c)
|
add_sdl_test_executable(testdrawchessboard SOURCES testdrawchessboard.c)
|
||||||
add_sdl_test_executable(testdropfile MAIN_CALLBACKS SOURCES testdropfile.c)
|
add_sdl_test_executable(testdropfile MAIN_CALLBACKS SOURCES testdropfile.c)
|
||||||
add_sdl_test_executable(testerror NONINTERACTIVE DISABLE_THREADS_ARGS "--no-threads" SOURCES testerror.c)
|
add_sdl_test_executable(testerror NONINTERACTIVE DISABLE_THREADS_ARGS "--no-threads" SOURCES testerror.c)
|
||||||
|
add_sdl_test_executable(testsymbols NONINTERACTIVE NOTRACKMEM NONINTERACTIVE_ARGS 0 10 20 40 80 160 320 640 SOURCES testsymbols.c)
|
||||||
|
|
||||||
set(build_options_dependent_tests )
|
set(build_options_dependent_tests )
|
||||||
|
|
||||||
|
1366
test/testsymbols.c
Normal file
1366
test/testsymbols.c
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user