summaryrefslogtreecommitdiff
path: root/tests/test_driver.pl
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2002-07-10 12:59:07 +0000
committerPaul Smith <psmith@gnu.org>2002-07-10 12:59:07 +0000
commit4d72c4c11e3aff65e9bb36e5fcf75f088b140049 (patch)
tree92a4ac290dd9b9f2261e60457aca9b5a951bc15b /tests/test_driver.pl
parent6c9a393f954805d49ab6c66957b46199ddd6e78e (diff)
downloadgunmake-4d72c4c11e3aff65e9bb36e5fcf75f088b140049.tar.gz
Implement SysV-style $$@ support. I looked at E.Parmelan's patch but
decided to implement this a different way, and didn't use it.
Diffstat (limited to 'tests/test_driver.pl')
-rw-r--r--tests/test_driver.pl18
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/test_driver.pl b/tests/test_driver.pl
index a7a3b9f..38ee54a 100644
--- a/tests/test_driver.pl
+++ b/tests/test_driver.pl
@@ -825,15 +825,29 @@ sub remove_directory_tree_inner
sub touch
{
- local (@filenames) = @_;
local ($file);
- foreach $file (@filenames) {
+ foreach $file (@_) {
(open(T, ">> $file") && print(T "\n") && close(T))
|| &error("Couldn't touch $file: $!\n", 1);
}
}
+# Touch with a time offset. To DTRT, call touch() then use stat() to get the
+# access/mod time for each file and apply the offset.
+
+sub utouch
+{
+ local ($off) = shift;
+ local ($file);
+
+ &touch(@_);
+
+ local (@s) = stat($_[0]);
+
+ utime($s[8]+$off, $s[9]+$off, @_);
+}
+
# open a file, write some stuff to it, and close it.
sub create_file