[gtk-doc/win-no-msys: 18/22] test/helpers/*.py: Fix calling scripts on Windows




commit 57396f56ed25ddca7442b7cbcfe468942b0049e2
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 2b54c3c..73371f1 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 d3993bd..9f8ba47 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 0a0304f..bed6731 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 6641326..f5e61fc 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 7ba28d6..e46768f 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 c3546f7..5bcf4b0 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]