tests: Use #!/usr/bin/env python3 for all scripts

We automatically convert that to use sys.executable now which is
always available on all platforms (because we're running with it).

On some platforms like NetBSD, `python` doesn't exist, and you must
use a specific python version. On most other distros, `python` is
Python 2, and we don't want to depend on that.

Closes https://github.com/mesonbuild/meson/issues/695

All these scripts were being used as `find_program()`, so we do not
lose any test coverage by doing this.
pull/1435/head
Nirbheek Chauhan 8 years ago committed by Jussi Pakkanen
parent 438f219864
commit 0e6045864c
  1. 2
      test cases/common/105 find program path/program.py
  2. 2
      test cases/common/107 postconf/postconf.py
  3. 2
      test cases/common/108 postconf with args/postconf.py
  4. 2
      test cases/common/113 generatorcustom/catter.py
  5. 2
      test cases/common/113 generatorcustom/gen.py
  6. 2
      test cases/common/118 allgenerate/converter.py
  7. 2
      test cases/common/129 object only target/obj_generator.py
  8. 2
      test cases/common/131 custom target directory install/docgen.py
  9. 2
      test cases/common/133 configure file in generator/src/gen.py
  10. 2
      test cases/common/134 generated llvm ir/copyfile.py
  11. 2
      test cases/common/135 generated assembly/copyfile.py
  12. 2
      test cases/common/48 test args/tester.py
  13. 2
      test cases/common/58 run target/check_exists.py
  14. 2
      test cases/common/58 run target/converter.py
  15. 2
      test cases/common/58 run target/fakeburner.py
  16. 6
      test cases/common/58 run target/meson.build
  17. 2
      test cases/common/60 install script/myinstall.py
  18. 2
      test cases/common/60 install script/src/myinstall.py
  19. 2
      test cases/common/61 custom target source output/generator.py
  20. 2
      test cases/common/64 custom header generator/makeheader.py
  21. 2
      test cases/common/65 multiple generators/mygen.py
  22. 2
      test cases/common/72 build always/version_gen.py
  23. 2
      test cases/common/76 configure file in custom target/src/mycompiler.py
  24. 2
      test cases/common/77 external test program/mytest.py
  25. 2
      test cases/common/78 ctarget dependency/gen1.py
  26. 2
      test cases/common/78 ctarget dependency/gen2.py
  27. 2
      test cases/common/93 private include/stlib/compiler.py
  28. 2
      test cases/common/95 dep fallback/gensrc.py
  29. 2
      test cases/common/95 dep fallback/subprojects/boblib/genbob.py
  30. 2
      test cases/common/98 gen extra/srcgen.py
  31. 4
      test cases/frameworks/7 gnome/resources-data/meson.build

@ -1,3 +1,3 @@
#!/usr/bin/env python
#!/usr/bin/env python3
print("Found")

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import os

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys, os

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Mimic a binary that generates an object file (e.g. windres).

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import os
import sys

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys
import shutil

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys
import shutil

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import os
import sys

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
from __future__ import print_function

@ -19,15 +19,17 @@ hex = custom_target('exe.hex',
],
)
fakeburner = find_program('fakeburner.py')
# These emulates the Arduino flasher application. It sandwiches the filename inside
# a packed argument. Thus we need to declare it manually.
run_target('upload',
command : ['fakeburner.py', 'x:@0@:y'.format(exe.full_path())],
command : [fakeburner, 'x:@0@:y'.format(exe.full_path())],
depends : exe,
)
run_target('upload2',
command : ['fakeburner.py', 'x:@0@:y'.format(hex.full_path())],
command : [fakeburner, 'x:@0@:y'.format(hex.full_path())],
depends : hex,
)

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import os
import sys

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import os
import sys

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys, os

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# NOTE: this file does not have the executable bit set. This tests that
# Meson can automatically parse shebang lines.

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys, os

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys, os, subprocess

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
from __future__ import print_function

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import time, sys

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys, os
from glob import glob

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys, os

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys
import shutil

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys
import argparse

@ -1,5 +1,7 @@
subdir('subdir')
python3 = import('python3').find_python()
fake_generator_script = '''
import os, sys
assert os.path.exists(sys.argv[1]), "File %s not found" % sys.argv[1]
@ -11,6 +13,6 @@ print("This is a generated resource.")
res3_txt = custom_target('res3.txt',
input: 'res3.txt.in',
output: 'res3.txt',
command: ['python3', '-c', fake_generator_script, '@INPUT@'],
command: [python3, '-c', fake_generator_script, '@INPUT@'],
capture: true,
)

Loading…
Cancel
Save