summaryrefslogtreecommitdiff
path: root/tests/scripts/functions/origin
diff options
context:
space:
mode:
Diffstat (limited to 'tests/scripts/functions/origin')
-rw-r--r--tests/scripts/functions/origin44
1 files changed, 17 insertions, 27 deletions
diff --git a/tests/scripts/functions/origin b/tests/scripts/functions/origin
index 49e6f38..f7b7eb8 100644
--- a/tests/scripts/functions/origin
+++ b/tests/scripts/functions/origin
@@ -18,34 +18,24 @@ defined per the following list:
# Set an environment variable
$extraENV{MAKETEST} = 1;
-open(MAKEFILE,"> $makefile");
-
-print MAKEFILE <<EOF;
+run_make_test('
foo := bletch garf
-auto_var = udef CC MAKETEST MAKE foo CFLAGS WHITE \@
-av = \$(foreach var, \$(auto_var), \$(origin \$(var)) )
+auto_var = undefined CC MAKETEST MAKE foo CFLAGS WHITE @
+av = $(foreach var, $(auto_var), $(origin $(var)) )
override WHITE := BLACK
all: auto
-\t\@echo \$(origin undefined)
-\t\@echo \$(origin CC)
-\t\@echo \$(origin MAKETEST)
-\t\@echo \$(origin MAKE)
-\t\@echo \$(origin foo)
-\t\@echo \$(origin CFLAGS)
-\t\@echo \$(origin WHITE)
-\t\@echo \$(origin \@)
+ @echo $(origin undefined)
+ @echo $(origin CC)
+ @echo $(origin MAKETEST)
+ @echo $(origin MAKE)
+ @echo $(origin foo)
+ @echo $(origin CFLAGS)
+ @echo $(origin WHITE)
+ @echo $(origin @)
auto :
-\t\@echo \$(av)
-EOF
-
-close(MAKEFILE);
-
-&run_make_with_options($makefile,
- "-e WHITE=WHITE CFLAGS=",
- &get_logfile);
-
-# Create the answer to what should be produced by this Makefile
-$answer = "undefined default environment default file command line override automatic
+ @echo $(av)',
+ '-e WHITE=WHITE CFLAGS=',
+ 'undefined default environment default file command line override automatic
undefined
default
environment
@@ -53,9 +43,9 @@ default
file
command line
override
-automatic\n";
-
+automatic');
-&compare_output($answer,&get_logfile(1));
+# Reset an environment variable
+delete $extraENV{MAKETEST};
1;