aboutsummaryrefslogtreecommitdiff
path: root/tests/ln_tests.mk
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ln_tests.mk')
-rw-r--r--tests/ln_tests.mk66
1 files changed, 66 insertions, 0 deletions
diff --git a/tests/ln_tests.mk b/tests/ln_tests.mk
new file mode 100644
index 000000000..5925edd4f
--- /dev/null
+++ b/tests/ln_tests.mk
@@ -0,0 +1,66 @@
1
2# GNU `ln'
3GLN = /bin/ln
4# BusyBox `ln'
5BLN = $(shell pwd)/ln
6
7.PHONY: ln_clean
8ln_clean:
9 rm -rf ln_tests ln_*.{gnu,bb} ln
10
11.PHONY: ln_tests
12ln_tests: ln_clean ln
13 @echo;
14 @echo "No output from diff means busybox ln is functioning properly.";
15
16 @echo;
17 ${BLN} || true;
18
19 @echo;
20 mkdir ln_tests;
21
22 @echo;
23 cd ln_tests; \
24 echo A file > afile; \
25 ls -l afile > ../ln_afile_newname.gnu; \
26 ${GLN} afile newname; \
27 ls -l afile newname >> ../ln_afile_newname.gnu;
28
29 @echo;
30 rm -f ln_tests/{afile,newname};
31
32 @echo;
33 cd ln_tests; \
34 echo A file > afile; \
35 ls -l afile > ../ln_afile_newname.bb; \
36 ${BLN} afile newname; \
37 ls -l afile newname >> ../ln_afile_newname.bb;
38
39 @echo;
40 diff -u ln_afile_newname.gnu ln_afile_newname.bb
41
42 @echo;
43 rm -f ln_tests/{afile,newname};
44
45 @echo;
46 cd ln_tests; \
47 echo A file > afile; \
48 ls -l afile > ../ln_s_afile_newname.gnu; \
49 ${GLN} -s afile newname; \
50 ls -l afile newname >> ../ln_s_afile_newname.gnu;
51
52 @echo;
53 rm -f ln_tests/{afile,newname};
54
55 @echo;
56 cd ln_tests; \
57 echo A file > afile; \
58 ls -l afile > ../ln_s_afile_newname.bb; \
59 ${BLN} -s afile newname; \
60 ls -l afile newname >> ../ln_s_afile_newname.bb;
61
62 @echo;
63 diff -u ln_s_afile_newname.gnu ln_s_afile_newname.bb
64
65 @echo;
66 rm -f ln_tests/{afile,newname};