comparison tests/test-static-http.t @ 30234:34a5f6c66bc5 stable

tests: invoke printenv.py via sh -c for test portability On Windows platform, invoking printenv.py directly via hook is problematic, because: - unless binding between *.py suffix and python runtime, application selector dialog is displayed, and running test is blocked at each printenv.py invocations - it isn't safe to assume binding between *.py suffix and python runtime, because application binding is easily broken For example, installing IDE (VisualStudio with Python Tools, or so) often requires binding between source files and IDE itself. This patch invokes printenv.py via sh -c for test portability. This is a kind of follow up for d19787db6fe0, which eliminated explicit "python" for printenv.py. There are already other 'sh -c "printenv.py"' in *.t files, and this fix should be reasonable. This changes were confirmed in cases below: - without any application binding for *.py suffix - with binding between *.py suffix and VisualStudio This patch also replaces "echo + redirection" style with "heredoc" style, because: - hook command line is parsed by cmd.exe as shell at first, and - single quotation can't quote arguments on cmd.exe, therefore, - "printenv.py foobar" should be quoted by double quotation, but - nested quoting (or tricky escaping) isn't readable
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Sat, 29 Oct 2016 02:44:45 +0900
parents 280528245ecf
children 728d37353e1e
comparison
equal deleted inserted replaced
30233:3afde791dce1 30234:34a5f6c66bc5
51 51
52 check for HTTP opener failures when cachefile does not exist 52 check for HTTP opener failures when cachefile does not exist
53 53
54 $ rm .hg/cache/* 54 $ rm .hg/cache/*
55 $ cd ../local 55 $ cd ../local
56 $ echo '[hooks]' >> .hg/hgrc 56 $ cat >> .hg/hgrc <<EOF
57 $ echo "changegroup = printenv.py changegroup" >> .hg/hgrc 57 > [hooks]
58 > changegroup = sh -c "printenv.py changegroup"
59 > EOF
58 $ hg pull 60 $ hg pull
59 pulling from static-http://localhost:$HGPORT/remote 61 pulling from static-http://localhost:$HGPORT/remote
60 searching for changes 62 searching for changes
61 adding changesets 63 adding changesets
62 adding manifests 64 adding manifests