From 758b0f711c496a1121061724573bb0eb816cd57b Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Sun, 7 Jan 2018 20:54:23 +0100 Subject: make: disable bm_find_binary tests when running embedded --- src/blogc-make/exec.c | 4 ++-- tests/blogc-make/check_exec.c | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/blogc-make/exec.c b/src/blogc-make/exec.c index dba7e5c..551c7d7 100644 --- a/src/blogc-make/exec.c +++ b/src/blogc-make/exec.c @@ -33,8 +33,8 @@ bm_exec_find_binary(const char *argv0, const char *bin, const char *env) // for embedded blogc-make, if we are looking for blogc, we just return // argv0, because the static binary may not be named `blogc`, and we // prefer to use our own `blogc` instead of some other version around. - if (0 == strcmp(bin, "blogc")) { - return bc_strdup(argv0); + if (argv0 != NULL && bin != NULL && (0 == strcmp(bin, "blogc"))) { + return bc_shell_quote(argv0); } #endif diff --git a/tests/blogc-make/check_exec.c b/tests/blogc-make/check_exec.c index 1dac6b2..e0c9931 100644 --- a/tests/blogc-make/check_exec.c +++ b/tests/blogc-make/check_exec.c @@ -6,6 +6,10 @@ * See the file LICENSE. */ +#ifdef HAVE_CONFIG_H +#include +#endif /* HAVE_CONFIG_H */ + #include #include #include @@ -178,7 +182,9 @@ int main(void) { const UnitTest tests[] = { +#ifndef MAKE_EMBEDDED unit_test(test_find_binary), +#endif unit_test(test_build_blogc_cmd_with_settings), unit_test(test_build_blogc_cmd_with_settings_and_dev), unit_test(test_build_blogc_cmd_without_settings), -- cgit v1.2.3-18-g5258