Skip to content

Commit

Permalink
Properly quote or adjust paths to python on toolset mock tests to all…
Browse files Browse the repository at this point in the history
…ow for spaces in the python exec path.
  • Loading branch information
grafikrobot committed Nov 13, 2024
1 parent 22d5f85 commit 936cf31
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions test/MockToolset.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def adjust_path(p):
import common ;
import type ;
.python-cmd = "\"%s\"" ;
.python-cmd = "%s" ;
# Behave the same as gcc on Windows, because that's what
# the test system expects
Expand All @@ -206,7 +206,7 @@ def adjust_path(p):
{
local here = [ path.make [ modules.binding $(__name__) ] ] ;
here = [ path.native [ path.root [ path.parent $(here) ] [ path.pwd ] ] ] ;
.config-cmd = [ common.variable-setting-command JAM_CWD : $(here) ] $(.python-cmd) -B ;
.config-cmd = [ common.variable-setting-command JAM_CWD : $(here) ] "\\"$(.python-cmd:J= )\\"" -B ;
}
feature.extend toolset : mock ;
Expand Down Expand Up @@ -253,7 +253,7 @@ def adjust_path(p):
$(.config-cmd) mock.py --dll "$(>)" -o "$(<)" $(USER_OPTIONS) -L"$(LINK_PATH)" --static-lib=$(FINDLIBS-STATIC) --shared-lib=$(FINDLIBS-SHARED)
}
''' % sys.executable.replace('\\', '\\\\'))
''' % sys.executable.replace('\\', '/'))

def set_expected(t, markup):
verbose = "True" if t.verbose else "False"
Expand Down
2 changes: 1 addition & 1 deletion test/core_jamshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
DEPENDS all : test-raw test-raw-fail test-py ;
""")

t.run_build_system(["-ffile.jam", "-d1", "-sPYTHON=" + sys.executable], status=1)
t.run_build_system(["-ffile.jam", "-d1", '-sPYTHON="' + sys.executable + '"'], status=1)
t.expect_output_lines([
"...failed run test-raw-fail...",
"0,1,2",
Expand Down
4 changes: 2 additions & 2 deletions test/toolset-mock/project-config.jam
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ using intel-darwin : 10.2 : $(PYTHON) $(here)/src/intel-darwin-10.2.py : $(ar)
# TODO: msvc toolset should not require this env variable to be presented
modules.poke .ENVIRON : PROCESSOR_ARCHITEW6432 : amd64 ;
using msvc : 14.3 : :
"<compiler>$(PYTHON) $(here)/src/msvc-14.3.py"
"<linker>$(PYTHON) $(here)/src/linkx.py"
<compiler>\"$(PYTHON)\"\ \"$(here)/src/msvc-14.3.py\"
<linker>\"$(PYTHON)\"\ \"$(here)/src/linkx.py\"
;

0 comments on commit 936cf31

Please sign in to comment.