From a819be12df67966ff539f19abdbddf2ae8552e2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Tue, 3 Oct 2017 21:26:45 +0200 Subject: [PATCH] Skip plugin tests if shared build is disabled The use of -shared in the LDFLAGS for the plugins does not work with './configure --disable-shared'. Instead of failing the build this patch SKIPs the plugin tests. --- tests/test-plugin.c | 6 ++++++ unit-tests/test-dl.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/test-plugin.c b/tests/test-plugin.c index 3b16042f..3b97c99b 100644 --- a/tests/test-plugin.c +++ b/tests/test-plugin.c @@ -25,6 +25,7 @@ #include // exit() #include // strlen() +#include // access() #include "libtest.h" // #define LARGEFILE (11 << 20) @@ -193,6 +194,11 @@ int main(void) } }; + if (access("./libs/libpluginname.so", R_OK) != 0 + && access("./libs/libpluginname.dll", R_OK) != 0 + && access("./libs/cygpluginname.dll", R_OK) != 0) + exit(77); // likely a static build + wget_test_start_server( WGET_TEST_RESPONSE_URLS, &urls, countof(urls), WGET_TEST_FEATURE_MHD, diff --git a/unit-tests/test-dl.c b/unit-tests/test-dl.c index 3e633727..dd1f0626 100644 --- a/unit-tests/test-dl.c +++ b/unit-tests/test-dl.c @@ -137,7 +137,9 @@ static void copy_file(const char *src, const char *dst) printf(" Copying %s --> %s\n", src, dst); - libassert(stat(src, &statbuf) == 0); + if (stat(src, &statbuf) != 0) + exit(77); // likely a static build + libassert((sfd = open(src, O_RDONLY | O_BINARY)) >= 0); libassert((dfd = open(dst, O_WRONLY | O_CREAT | O_BINARY, statbuf.st_mode)) >= 0); size_remain = statbuf.st_size;