summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-01-18 23:19:47 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2017-01-23 21:02:04 +0200
commit0a2daf84eb68526f0d689488230a8d63cf47836d (patch)
tree6ed79e14925883007aaa04459c49fc45c57d0ce7
parentfa0382f1f9d5677c1cbfb2dcec45c6d68702a261 (diff)
downloadmeson-0a2daf84eb68526f0d689488230a8d63cf47836d.tar.gz
No longer require a binary called python3 on Windows. The default name is "python".
-rw-r--r--.appveyor.yml3
-rwxr-xr-xrun_project_tests.py2
-rwxr-xr-xtest cases/common/103 manygen/subdir/manygen.py4
-rw-r--r--test cases/common/105 find program path/meson.build7
-rw-r--r--test cases/common/105 find program path/program.py2
-rw-r--r--test cases/common/107 postconf/postconf.py2
-rw-r--r--test cases/common/108 postconf with args/postconf.py2
-rwxr-xr-xtest cases/common/113 generatorcustom/catter.py2
-rwxr-xr-xtest cases/common/113 generatorcustom/gen.py2
-rw-r--r--test cases/common/117 custom target capture/meson.build7
-rwxr-xr-xtest cases/common/118 allgenerate/converter.py2
-rw-r--r--test cases/common/131 custom target directory install/docgen.py2
-rwxr-xr-xtest cases/common/133 configure file in generator/src/gen.py2
-rwxr-xr-xtest cases/common/16 configure file/generator.py6
-rw-r--r--test cases/common/16 configure file/meson.build5
-rwxr-xr-xtest cases/common/48 test args/tester.py2
-rwxr-xr-xtest cases/common/56 custom target/depfile/dep.py2
-rw-r--r--test cases/common/56 custom target/meson.build5
-rw-r--r--test cases/common/57 custom target chain/meson.build7
-rwxr-xr-xtest cases/common/57 custom target chain/my_compiler.py2
-rwxr-xr-xtest cases/common/57 custom target chain/my_compiler2.py2
-rwxr-xr-xtest cases/common/57 custom target chain/usetarget/subcomp.py2
-rw-r--r--test cases/common/58 run target/converter.py2
-rwxr-xr-xtest cases/common/58 run target/fakeburner.py4
-rw-r--r--test cases/common/58 run target/meson.build6
-rw-r--r--test cases/common/59 object generator/meson.build5
-rwxr-xr-xtest cases/common/61 custom target source output/generator.py2
-rw-r--r--test cases/common/64 custom header generator/makeheader.py2
-rwxr-xr-xtest cases/common/65 multiple generators/mygen.py2
-rwxr-xr-xtest cases/common/72 build always/version_gen.py2
-rw-r--r--test cases/common/76 configure file in custom target/src/mycompiler.py2
-rwxr-xr-xtest cases/common/77 external test program/mytest.py4
-rwxr-xr-xtest cases/common/78 ctarget dependency/gen1.py2
-rwxr-xr-xtest cases/common/78 ctarget dependency/gen2.py2
-rwxr-xr-xtest cases/common/93 private include/stlib/compiler.py2
-rwxr-xr-xtest cases/common/98 gen extra/srcgen.py2
36 files changed, 72 insertions, 39 deletions
diff --git a/.appveyor.yml b/.appveyor.yml
index adc13b870..ce56a120b 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -41,7 +41,6 @@ install:
- ps: (new-object net.webclient).DownloadFile('https://dl.dropboxusercontent.com/u/37517477/ninja.exe', 'C:\projects\meson\ninja.exe')
- cmd: if %arch%==x86 (set MESON_PYTHON_PATH=C:\python34) else (set MESON_PYTHON_PATH=C:\python34-x64)
- cmd: echo Using Python at %MESON_PYTHON_PATH%
- - cmd: copy %MESON_PYTHON_PATH%\python.exe %MESON_PYTHON_PATH%\python3.exe
- cmd: if %compiler%==msvc2010 ( call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" %arch% )
- cmd: if %compiler%==msvc2015 ( call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %arch% )
@@ -51,7 +50,7 @@ build_script:
test_script:
- cmd: echo Running tests for %arch% and %compiler% with the %backend% backend
- - cmd: PATH=%cd%;%MESON_PYTHON_PATH%;%PATH%; && python3 run_tests.py --backend=%backend%
+ - cmd: PATH=%cd%;%MESON_PYTHON_PATH%;%PATH%; && python run_tests.py --backend=%backend%
on_finish:
- appveyor PushArtifact meson-test-run.txt -DeploymentName "Text test logs"
diff --git a/run_project_tests.py b/run_project_tests.py
index 4715dbb5e..e04fed112 100755
--- a/run_project_tests.py
+++ b/run_project_tests.py
@@ -105,6 +105,8 @@ def setup_commands(backend):
global backend_flags, compile_commands, test_commands, install_commands, clean_commands
msbuild_exe = shutil.which('msbuild')
if (backend and backend.startswith('vs')) or (backend is None and msbuild_exe is not None):
+ if backend is None:
+ backend = 'vs2010'
backend_flags = ['--backend=' + backend]
compile_commands = ['msbuild']
test_commands = ['msbuild', 'RUN_TESTS.vcxproj']
diff --git a/test cases/common/103 manygen/subdir/manygen.py b/test cases/common/103 manygen/subdir/manygen.py
index 8e74bcdc3..7ffd435b2 100755
--- a/test cases/common/103 manygen/subdir/manygen.py
+++ b/test cases/common/103 manygen/subdir/manygen.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
+
+from __future__ import print_function
# Generates a static library, object file, source
# file and a header file.
diff --git a/test cases/common/105 find program path/meson.build b/test cases/common/105 find program path/meson.build
index 2ece2bc03..ba6030b7a 100644
--- a/test cases/common/105 find program path/meson.build
+++ b/test cases/common/105 find program path/meson.build
@@ -2,8 +2,9 @@ project('find program', 'c')
prog = find_program('program.py')
-# Python 3 is guaranteed to be available because Meson
-# is implemented in it.
-python = find_program('python3')
+python = find_program('python3', required : false)
+if not python.found()
+ python = find_program('python')
+endif
run_command(python, prog.path())
diff --git a/test cases/common/105 find program path/program.py b/test cases/common/105 find program path/program.py
index 2ebc56419..b91071862 100644
--- a/test cases/common/105 find program path/program.py
+++ b/test cases/common/105 find program path/program.py
@@ -1,3 +1,3 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
print("Found")
diff --git a/test cases/common/107 postconf/postconf.py b/test cases/common/107 postconf/postconf.py
index 950c7064a..9a23cfaf2 100644
--- a/test cases/common/107 postconf/postconf.py
+++ b/test cases/common/107 postconf/postconf.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
import os
diff --git a/test cases/common/108 postconf with args/postconf.py b/test cases/common/108 postconf with args/postconf.py
index cef7f790f..3ed0450cc 100644
--- a/test cases/common/108 postconf with args/postconf.py
+++ b/test cases/common/108 postconf with args/postconf.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
import sys, os
diff --git a/test cases/common/113 generatorcustom/catter.py b/test cases/common/113 generatorcustom/catter.py
index 198fa98e2..a79b7395a 100755
--- a/test cases/common/113 generatorcustom/catter.py
+++ b/test cases/common/113 generatorcustom/catter.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
import sys
diff --git a/test cases/common/113 generatorcustom/gen.py b/test cases/common/113 generatorcustom/gen.py
index c1e34ed6c..f9efb477d 100755
--- a/test cases/common/113 generatorcustom/gen.py
+++ b/test cases/common/113 generatorcustom/gen.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
import sys
diff --git a/test cases/common/117 custom target capture/meson.build b/test cases/common/117 custom target capture/meson.build
index fa59d5152..d3214e816 100644
--- a/test cases/common/117 custom target capture/meson.build
+++ b/test cases/common/117 custom target capture/meson.build
@@ -1,6 +1,9 @@
project('custom target', 'c')
-python = find_program('python3')
+python3 = find_program('python3', required : false)
+if not python3.found()
+ python3 = find_program('python')
+endif
# Note that this will not add a dependency to the compiler executable.
# Code will not be rebuilt if it changes.
@@ -10,7 +13,7 @@ mytarget = custom_target('bindat',
output : 'data.dat',
input : 'data_source.txt',
capture : true,
- command : [python, comp, '@INPUT@'],
+ command : [python3, comp, '@INPUT@'],
install : true,
install_dir : 'subdir'
)
diff --git a/test cases/common/118 allgenerate/converter.py b/test cases/common/118 allgenerate/converter.py
index f8e2ca05a..cc2c5749b 100755
--- a/test cases/common/118 allgenerate/converter.py
+++ b/test cases/common/118 allgenerate/converter.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
import sys
diff --git a/test cases/common/131 custom target directory install/docgen.py b/test cases/common/131 custom target directory install/docgen.py
index 245f37035..4d80124de 100644
--- a/test cases/common/131 custom target directory install/docgen.py
+++ b/test cases/common/131 custom target directory install/docgen.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
import os
import sys
diff --git a/test cases/common/133 configure file in generator/src/gen.py b/test cases/common/133 configure file in generator/src/gen.py
index 99b7cddb9..5bccece12 100755
--- a/test cases/common/133 configure file in generator/src/gen.py
+++ b/test cases/common/133 configure file in generator/src/gen.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
import sys
diff --git a/test cases/common/16 configure file/generator.py b/test cases/common/16 configure file/generator.py
index 31a69448a..2c7f2f845 100755
--- a/test cases/common/16 configure file/generator.py
+++ b/test cases/common/16 configure file/generator.py
@@ -1,5 +1,9 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
+# On some platforms "python" points to Python 2
+# on others to Python 3. Work with both.
+
+from __future__ import print_function
import sys, os
if len(sys.argv) != 3:
diff --git a/test cases/common/16 configure file/meson.build b/test cases/common/16 configure file/meson.build
index 0c5b98158..b764c5ade 100644
--- a/test cases/common/16 configure file/meson.build
+++ b/test cases/common/16 configure file/meson.build
@@ -23,7 +23,10 @@ cfile)
test('inctest', e)
# Now generate a header file with an external script.
-genprog = find_program('python3')
+genprog = find_program('python3', required : false)
+if not genprog.found()
+ genprog = find_program('python')
+endif
scriptfile = '@0@/generator.py'.format(meson.current_source_dir())
ifile = '@0@/dummy.dat'.format(meson.current_source_dir())
ofile = '@0@/config2.h'.format(meson.current_build_dir())
diff --git a/test cases/common/48 test args/tester.py b/test cases/common/48 test args/tester.py
index 0b4010ab9..c3c1edce7 100755
--- a/test cases/common/48 test args/tester.py
+++ b/test cases/common/48 test args/tester.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
import sys
diff --git a/test cases/common/56 custom target/depfile/dep.py b/test cases/common/56 custom target/depfile/dep.py
index 585e1927c..aff325b6c 100755
--- a/test cases/common/56 custom target/depfile/dep.py
+++ b/test cases/common/56 custom target/depfile/dep.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
import sys, os
from glob import glob
diff --git a/test cases/common/56 custom target/meson.build b/test cases/common/56 custom target/meson.build
index feaa76269..fd59fbd80 100644
--- a/test cases/common/56 custom target/meson.build
+++ b/test cases/common/56 custom target/meson.build
@@ -1,6 +1,9 @@
project('custom target', 'c')
-python = find_program('python3')
+python = find_program('python3', required : false)
+if not python.found()
+ python = find_program('python')
+endif
# Note that this will not add a dependency to the compiler executable.
# Code will not be rebuilt if it changes.
diff --git a/test cases/common/57 custom target chain/meson.build b/test cases/common/57 custom target chain/meson.build
index 1af042589..138f795bd 100644
--- a/test cases/common/57 custom target chain/meson.build
+++ b/test cases/common/57 custom target chain/meson.build
@@ -1,7 +1,12 @@
project('custom target', 'c')
-python = find_program('python3')
+python = find_program('python3', required : false)
+if not python.found()
+ python = find_program('python')
+endif
+# files() is the correct way to do this, but some people
+# do this so test that it works.
comp = '@0@/@1@'.format(meson.current_source_dir(), 'my_compiler.py')
comp2 = '@0@/@1@'.format(meson.current_source_dir(), 'my_compiler2.py')
infile = files('data_source.txt')[0]
diff --git a/test cases/common/57 custom target chain/my_compiler.py b/test cases/common/57 custom target chain/my_compiler.py
index d99029bcc..9cf4425f8 100755
--- a/test cases/common/57 custom target chain/my_compiler.py
+++ b/test cases/common/57 custom target chain/my_compiler.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
import sys
diff --git a/test cases/common/57 custom target chain/my_compiler2.py b/test cases/common/57 custom target chain/my_compiler2.py
index 22ec7897b..0191f3faf 100755
--- a/test cases/common/57 custom target chain/my_compiler2.py
+++ b/test cases/common/57 custom target chain/my_compiler2.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
import sys
diff --git a/test cases/common/57 custom target chain/usetarget/subcomp.py b/test cases/common/57 custom target chain/usetarget/subcomp.py
index 52dc0bbb5..b5f6eb009 100755
--- a/test cases/common/57 custom target chain/usetarget/subcomp.py
+++ b/test cases/common/57 custom target chain/usetarget/subcomp.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
import sys
diff --git a/test cases/common/58 run target/converter.py b/test cases/common/58 run target/converter.py
index 8dd31fe2f..9f47ba552 100644
--- a/test cases/common/58 run target/converter.py
+++ b/test cases/common/58 run target/converter.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
import sys
diff --git a/test cases/common/58 run target/fakeburner.py b/test cases/common/58 run target/fakeburner.py
index 57280024a..7f505d6bd 100755
--- a/test cases/common/58 run target/fakeburner.py
+++ b/test cases/common/58 run target/fakeburner.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
+
+from __future__ import print_function
import sys
diff --git a/test cases/common/58 run target/meson.build b/test cases/common/58 run target/meson.build
index 0540b8082..8a06490b5 100644
--- a/test cases/common/58 run target/meson.build
+++ b/test cases/common/58 run target/meson.build
@@ -31,7 +31,11 @@ run_target('upload2',
depends : hex,
)
-python3 = find_program('python3')
+python3 = find_program('python3', required : false)
+if not python3.found()
+ python3 = find_program('python')
+endif
+
run_target('py3hi',
command : [python3, '-c', 'print("I am Python3.")'])
diff --git a/test cases/common/59 object generator/meson.build b/test cases/common/59 object generator/meson.build
index 0bdefb8cb..e20da6f46 100644
--- a/test cases/common/59 object generator/meson.build
+++ b/test cases/common/59 object generator/meson.build
@@ -1,6 +1,9 @@
project('object generator', 'c')
-python = find_program('python3')
+python = find_program('python3', required : false)
+if not python.found()
+ python = find_program('python')
+endif
# Note that this will not add a dependency to the compiler executable.
# Code will not be rebuilt if it changes.
diff --git a/test cases/common/61 custom target source output/generator.py b/test cases/common/61 custom target source output/generator.py
index 3464b0a85..42532ca5d 100755
--- a/test cases/common/61 custom target source output/generator.py
+++ b/test cases/common/61 custom target source output/generator.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
import sys, os
diff --git a/test cases/common/64 custom header generator/makeheader.py b/test cases/common/64 custom header generator/makeheader.py
index f15683447..0c5a228bf 100644
--- a/test cases/common/64 custom header generator/makeheader.py
+++ b/test cases/common/64 custom header generator/makeheader.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
# NOTE: this file does not have the executable bit set. This tests that
# Meson can automatically parse shebang lines.
diff --git a/test cases/common/65 multiple generators/mygen.py b/test cases/common/65 multiple generators/mygen.py
index 99dc33136..020a38906 100755
--- a/test cases/common/65 multiple generators/mygen.py
+++ b/test cases/common/65 multiple generators/mygen.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
import sys, os
diff --git a/test cases/common/72 build always/version_gen.py b/test cases/common/72 build always/version_gen.py
index d7b01ca1a..3973e6128 100755
--- a/test cases/common/72 build always/version_gen.py
+++ b/test cases/common/72 build always/version_gen.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
import sys, os, subprocess
diff --git a/test cases/common/76 configure file in custom target/src/mycompiler.py b/test cases/common/76 configure file in custom target/src/mycompiler.py
index b00c862db..e1750f8d9 100644
--- a/test cases/common/76 configure file in custom target/src/mycompiler.py
+++ b/test cases/common/76 configure file in custom target/src/mycompiler.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
import sys
diff --git a/test cases/common/77 external test program/mytest.py b/test cases/common/77 external test program/mytest.py
index 03d88b81e..7cdaf09a2 100755
--- a/test cases/common/77 external test program/mytest.py
+++ b/test cases/common/77 external test program/mytest.py
@@ -1,4 +1,6 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
+
+from __future__ import print_function
import sys
diff --git a/test cases/common/78 ctarget dependency/gen1.py b/test cases/common/78 ctarget dependency/gen1.py
index 0fa6ea1eb..f920e538e 100755
--- a/test cases/common/78 ctarget dependency/gen1.py
+++ b/test cases/common/78 ctarget dependency/gen1.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
import time, sys
diff --git a/test cases/common/78 ctarget dependency/gen2.py b/test cases/common/78 ctarget dependency/gen2.py
index b087b02cc..fc60e1eb2 100755
--- a/test cases/common/78 ctarget dependency/gen2.py
+++ b/test cases/common/78 ctarget dependency/gen2.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
import sys, os
from glob import glob
diff --git a/test cases/common/93 private include/stlib/compiler.py b/test cases/common/93 private include/stlib/compiler.py
index 98dbe46fa..0555c1675 100755
--- a/test cases/common/93 private include/stlib/compiler.py
+++ b/test cases/common/93 private include/stlib/compiler.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
import sys, os
diff --git a/test cases/common/98 gen extra/srcgen.py b/test cases/common/98 gen extra/srcgen.py
index 8988cd92f..86fd698f8 100755
--- a/test cases/common/98 gen extra/srcgen.py
+++ b/test cases/common/98 gen extra/srcgen.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
import sys
import argparse