From 7e54892847f326e6233c9df3202e823346e42588 Mon Sep 17 00:00:00 2001 From: Mathieu Westphal Date: Sat, 28 Dec 2024 11:45:57 +0100 Subject: [PATCH] better testing --- application/testing/CMakeLists.txt | 11 +++++++++-- testing/data/invalid.dll | 3 +++ 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 testing/data/invalid.dll diff --git a/application/testing/CMakeLists.txt b/application/testing/CMakeLists.txt index cb4531306f..8c36fb28e3 100644 --- a/application/testing/CMakeLists.txt +++ b/application/testing/CMakeLists.txt @@ -327,8 +327,15 @@ endif() # Test plugin fail code path f3d_test(NAME TestPluginVerbose ARGS --verbose REGEXP "Loading plugin \"native\"" NO_BASELINE) f3d_test(NAME TestPluginNonExistent ARGS --load-plugins=dummy REGEXP "Plugin failed to load" NO_BASELINE) -f3d_test(NAME TestPluginInvalid ARGS --load-plugins=${F3D_SOURCE_DIR}/testing/data/invalid.so REGEXP "file too short" NO_BASELINE) -if (NOT WIN32) +if(WIN32) + f3d_test(NAME TestPluginInvalid ARGS --load-plugins=${F3D_SOURCE_DIR}/testing/data/invalid.dll REGEXP "file too short" NO_BASELINE) +elseif(APPLE) + f3d_test(NAME TestPluginInvalid ARGS --load-plugins=${F3D_SOURCE_DIR}/testing/data/invalid.so REGEXP "not a mach-o file" NO_BASELINE) +else() + f3d_test(NAME TestPluginInvalid ARGS --load-plugins=${F3D_SOURCE_DIR}/testing/data/invalid.so REGEXP "file too short" NO_BASELINE) +endif() + +if(UNIX AND NOT APPLE) f3d_test(NAME TestPluginInvalidSystem ARGS --verbose --load-plugins=invalid REGEXP "file too short" ENV "LD_LIBRARY_PATH=${F3D_SOURCE_DIR}/testing/data" NO_BASELINE) endif() diff --git a/testing/data/invalid.dll b/testing/data/invalid.dll new file mode 100644 index 0000000000..8575163cc5 --- /dev/null +++ b/testing/data/invalid.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e2df53aec82f9d93ad26e57748dd2e61299bb3a1cf14f55005f180e75e960789 +size 28