build/pymake/tests/subprocess-path.mk

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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

mercurial