summaryrefslogtreecommitdiff
path: root/tests/scripts
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2023-02-26 12:43:27 -0500
committerPaul Smith <psmith@gnu.org>2023-02-26 13:46:02 -0500
commit8093e2eee3390e6b250c3ae5bfeb5b4a4196d2e2 (patch)
tree4220955507b466a5f24c103c14a45080385cf8c8 /tests/scripts
parent74dab224b33b5fe8a96ff3b6baaea4e7dbf8f753 (diff)
downloadmake-git-8093e2eee3390e6b250c3ae5bfeb5b4a4196d2e2.tar.gz
* tests/scripts/options/dash-l: Simplify the test via the helper
* tests/thelp.pl: Add "exist" and "noexist" operators.
Diffstat (limited to 'tests/scripts')
-rw-r--r--tests/scripts/options/dash-l17
1 files changed, 6 insertions, 11 deletions
diff --git a/tests/scripts/options/dash-l b/tests/scripts/options/dash-l
index d1e60494..a89da78c 100644
--- a/tests/scripts/options/dash-l
+++ b/tests/scripts/options/dash-l
@@ -20,32 +20,27 @@ also specified on the command line.";
$port_type eq 'W32' and return -1;
open(MAKEFILE,"> $makefile");
-printf MAKEFILE q,
-define test
-if [ ! -f test-file ]; then \
- echo >> test-file; sleep 2; %s test-file; \
-else \
- echo $@ FAILED; \
-fi
-endef
+printf MAKEFILE subst_make_string(q!
+test = #HELPER# noexist test-file file test-file sleep 2 rm test-file
all : ONE TWO THREE
ONE : ; @$(test)
TWO : ; @$(test)
THREE : ; @$(test)
-,, $CMD_rmfile;
+!);
close(MAKEFILE);
+my $ans = "noexist test-file\nfile test-file\nsleep 2\nrm test-file\n";
$mkoptions = "-l 0.0001";
$mkoptions .= " -j 4" if ($parallel_jobs);
# We have to wait longer than the default (5s).
-&run_make_with_options($makefile, $mkoptions, &get_logfile, 0, 8);
+&run_make_with_options($makefile, $mkoptions, &get_logfile, 0, 10);
$slurp = &read_file_into_string(&get_logfile(1));
if ($slurp =~ /cannot enforce load limit/) {
return -1;
}
-&compare_output("", &get_logfile(1));
+&compare_output("$ans$ans$ans", &get_logfile(1));
1;