summaryrefslogtreecommitdiff
path: root/tests/run_make_tests.pl
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2012-10-29 07:05:21 +0000
committerPaul Smith <psmith@gnu.org>2012-10-29 07:05:21 +0000
commit7670c84f7732db29f5a9d9c145c2327f4b575f91 (patch)
tree1fafd8949c867b89444ef57c6d068e7b8fb1a70e /tests/run_make_tests.pl
parent2efd6b47bf59c3202ccc6218b42ba360136d3789 (diff)
downloadgunmake-7670c84f7732db29f5a9d9c145c2327f4b575f91.tar.gz
Implement new "load" directive.
Provides support for dynamically loadable objects in GNU make, as a "technology preview".
Diffstat (limited to 'tests/run_make_tests.pl')
-rwxr-xr-xtests/run_make_tests.pl29
1 files changed, 14 insertions, 15 deletions
diff --git a/tests/run_make_tests.pl b/tests/run_make_tests.pl
index 477b117..4accd4a 100755
--- a/tests/run_make_tests.pl
+++ b/tests/run_make_tests.pl
@@ -97,6 +97,17 @@ sub valid_option
$old_makefile = undef;
+sub subst_make_string
+{
+ local $_ = shift;
+ $makefile and s/#MAKEFILE#/$makefile/g;
+ s/#MAKEPATH#/$mkpath/g;
+ s/#MAKE#/$make_name/g;
+ s/#PERL#/$perl_name/g;
+ s/#PWD#/$pwd/g;
+ return $_;
+}
+
sub run_make_test
{
local ($makestring, $options, $answer, $err_code, $timeout) = @_;
@@ -114,16 +125,9 @@ sub run_make_test
$makefile = &get_tmpfile();
}
- # Make sure it ends in a newline.
+ # Make sure it ends in a newline and substitute any special tokens.
$makestring && $makestring !~ /\n$/s and $makestring .= "\n";
-
- # Replace @MAKEFILE@ with the makefile name and @MAKE@ with the path to
- # make
- $makestring =~ s/#MAKEFILE#/$makefile/g;
- $makestring =~ s/#MAKEPATH#/$mkpath/g;
- $makestring =~ s/#MAKE#/$make_name/g;
- $makestring =~ s/#PERL#/$perl_name/g;
- $makestring =~ s/#PWD#/$pwd/g;
+ $makestring = subst_make_string($makestring);
# Populate the makefile!
open(MAKEFILE, "> $makefile") || die "Failed to open $makefile: $!\n";
@@ -132,13 +136,8 @@ sub run_make_test
}
# Do the same processing on $answer as we did on $makestring.
-
$answer && $answer !~ /\n$/s and $answer .= "\n";
- $answer =~ s/#MAKEFILE#/$makefile/g;
- $answer =~ s/#MAKEPATH#/$mkpath/g;
- $answer =~ s/#MAKE#/$make_name/g;
- $answer =~ s/#PERL#/$perl_name/g;
- $answer =~ s/#PWD#/$pwd/g;
+ $answer = subst_make_string($answer);
run_make_with_options($makefile, $options, &get_logfile(0),
$err_code, $timeout);