diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-29 04:41:38 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-29 04:41:38 +0000 |
commit | 7b6e527f440cd7e6f8be2b07cee320ee6ca18786 (patch) | |
tree | 4a2738d69fa2814659fdadddf5826282e73d81f4 /test cases/frameworks/16 sdl2 | |
parent | Initial commit. (diff) | |
download | meson-upstream.tar.xz meson-upstream.zip |
Adding upstream version 1.0.1.upstream/1.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test cases/frameworks/16 sdl2')
-rw-r--r-- | test cases/frameworks/16 sdl2/meson.build | 13 | ||||
-rw-r--r-- | test cases/frameworks/16 sdl2/meson_options.txt | 6 | ||||
-rw-r--r-- | test cases/frameworks/16 sdl2/sdl2prog.c | 33 | ||||
-rw-r--r-- | test cases/frameworks/16 sdl2/test.json | 14 |
4 files changed, 66 insertions, 0 deletions
diff --git a/test cases/frameworks/16 sdl2/meson.build b/test cases/frameworks/16 sdl2/meson.build new file mode 100644 index 0000000..fc98010 --- /dev/null +++ b/test cases/frameworks/16 sdl2/meson.build @@ -0,0 +1,13 @@ +project('sdl2 test', 'c') + +method = get_option('method') + +sdl2_dep = dependency('sdl2', version : '>=2.0.0', required : false, method : method) + +if not sdl2_dep.found() + error('MESON_SKIP_TEST sdl2 not found.') +endif + +e = executable('sdl2prog', 'sdl2prog.c', dependencies : sdl2_dep) + +test('sdl2test', e) diff --git a/test cases/frameworks/16 sdl2/meson_options.txt b/test cases/frameworks/16 sdl2/meson_options.txt new file mode 100644 index 0000000..176af17 --- /dev/null +++ b/test cases/frameworks/16 sdl2/meson_options.txt @@ -0,0 +1,6 @@ +option( + 'method', + type : 'combo', + choices : ['auto', 'pkg-config', 'config-tool', 'sdlconfig', 'extraframework'], + value : 'auto', +) diff --git a/test cases/frameworks/16 sdl2/sdl2prog.c b/test cases/frameworks/16 sdl2/sdl2prog.c new file mode 100644 index 0000000..b67aab4 --- /dev/null +++ b/test cases/frameworks/16 sdl2/sdl2prog.c @@ -0,0 +1,33 @@ +/* vim: set sts=4 sw=4 et : */ + +#include <stdio.h> +#include <SDL_version.h> + +int main(int argc, char *argv[]) { + SDL_version compiled; + SDL_version linked; + + SDL_VERSION(&compiled); + SDL_GetVersion(&linked); + + if (compiled.major != linked.major) { + fprintf(stderr, "Compiled major '%u' != linked major '%u'", + compiled.major, linked.major); + return -1; + } + + if (compiled.minor != linked.minor) { + fprintf(stderr, "Compiled minor '%u' != linked minor '%u'", + compiled.minor, linked.minor); + return -2; + } +#if 0 + /* Disabled because sometimes this is 'micro' and sometimes 'patch' */ + if (compiled.micro != linked.micro) { + fprintf(stderr, "Compiled micro '%u' != linked micro '%u'", + compiled.micro, linked.micro); + return -3; + } +#endif + return 0; +} diff --git a/test cases/frameworks/16 sdl2/test.json b/test cases/frameworks/16 sdl2/test.json new file mode 100644 index 0000000..57a3f21 --- /dev/null +++ b/test cases/frameworks/16 sdl2/test.json @@ -0,0 +1,14 @@ +{ + "matrix": { + "options": { + "method": [ + { "val": "auto" }, + { "val": "pkg-config" }, + { "val": "config-tool" }, + { "val": "sdlconfig" }, + { "val": "extraframework", "skip_on_os": ["!darwin"], "skip_on_jobname": ["macos"] } + ] + } + }, + "skip_on_jobname": ["azure", "cygwin", "msys2"] +} |