[gtk-doc/win-no-msys: 17/21] test/helpers/*.py: Fix calling scripts on Windows
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-doc/win-no-msys: 17/21] test/helpers/*.py: Fix calling scripts on Windows
- Date: Mon, 7 Sep 2020 09:50:05 +0000 (UTC)
commit 05aa847a92195589f17e232b2c4f448f62243f48
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Tue Apr 14 16:41:50 2020 +0800
test/helpers/*.py: Fix calling scripts on Windows
Shebang lines are not supported natively on Windows/cmd consoles, so help the
test scripts by prepending the test command lines with the current Python
interpreter on Windows.
tests/helpers/gtkdoc_check_runner.py | 7 ++++++-
tests/helpers/gtkdoc_fixxref_runner.py | 7 ++++++-
tests/helpers/gtkdoc_mkdb_runner.py | 7 ++++++-
tests/helpers/gtkdoc_mkhtml_runner.py | 7 ++++++-
tests/helpers/gtkdoc_scan_runner.py | 7 ++++++-
tests/helpers/gtkdoc_scangobj_runner.py | 7 ++++++-
6 files changed, 36 insertions(+), 6 deletions(-)
---
diff --git a/tests/helpers/gtkdoc_check_runner.py b/tests/helpers/gtkdoc_check_runner.py
index 2b54c3c2..73371f18 100644
--- a/tests/helpers/gtkdoc_check_runner.py
+++ b/tests/helpers/gtkdoc_check_runner.py
@@ -20,7 +20,12 @@ if __name__ == '__main__':
options, arguments = parser.parse_known_args()
- arguments.insert(0, os.path.join(options.binary_dir, 'gtkdoc-check'))
+ arg_pos = 0
+ if os.name == 'nt':
+ arguments.insert(arg_pos, sys.executable)
+ arg_pos += 1
+
+ arguments.insert(arg_pos, os.path.join(options.binary_dir, 'gtkdoc-check'))
environ = os.environ.copy()
diff --git a/tests/helpers/gtkdoc_fixxref_runner.py b/tests/helpers/gtkdoc_fixxref_runner.py
index d3993bd0..9f8ba474 100644
--- a/tests/helpers/gtkdoc_fixxref_runner.py
+++ b/tests/helpers/gtkdoc_fixxref_runner.py
@@ -18,7 +18,12 @@ if __name__ == '__main__':
options, arguments = parser.parse_known_args()
- arguments.insert(0, os.path.join(options.binary_dir, 'gtkdoc-fixxref'))
+ arg_pos = 0
+ if os.name == 'nt':
+ arguments.insert(arg_pos, sys.executable)
+ arg_pos += 1
+
+ arguments.insert(arg_pos, os.path.join(options.binary_dir, 'gtkdoc-fixxref'))
if options.change_dir is not None:
if not os.path.exists(options.change_dir):
diff --git a/tests/helpers/gtkdoc_mkdb_runner.py b/tests/helpers/gtkdoc_mkdb_runner.py
index 0a0304f4..bed6731e 100644
--- a/tests/helpers/gtkdoc_mkdb_runner.py
+++ b/tests/helpers/gtkdoc_mkdb_runner.py
@@ -18,7 +18,12 @@ if __name__ == '__main__':
options, arguments = parser.parse_known_args()
- arguments.insert(0, os.path.join(options.binary_dir, 'gtkdoc-mkdb'))
+ arg_pos = 0
+ if os.name == 'nt':
+ arguments.insert(arg_pos, sys.executable)
+ arg_pos += 1
+
+ arguments.insert(arg_pos, os.path.join(options.binary_dir, 'gtkdoc-mkdb'))
if options.change_dir is not None:
if not os.path.exists(options.change_dir):
diff --git a/tests/helpers/gtkdoc_mkhtml_runner.py b/tests/helpers/gtkdoc_mkhtml_runner.py
index 6641326a..f5e61fcd 100644
--- a/tests/helpers/gtkdoc_mkhtml_runner.py
+++ b/tests/helpers/gtkdoc_mkhtml_runner.py
@@ -21,7 +21,12 @@ if __name__ == '__main__':
options, arguments = parser.parse_known_args()
- arguments.insert(0, os.path.join(options.binary_dir, 'gtkdoc-mkhtml'))
+ arg_pos = 0
+ if os.name == 'nt':
+ arguments.insert(arg_pos, sys.executable)
+ arg_pos += 1
+
+ arguments.insert(arg_pos, os.path.join(options.binary_dir, 'gtkdoc-mkhtml'))
if options.change_dir is not None:
if not os.path.exists(options.change_dir):
diff --git a/tests/helpers/gtkdoc_scan_runner.py b/tests/helpers/gtkdoc_scan_runner.py
index 7ba28d68..e46768f6 100644
--- a/tests/helpers/gtkdoc_scan_runner.py
+++ b/tests/helpers/gtkdoc_scan_runner.py
@@ -18,7 +18,12 @@ if __name__ == '__main__':
options, arguments = parser.parse_known_args()
- arguments.insert(0, os.path.join(options.binary_dir, 'gtkdoc-scan'))
+ arg_pos = 0
+ if os.name == 'nt':
+ arguments.insert(arg_pos, sys.executable)
+ arg_pos += 1
+
+ arguments.insert(arg_pos, os.path.join(options.binary_dir, 'gtkdoc-scan'))
if options.change_dir is not None:
if not os.path.exists(options.change_dir):
diff --git a/tests/helpers/gtkdoc_scangobj_runner.py b/tests/helpers/gtkdoc_scangobj_runner.py
index c3546f7d..5bcf4b0f 100644
--- a/tests/helpers/gtkdoc_scangobj_runner.py
+++ b/tests/helpers/gtkdoc_scangobj_runner.py
@@ -24,7 +24,12 @@ if __name__ == '__main__':
options, arguments = parser.parse_known_args()
- arguments.insert(0, os.path.join(options.binary_dir, 'gtkdoc-scangobj'))
+ arg_pos = 0
+ if os.name == 'nt':
+ arguments.insert(arg_pos, sys.executable)
+ arg_pos += 1
+
+ arguments.insert(arg_pos, os.path.join(options.binary_dir, 'gtkdoc-scangobj'))
process = Popen([options.pkg_config,
'--cflags'] + options.extra_pkg,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]