1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/build/pymake/tests/subprocess-path.mk Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,32 @@ 1.4 +#T gmake skip 1.5 +#T grep-for: "2f7cdd0b-7277-48c1-beaf-56cb0dbacb24" 1.6 + 1.7 +ifdef __WIN32__ 1.8 +PS:=; 1.9 +else 1.10 +PS:=: 1.11 +endif 1.12 + 1.13 +export PATH := $(TESTPATH)/pathdir$(PS)$(PATH) 1.14 + 1.15 +# Test two commands. The first one shouldn't go through the shell and the 1.16 +# second one should. The pathdir subdirectory has a Windows executable called 1.17 +# pathtest.exe and a shell script called pathtest. We don't care which one is 1.18 +# run, just that one of the two is (we use a uuid + grep-for to make sure 1.19 +# that happens). 1.20 +# 1.21 +# FAQ: 1.22 +# Q. Why skip GNU Make? 1.23 +# A. Because $(TESTPATH) is a Windows-style path, and MSYS make doesn't take 1.24 +# too kindly to Windows paths in the PATH environment variable. 1.25 +# 1.26 +# Q. Why use an exe and not a batch file? 1.27 +# A. The use cases here were all exe files without the extension. Batch file 1.28 +# lookup has broken semantics if the .bat extension isn't passed. 1.29 +# 1.30 +# Q. Why are the commands silent? 1.31 +# A. So that we don't pass the grep-for test by mistake. 1.32 +all: 1.33 + @pathtest 1.34 + @pathtest | grep -q 2f7cdd0b-7277-48c1-beaf-56cb0dbacb24 1.35 + @echo TEST-PASS