changeset 33612:3b77d4787c18 stable

tests: avoid unexpected result at invocation of *.py file on Windows Invocation of "diff tool.py" in test-extdiff.t tests whether shellquote() is applied on specified command as expected. But direct invocation of "*.py" file might cause unexpected result on Windows according to suffix binding. For example, starting IDE, showing dialog to choose program to be used, and so on. In such case, running test-extdiff.t is easily timed out. This patch uses intermediate *.bat file on Windows, to avoid such unexpected result. Naming that intermediate file as "diff tool.bat" is enough to test applying shellquote().
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Tue, 01 Aug 2017 01:27:32 +0900
parents 798f7beadbc9
children 41081364addb
files tests/test-extdiff.t
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-extdiff.t	Mon Jul 31 13:16:34 2017 +0900
+++ b/tests/test-extdiff.t	Tue Aug 01 01:27:32 2017 +0900
@@ -263,8 +263,16 @@
 will change to /tmp/extdiff.TMP and populate directories a.TMP and a
 and start tool
 
+#if windows
+  $ cat > 'diff tool.bat' << EOF
+  > @$PYTHON "`pwd`/diff tool.py"
+  > EOF
+  $ hg extdiff -p "`pwd`/diff tool.bat"
+  [1]
+#else
   $ hg extdiff -p "`pwd`/diff tool.py"
   [1]
+#endif
 
 Diff in working directory, after: