comparison contrib/check-code.py @ 28035:c65da6892ae5

tests: make chunk header of external diff glob-ed for portability Before this patch, some tests using external "diff" command via extdiff extension fail on Solaris, because system standard "diff" (= /usr/bin/diff) on Solaris always formats chunk header in the style below: @@ -X.x +Y.y @@ even though "diff" on Linux sometimes omits ".x" and/or ".y" in it. This patch makes chunk header of external diff glob-ed for portability of tests, and adds check-code.py rules to detect such diff output in tests. This patch also changes "hg diff" output in test-subrepo-git to simplify detection rules, even though it is certainly portable because these lines are generated by "git" command. This patch is a part of making tests using external "diff" portable, and tests below aren't yet portable even after this patch. test-largefiles-update.t test-subrepo-deep-nested-change.t
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Mon, 08 Feb 2016 18:29:17 +0900
parents e7ff258f71df
children 7e9e39228de6
comparison
equal deleted inserted replaced
28034:e7ff258f71df 28035:c65da6892ae5
178 'use test -f to test for file existence'), 178 'use test -f to test for file existence'),
179 (r'^ diff -[^ -]*p', 179 (r'^ diff -[^ -]*p',
180 "don't use (external) diff with -p for portability"), 180 "don't use (external) diff with -p for portability"),
181 (r'^ [-+][-+][-+] .* [-+]0000 \(glob\)', 181 (r'^ [-+][-+][-+] .* [-+]0000 \(glob\)',
182 "glob timezone field in diff output for portability"), 182 "glob timezone field in diff output for portability"),
183 (r'^ @@ -[0-9]+ [+][0-9]+,[0-9]+ @@',
184 "use '@@ -N* +N,n @@ (glob)' style chunk header for portability"),
185 (r'^ @@ -[0-9]+,[0-9]+ [+][0-9]+ @@',
186 "use '@@ -N,n +N* @@ (glob)' style chunk header for portability"),
187 (r'^ @@ -[0-9]+ [+][0-9]+ @@',
188 "use '@@ -N* +N* @@ (glob)' style chunk header for portability"),
183 ], 189 ],
184 # warnings 190 # warnings
185 [ 191 [
186 (r'^ [^*?/\n]* \(glob\)$', 192 (r'^ [^*?/\n]* \(glob\)$',
187 "glob match with no glob character (?*/)"), 193 "glob match with no glob character (?*/)"),