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

Writes the command name and argument list 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')
    with open(path, 'a') as f:
        f.write("wrapper_with_args.py %s\n" % " ".join(sys.argv[1:]))
    subprocess.run(sys.argv[1:], check=False)