summaryrefslogtreecommitdiffstats
path: root/test/fixture/wrapper.py
blob: c266cfa5cd2d0c4cf83eb81222d99f9a345738b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"""
Command wrapper, for testing SCons.

Writes the command name to file "wrapper.out",
then passes the command line on to subprocess.
No checking is done.
"""
import os
import sys
import subprocess

if __name__ == '__main__':
    path = os.path.join(os.path.dirname(os.path.relpath(__file__)), 'wrapper.out')
    if '--version' not in sys.argv and '-dumpversion' not in sys.argv:
        with open(path, 'wb') as f:
            f.write(b"wrapper.py\n")
    subprocess.run(sys.argv[1:], check=False)