aboutsummaryrefslogtreecommitdiff
path: root/tests/mv_tests.mk
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mv_tests.mk')
-rw-r--r--tests/mv_tests.mk41
1 files changed, 35 insertions, 6 deletions
diff --git a/tests/mv_tests.mk b/tests/mv_tests.mk
index 3a9012538..81b8ffdec 100644
--- a/tests/mv_tests.mk
+++ b/tests/mv_tests.mk
@@ -1,14 +1,19 @@
1# mv_tests.mk - Set of tests cases for busybox mv
2# -------------
3# Copyright (C) 2000 Karl M. Hegbloom <karlheg@debian.org> GPL
4#
1 5
2# GNU `mv' 6# GNU `mv'
3GMV = /bin/mv 7GMV = /bin/mv
4# BusyBox `mv' 8# BusyBox `mv'
5BMV = $(shell pwd)/mv 9BMV = $(shell pwd)/mv
6 10
7.PHONY: mv_clean 11all:: mv_tests
12clean:: mv_clean
13
8mv_clean: 14mv_clean:
9 rm -rf mv_tests mv_*.{gnu,bb} mv 15 rm -rf mv_tests mv_*.{gnu,bb} mv
10 16
11.PHONY: mv_tests
12mv_tests: mv_clean mv 17mv_tests: mv_clean mv
13 @echo; 18 @echo;
14 @echo "No output from diff means busybox mv is functioning properly."; 19 @echo "No output from diff means busybox mv is functioning properly.";
@@ -45,7 +50,7 @@ mv_tests: mv_clean mv
45 @echo; 50 @echo;
46 rm -f mv_tests/{afile,newname}; 51 rm -f mv_tests/{afile,newname};
47 52
48 @echo; echo; 53 @echo; echo ------------------------------;
49 cd mv_tests; \ 54 cd mv_tests; \
50 echo A file > afile; \ 55 echo A file > afile; \
51 ln -s afile symlink; \ 56 ln -s afile symlink; \
@@ -72,7 +77,7 @@ mv_tests: mv_clean mv
72 @echo; 77 @echo;
73 rm -rf mv_tests/*; 78 rm -rf mv_tests/*;
74 79
75 @echo; echo; 80 @echo; echo ------------------------------;
76 cd mv_tests; \ 81 cd mv_tests; \
77 echo A file > afile; \ 82 echo A file > afile; \
78 ln -s afile symlink; \ 83 ln -s afile symlink; \
@@ -85,7 +90,7 @@ mv_tests: mv_clean mv
85 @echo; 90 @echo;
86 rm -rf mv_tests/* 91 rm -rf mv_tests/*
87 92
88 @echo; echo; 93 @echo; echo ------------------------------;
89 cd mv_tests; \ 94 cd mv_tests; \
90 echo A file > afile; \ 95 echo A file > afile; \
91 ln -s afile symlink; \ 96 ln -s afile symlink; \
@@ -101,7 +106,7 @@ mv_tests: mv_clean mv
101 @echo; 106 @echo;
102 rm -rf mv_tests/*; 107 rm -rf mv_tests/*;
103 108
104 @echo; echo; 109 @echo; echo ------------------------------;
105 cd mv_tests; \ 110 cd mv_tests; \
106 mkdir dir{a,b}; \ 111 mkdir dir{a,b}; \
107 echo A file > dira/afile; \ 112 echo A file > dira/afile; \
@@ -135,3 +140,27 @@ mv_tests: mv_clean mv
135 # false; 140 # false;
136 @echo; 141 @echo;
137 rm -rf mv_tests/dir{a,b}; 142 rm -rf mv_tests/dir{a,b};
143
144 @echo; echo ------------------------------;
145 @echo There should be an error message about cannot mv a dir to a subdir of itself.
146 cd mv_tests; \
147 touch a b c; \
148 mkdir adir; \
149 ls -lR . > ../mv_a_star_adir.gnu; \
150 ${GMV} * adir; \
151 ls -lR . >> ../mv_a_star_adir.gnu;
152
153 @echo
154 @echo There should be an error message about cannot mv a dir to a subdir of itself.
155 cd mv_tests; \
156 rm -rf adir; \
157 mkdir adir; \
158 ls -lR . > ../mv_a_star_adir.bb; \
159 ${BMV} * adir; \
160 ls -lR . >> ../mv_a_star_adir.bb;
161
162 @echo;
163 diff -u mv_a_star_adir.gnu mv_a_star_adir.bb;
164
165 @echo;
166 rm -rf mv_test/*;