build/pymake/tests/subprocess-path.mk

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 #T gmake skip
michael@0 2 #T grep-for: "2f7cdd0b-7277-48c1-beaf-56cb0dbacb24"
michael@0 3
michael@0 4 ifdef __WIN32__
michael@0 5 PS:=;
michael@0 6 else
michael@0 7 PS:=:
michael@0 8 endif
michael@0 9
michael@0 10 export PATH := $(TESTPATH)/pathdir$(PS)$(PATH)
michael@0 11
michael@0 12 # Test two commands. The first one shouldn't go through the shell and the
michael@0 13 # second one should. The pathdir subdirectory has a Windows executable called
michael@0 14 # pathtest.exe and a shell script called pathtest. We don't care which one is
michael@0 15 # run, just that one of the two is (we use a uuid + grep-for to make sure
michael@0 16 # that happens).
michael@0 17 #
michael@0 18 # FAQ:
michael@0 19 # Q. Why skip GNU Make?
michael@0 20 # A. Because $(TESTPATH) is a Windows-style path, and MSYS make doesn't take
michael@0 21 # too kindly to Windows paths in the PATH environment variable.
michael@0 22 #
michael@0 23 # Q. Why use an exe and not a batch file?
michael@0 24 # A. The use cases here were all exe files without the extension. Batch file
michael@0 25 # lookup has broken semantics if the .bat extension isn't passed.
michael@0 26 #
michael@0 27 # Q. Why are the commands silent?
michael@0 28 # A. So that we don't pass the grep-for test by mistake.
michael@0 29 all:
michael@0 30 @pathtest
michael@0 31 @pathtest | grep -q 2f7cdd0b-7277-48c1-beaf-56cb0dbacb24
michael@0 32 @echo TEST-PASS

mercurial