From e07372ff5077e60136451733dab59e46f3e9132d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 25 Jul 2012 10:51:44 +0200 Subject: fix host vs. makefile directory separator mess the system path separator and shell are bound to the host system (system() will use cmd even on mingw with sh.exe in path). the makefiles otoh may depend on what the qmakespec defines. consequently, add $$system_path() and $$system_quote() (for use with system() & $$system()). $$native_path() is renamed to $$shell_path() and should be used with $$shell_quote() to produce command lines in makefiles. $$QMAKE_DIR_SEP needs to be applied to Option::dir_sep right after parsing the spec, so it is available to $$shell_{path,quote}(). Change-Id: If3db4849e7f96068cf03a32348a24f3a72d6292c Reviewed-by: Rafael Roquetto Reviewed-by: Sean Harmer --- tests/auto/tools/qmake/testdata/functions/functions.pro | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'tests/auto/tools/qmake/testdata') diff --git a/tests/auto/tools/qmake/testdata/functions/functions.pro b/tests/auto/tools/qmake/testdata/functions/functions.pro index 884113b95a..98e12b7650 100644 --- a/tests/auto/tools/qmake/testdata/functions/functions.pro +++ b/tests/auto/tools/qmake/testdata/functions/functions.pro @@ -131,7 +131,8 @@ testReplace($$format_number(13, width=5 padsign zeropad), " 0013", "zero-padded testReplace($$clean_path("c:$${DIR_SEPARATOR}crazy//path/../trolls"), "c:/crazy/trolls", "clean_path") -testReplace($$native_path("/crazy/trolls"), "$${DIR_SEPARATOR}crazy$${DIR_SEPARATOR}trolls", "native_path") +testReplace($$shell_path("/crazy/trolls"), "$${QMAKE_DIR_SEP}crazy$${QMAKE_DIR_SEP}trolls", "shell_path") +testReplace($$system_path("/crazy/trolls"), "$${DIR_SEPARATOR}crazy$${DIR_SEPARATOR}trolls", "system_path") testReplace($$absolute_path("crazy/trolls"), "$$PWD/crazy/trolls", "absolute_path") testReplace($$absolute_path("crazy/trolls", "/fake/path"), "/fake/path/crazy/trolls", "absolute_path with base") @@ -142,10 +143,17 @@ testReplace($$relative_path(""), "", "relative_path of empty") #this test is very rudimentary. the backend function is thoroughly tested in qt creator in = "some nasty\" path\\" -win32: \ - out = "\"some nasty\"\\^\"\" path\"\\" +out_cmd = "\"some nasty\"\\^\"\" path\"\\" +out_sh = "'some nasty\" path\\'" +equals(QMAKE_HOST.os, Windows): \ + out = $$out_cmd else: \ - out = "'some nasty\" path\\'" + out = $$out_sh +testReplace($$system_quote($$in), $$out, "system_quote") +!equals(QMAKE_DIR_SEP, /): \ + out = $$out_cmd +else: \ + out = $$out_sh testReplace($$shell_quote($$in), $$out, "shell_quote") testReplace($$reverse($$list(one two three)), three two one, "reverse") -- cgit v1.2.3