summaryrefslogtreecommitdiff
path: root/tests/scripts/options
diff options
context:
space:
mode:
Diffstat (limited to 'tests/scripts/options')
-rw-r--r--tests/scripts/options/dash-n10
-rw-r--r--tests/scripts/options/dash-t38
2 files changed, 40 insertions, 8 deletions
diff --git a/tests/scripts/options/dash-n b/tests/scripts/options/dash-n
index 35f317d..de19f42 100644
--- a/tests/scripts/options/dash-n
+++ b/tests/scripts/options/dash-n
@@ -49,14 +49,8 @@ EOF
close(MAKEFILE);
-&touch('b');
-# Sometimes, on my Solaris 2.5.1 box with a NetApp filesystem NFS-mounted,
-# just touching b first then a isn't good enough: the nsec field in the
-# stat result shows b is _newer_ than a once every 5 or 6 tries!!! I've
-# no idea what this is about, but that's why there's a sleep(1) here...
-sleep(1);
-&touch('a');
-sleep(1);
+&utouch(-20, 'b');
+&utouch(-10, 'a');
&touch('c');
# TEST 2
diff --git a/tests/scripts/options/dash-t b/tests/scripts/options/dash-t
new file mode 100644
index 0000000..8192fbf
--- /dev/null
+++ b/tests/scripts/options/dash-t
@@ -0,0 +1,38 @@
+# -*-perl-*-
+
+$description = "Test the -t option.\n";
+
+$details = "Look out for regressions of prior bugs related to -t.\n";
+# That means, nobody has even tried to make the tests below comprehensive
+
+# TEST 0
+# bug reported by Henning Makholm <henning@makholm.net> on 2001-11-03:
+# make 3.79.1 touches only interm-[ab] but reports final-[a] as
+# 'up to date' without touching them.
+# The 'obvious' fix didn't work for double-colon rules, so pay special
+# attention to them.
+
+open(MAKEFILE, "> $makefile");
+print MAKEFILE <<'EOMAKE';
+final-a: interm-a ; echo >> $@
+final-b: interm-b ; echo >> $@
+interm-a:: orig1-a ; echo >> $@
+interm-a:: orig2-a ; echo >> $@
+interm-b:: orig1-b ; echo >> $@
+interm-b:: orig2-b ; echo >> $@
+EOMAKE
+close(MAKEFILE);
+
+&utouch(-30, 'orig1-a','orig2-b');
+&utouch(-20, 'interm-a','interm-b');
+&utouch(-10, 'final-a','final-b');
+&touch('orig2-a','orig1-b');
+
+&run_make_with_options($makefile, "-t final-a final-b", &get_logfile);
+$answer = "touch interm-a\ntouch final-a\ntouch interm-b\ntouch final-b\n";
+&compare_output($answer, &get_logfile(1));
+
+unlink('orig1-a', 'orig2-a', 'interm-a', 'final-a');
+unlink('orig1-b', 'orig2-b', 'interm-b', 'final-b');
+
+1;