diff options
author | Dmitry Goncharov <dgoncharov@users.sf.net> | 2022-09-25 17:09:08 -0400 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2022-09-25 17:09:08 -0400 |
commit | 6c87f3fb85311eb845ce437b1d31e8b7443a9233 (patch) | |
tree | 0db6220b2f3d91485374e837956d8c89a912c875 /tests | |
parent | 38116baee96bdb4ad8feb3134b64098997adff8e (diff) | |
download | make-git-6c87f3fb85311eb845ce437b1d31e8b7443a9233.tar.gz |
[SV 63100] Set the floc of every created goal dep struct
* src/read.c (eval): Initialize the goaldep floc pointer.
* tests/scripts/features/loadapi: Verify that the floc is set after
unloading and reloading dynamic objects.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/scripts/features/loadapi | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/tests/scripts/features/loadapi b/tests/scripts/features/loadapi index f4d335a7..640ac745 100644 --- a/tests/scripts/features/loadapi +++ b/tests/scripts/features/loadapi @@ -24,7 +24,7 @@ print $F <<'EOF' ; #include "gnumake.h" -char* getenv (const char*); +char *getenv (const char*); int plugin_is_GPL_compatible; @@ -71,15 +71,22 @@ func_test (const char *funcname, unsigned int argc, char **argv) } int -testapi_gmk_setup () +testapi_gmk_setup (const gmk_floc *floc) { + const char *verbose = getenv ("TESTAPI_VERBOSE"); + gmk_add_function ("test-expand", func_test, 1, 1, GMK_FUNC_DEFAULT); gmk_add_function ("test-noexpand", func_test, 1, 1, GMK_FUNC_NOEXPAND); gmk_add_function ("test-eval", func_test, 1, 1, GMK_FUNC_DEFAULT); gmk_add_function ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.", func_test, 0, 0, 0); - if (getenv ("TESTAPI_VERBOSE")) - printf("testapi_gmk_setup\n"); + if (verbose) + { + printf ("testapi_gmk_setup\n"); + + if (verbose[0] == '2') + printf ("%s:%lu\n", floc->filenm, floc->lineno); + } if (getenv ("TESTAPI_KEEP")) return -1; @@ -201,6 +208,18 @@ force:; .PHONY: force ", '', "testapi_gmk_setup\nhello\n#MAKE#: 'all' is up to date.\n"); +# sv 63100. +# Test that make supplies the correct floc when the shared object is loaded +# again. +$ENV{TESTAPI_VERBOSE} = 2; +run_make_test(" +load testapi.so +$extra_loads +all:; \$(info \$(test-expand hello)) +testapi.so: force; \$(info \$@) +force:; +.PHONY: force +", '', "testapi_gmk_setup\n#MAKEFILE#:2\ntestapi.so\ntestapi_gmk_setup\n#MAKEFILE#:2\nhello\n#MAKE#: 'all' is up to date.\n"); } unlink(qw(testapi.c testapi.so)) unless $keep; |