diff options
author | Jake Petroules <jake.petroules@qt.io> | 2017-07-19 22:02:59 -0700 |
---|---|---|
committer | Jake Petroules <jake.petroules@qt.io> | 2017-07-20 18:04:58 +0000 |
commit | a5d801e02c284da024ee91f8b1a122f490db7f75 (patch) | |
tree | 93e439cbfbd379ffd8adc886d6fe6c2950acb203 | |
parent | 004a7856c9156f907bded83f5986f645f6c934ab (diff) |
Avoid hardcoded paths to the Windows system drive/root and shell path
Change-Id: Ib85025466b885734a607294245c63d7e361cc20b
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r-- | share/qbs/modules/qnx/qnx.qbs | 2 | ||||
-rw-r--r-- | tests/auto/api/testdata/codegen/codegen.qbs | 4 | ||||
-rw-r--r-- | tests/auto/blackbox/testdata/jsextensions-process/process.qbs | 4 | ||||
-rw-r--r-- | tests/manual/configure/modules/definition/module.qbs | 2 |
4 files changed, 7 insertions, 5 deletions
diff --git a/share/qbs/modules/qnx/qnx.qbs b/share/qbs/modules/qnx/qnx.qbs index 8eb952290..49ebc36b6 100644 --- a/share/qbs/modules/qnx/qnx.qbs +++ b/share/qbs/modules/qnx/qnx.qbs @@ -41,7 +41,7 @@ Module { id: qnxSdkProbe names: ["qnx700", "qnx660", "qnx650"] pathPrefixes: qbs.hostOS.contains("windows") - ? [Environment.getEnv("USERPROFILE"), "C:/"] + ? [Environment.getEnv("USERPROFILE"), Environment.getEnv("SystemDrive")] : [Environment.getEnv("HOME"), "/opt"] } diff --git a/tests/auto/api/testdata/codegen/codegen.qbs b/tests/auto/api/testdata/codegen/codegen.qbs index 282ee4a7f..8314a4132 100644 --- a/tests/auto/api/testdata/codegen/codegen.qbs +++ b/tests/auto/api/testdata/codegen/codegen.qbs @@ -58,12 +58,12 @@ Project { var args = ['echo ' + code + '>' + output.filePath] var cmd if (product.moduleProperty("qbs", "hostOS").contains('windows')) { - cmd = new Command('cmd.exe', ['/C'].concat(args)); + cmd = new Command(product.qbs.windowsShellPath, ['/C'].concat(args)); } else { args[0] = args[0].replace(/\(/g, '\\(') args[0] = args[0].replace(/\)/g, '\\)') args[0] = args[0].replace(/;/g, '\\;') - cmd = new Command('/bin/sh', ['-c'].concat(args)) + cmd = new Command(product.qbs.shellPath, ['-c'].concat(args)) } cmd.description = 'generate\t' + FileInfo.fileName(output.filePath); cmd.highlight = 'codegen'; diff --git a/tests/auto/blackbox/testdata/jsextensions-process/process.qbs b/tests/auto/blackbox/testdata/jsextensions-process/process.qbs index dc8c8c669..c9c832ba4 100644 --- a/tests/auto/blackbox/testdata/jsextensions-process/process.qbs +++ b/tests/auto/blackbox/testdata/jsextensions-process/process.qbs @@ -1,4 +1,5 @@ import qbs +import qbs.Environment import qbs.FileInfo import qbs.Process import qbs.TextFile @@ -52,7 +53,8 @@ Project { // closeWriteChannel test process = new Process(); if (product.qbs.hostOS.contains("windows")) - process.start("cmd", ["/C", "c:\\windows\\system32\\sort.exe"]); + process.start(product.qbs.windowsShellPath, + ["/C", product.qbs.windowsSystemRoot + "\\system32\\sort.exe"]); else process.start("cat", []); process.writeLine("should be"); diff --git a/tests/manual/configure/modules/definition/module.qbs b/tests/manual/configure/modules/definition/module.qbs index 3e3509e20..60f442149 100644 --- a/tests/manual/configure/modules/definition/module.qbs +++ b/tests/manual/configure/modules/definition/module.qbs @@ -11,7 +11,7 @@ Module { var cmd; var args; if (qbs.targetOS.contains("windows")) { - cmd = "cmd"; + cmd = qbs.windowsShellPath; args = ["/c", "date", "/t"]; } else { cmd = 'date'; |