@matheusbsbs / matheus-bagliano / commits / 872f349e7b
Fork 0

Skip tests that fail if the executable bit is not handled by the filesystem

Signed-off-by: Johannes Sixt <j6t@kdbg.org>

Johannes Sixt committed Feb 27, 2009 at 22:20 UTC 872f349e7b119fcef7306f5dd7e4492ee3598318
5 files changed +42 -20
t/t3701-add-interactive.sh
+5 -4
@@ -135,10 +135,12 @@ test_expect_success 'real edit works' '
135
136 if test "$(git config --bool core.filemode)" = false
137 then
138 - say 'skipping filemode tests (filesystem does not properly support modes)'
138 + say 'skipping filemode tests (filesystem does not properly support modes)'
139 else
140 + test_set_prereq FILEMODE
141 +fi
142
141 -test_expect_success 'patch does not affect mode' '
143 +test_expect_success FILEMODE 'patch does not affect mode' '
144 git reset --hard &&
145 echo content >>file &&
146 chmod +x file &&
@@ -147,7 +149,7 @@ test_expect_success 'patch does not affect mode' '
149 git diff file | grep "new mode"
150 '
151
150 -test_expect_success 'stage mode but not hunk' '
152 +test_expect_success FILEMODE 'stage mode but not hunk' '
153 git reset --hard &&
154 echo content >>file &&
155 chmod +x file &&
@@ -156,7 +158,6 @@ test_expect_success 'stage mode but not hunk' '
158 git diff file | grep "+content"
159 '
160
159 -fi
161 # end of tests disabled when filemode is not usable
162
163 test_done
t/t4102-apply-rename.sh
+5 -3
@@ -31,14 +31,16 @@ test_expect_success setup \
31 test_expect_success apply \
32 'git apply --index --stat --summary --apply test-patch'
33
34 -if [ "$(git config --get core.filemode)" = false ]
34 +if test "$(git config --bool core.filemode)" = false
35 then
36 say 'filemode disabled on the filesystem'
37 else
38 - test_expect_success validate \
39 - 'test -f bar && ls -l bar | grep "^-..x......"'
38 + test_set_prereq FILEMODE
39 fi
40
41 +test_expect_success FILEMODE validate \
42 + 'test -f bar && ls -l bar | grep "^-..x......"'
43 +
44 test_expect_success 'apply reverse' \
45 'git apply -R --index --stat --summary --apply test-patch &&
46 test "$(cat foo)" = "This is foo"'
t/t4129-apply-samemode.sh
+13 -6
@@ -4,6 +4,13 @@ test_description='applying patch with mode bits'
4
5 . ./test-lib.sh
6
7 +if test "$(git config --bool core.filemode)" = false
8 +then
9 + say 'filemode disabled on the filesystem'
10 +else
11 + test_set_prereq FILEMODE
12 +fi
13 +
14 test_expect_success setup '
15 echo original >file &&
16 git add file &&
@@ -16,14 +23,14 @@ test_expect_success setup '
23 git diff --stat -p >patch-1.txt
24 '
25
19 -test_expect_success 'same mode (no index)' '
26 +test_expect_success FILEMODE 'same mode (no index)' '
27 git reset --hard &&
28 chmod +x file &&
29 git apply patch-0.txt &&
30 test -x file
31 '
32
26 -test_expect_success 'same mode (with index)' '
33 +test_expect_success FILEMODE 'same mode (with index)' '
34 git reset --hard &&
35 chmod +x file &&
36 git add file &&
@@ -32,7 +39,7 @@ test_expect_success 'same mode (with index)' '
39 git diff --exit-code
40 '
41
35 -test_expect_success 'same mode (index only)' '
42 +test_expect_success FILEMODE 'same mode (index only)' '
43 git reset --hard &&
44 chmod +x file &&
45 git add file &&
@@ -40,20 +47,20 @@ test_expect_success 'same mode (index only)' '
47 git ls-files -s file | grep "^100755"
48 '
49
43 -test_expect_success 'mode update (no index)' '
50 +test_expect_success FILEMODE 'mode update (no index)' '
51 git reset --hard &&
52 git apply patch-1.txt &&
53 test -x file
54 '
55
49 -test_expect_success 'mode update (with index)' '
56 +test_expect_success FILEMODE 'mode update (with index)' '
57 git reset --hard &&
58 git apply --index patch-1.txt &&
59 test -x file &&
60 git diff --exit-code
61 '
62
56 -test_expect_success 'mode update (index only)' '
63 +test_expect_success FILEMODE 'mode update (index only)' '
64 git reset --hard &&
65 git apply --cached patch-1.txt &&
66 git ls-files -s file | grep "^100755"
t/t6031-merge-recursive.sh
+13
@@ -3,6 +3,11 @@
3 test_description='merge-recursive: handle file mode'
4 . ./test-lib.sh
5
6 +if ! test "$(git config --bool core.filemode)" = false
7 +then
8 + test_set_prereq FILEMODE
9 +fi
10 +
11 test_expect_success 'mode change in one branch: keep changed version' '
12 : >file1 &&
13 git add file1 &&
@@ -16,6 +21,10 @@ test_expect_success 'mode change in one branch: keep changed version' '
21 git commit -m b1 &&
22 git checkout a1 &&
23 git merge-recursive master -- a1 b1 &&
24 + git ls-files -s file1 | grep ^100755
25 +'
26 +
27 +test_expect_success FILEMODE 'verify executable bit on file' '
28 test -x file1
29 '
30
@@ -41,6 +50,10 @@ test_expect_success 'mode change in both branches: expect conflict' '
50 echo "100644 $H 3 file2"
51 ) >expect &&
52 test_cmp actual expect &&
53 + git ls-files -s file2 | grep ^100755
54 +'
55 +
56 +test_expect_success FILEMODE 'verify executable bit on file' '
57 test -x file2
58 '
59
t/t9200-git-cvsexportcommit.sh
+6 -7
@@ -225,11 +225,12 @@ test_expect_success \
225 test_must_fail git cvsexportcommit -c $id
226 )'
227
228 -case "$(git config --bool core.filemode)" in
229 -false)
230 - ;;
231 -*)
232 -test_expect_success \
228 +if ! test "$(git config --bool core.filemode)" = false
229 +then
230 + test_set_prereq FILEMODE
231 +fi
232 +
233 +test_expect_success FILEMODE \
234 'Retain execute bit' \
235 'mkdir G &&
236 echo executeon >G/on &&
@@ -243,8 +244,6 @@ test_expect_success \
244 test -x G/on &&
245 ! test -x G/off
246 )'
246 - ;;
247 -esac
247
248 test_expect_success '-w option should work with relative GIT_DIR' '
249 mkdir W &&