summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorDenys Vlasenko2009-07-18 03:41:29 +0200
committerDenys Vlasenko2009-07-18 03:41:29 +0200
commit7aca89a7a32a1e560c447952c28a8b1e7fb775fc (patch)
treeb988939ee5fc2cf2235847d5f04ba5887b185e05 /testsuite
parent73b71f381d24218cf6368364be723a7b5c9aeda9 (diff)
downloadbusybox-7aca89a7a32a1e560c447952c28a8b1e7fb775fc.zip
busybox-7aca89a7a32a1e560c447952c28a8b1e7fb775fc.tar.gz
touch: implement -d --date (our own testsuite needs that)
function old new delta static.uname_longopts - 137 +137 touch_main 231 360 +129 static.touch_longopts - 32 +32 validate_tm_time - 28 +28 packed_usage 26616 26624 +8 date_main 687 686 -1 static.longopts 162 - -162 ------------------------------------------------------------------------------ (add/remove: 3/1 grow/shrink: 2/1 up/down: 334/-163) Total: 171 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/bunzip2.tests4
-rwxr-xr-xtestsuite/bzcat.tests4
-rw-r--r--testsuite/cp/cp-a-files-to-dir2
-rw-r--r--testsuite/mv/mv-files-to-dir2
-rw-r--r--testsuite/mv/mv-refuses-mv-dir-to-subdir2
-rwxr-xr-xtestsuite/runtest11
6 files changed, 15 insertions, 10 deletions
diff --git a/testsuite/bunzip2.tests b/testsuite/bunzip2.tests
index a7555ac..7875cd1 100755
--- a/testsuite/bunzip2.tests
+++ b/testsuite/bunzip2.tests
@@ -517,8 +517,8 @@ if test "${0##*/}" = "bunzip2.tests"; then
if test1_bz2 | ${bb}bunzip2 >/dev/null \
&& test "`test1_bz2 | ${bb}bunzip2 | md5sum`" = "61bbeee4be9c6f110a71447f584fda7b -"
then
- echo "$unpack: test bz2 file: PASS"
+ echo "PASS: $unpack: test bz2 file"
else
- echo "$unpack: test bz2 file: FAIL"
+ echo "FAIL: $unpack: test bz2 file"
fi
fi
diff --git a/testsuite/bzcat.tests b/testsuite/bzcat.tests
index 0bc7442..78d74f2 100755
--- a/testsuite/bzcat.tests
+++ b/testsuite/bzcat.tests
@@ -32,9 +32,9 @@ prep() {
check() {
eval $2 >t_actual 2>&1
if $ECHO -ne "$expected" | cmp - t_actual; then
- echo "$1: PASS"
+ echo "PASS: $1"
else
- echo "$1: FAIL"
+ echo "FAIL: $1"
fi
}
diff --git a/testsuite/cp/cp-a-files-to-dir b/testsuite/cp/cp-a-files-to-dir
index abdbdf7..b199ef9 100644
--- a/testsuite/cp/cp-a-files-to-dir
+++ b/testsuite/cp/cp-a-files-to-dir
@@ -3,7 +3,7 @@ echo file number two > file2
ln -s file2 link1
mkdir dir1
# why???
-#touch --date='Sat Jan 29 21:24:08 PST 2000' dir1/file3
+#TZ=UTC0 touch -d '2000-01-30 05:24:08' dir1/file3
mkdir there
busybox cp -a file1 file2 link1 dir1 there
test -f there/file1
diff --git a/testsuite/mv/mv-files-to-dir b/testsuite/mv/mv-files-to-dir
index c8eaba8..2b567f7 100644
--- a/testsuite/mv/mv-files-to-dir
+++ b/testsuite/mv/mv-files-to-dir
@@ -2,7 +2,7 @@ echo file number one > file1
echo file number two > file2
ln -s file2 link1
mkdir dir1
-touch --date='Sat Jan 29 21:24:08 PST 2000' dir1/file3
+TZ=UTC0 touch -d '2000-01-30 05:24:08' dir1/file3
mkdir there
busybox mv file1 file2 link1 dir1 there
test -f there/file1
diff --git a/testsuite/mv/mv-refuses-mv-dir-to-subdir b/testsuite/mv/mv-refuses-mv-dir-to-subdir
index 7c572c4..3bad131 100644
--- a/testsuite/mv/mv-refuses-mv-dir-to-subdir
+++ b/testsuite/mv/mv-refuses-mv-dir-to-subdir
@@ -2,7 +2,7 @@ echo file number one > file1
echo file number two > file2
ln -s file2 link1
mkdir dir1
-touch --date='Sat Jan 29 21:24:08 PST 2000' dir1/file3
+TZ=UTC0 touch -d '2000-01-30 05:24:08' dir1/file3
mkdir there
busybox mv file1 file2 link1 dir1 there
test -f there/file1
diff --git a/testsuite/runtest b/testsuite/runtest
index 2d60591..5560f7b 100755
--- a/testsuite/runtest
+++ b/testsuite/runtest
@@ -120,12 +120,17 @@ fi
# Populate a directory with links to all busybox applets
-# Note: if $LINKSDIR/applet exists, we do not overwrite it.
-# Useful if one wants to run tests against a standard utility, not an applet.
LINKSDIR="$bindir/runtest-tempdir-links"
-#rm -rf "$LINKSDIR" 2>/dev/null
+
+# Comment this line out if you have put a different binary in $LINKSDIR
+# (say, a "standard" tool's binary) in order to run tests against it:
+rm -rf "$LINKSDIR" 2>/dev/null
+
mkdir "$LINKSDIR" 2>/dev/null
for i in $implemented; do
+ # Note: if $LINKSDIR/applet exists, we do not overwrite it.
+ # Useful if one wants to run tests against a standard utility,
+ # not an applet.
ln -s "$bindir/busybox" "$LINKSDIR/$i" 2>/dev/null
done