3 # Override HOME. Bash processes $HOME/.profile.
8 # Pre-set TMPDIR. The content of system tmp could collide with the tests.
14 # If we have a tty, just run the tests
17 # If we don't have tty, run the tests in screen(1) to make the tests
18 # pass successfully. But screen needs some pty already, so create one
19 # using python. We can't run the tests directly in python as pty module
20 # does not simulate terminal, it merely provides pty device. Also we
21 # set the TERM environment variable to 'xterm' so that screen does not
22 # start confused setting TERM to 'dumb' which breaks the tests again.
23 # Also we have to collect the test output ourselves, since userland
24 # infrastructure captures the screen output which is full of terminal
25 # control codes. To offset anything user may have set in his .screenrc
26 # we use /dev/null as screen config. Last touch is to unset TSTP signal
27 # which is set if we run 'gmake test' via ssh. Unsetting it to default
28 # makes the tests pass even in this case.
34 signal.signal(signal.SIGTSTP, signal.SIG_DFL)
35 pty.spawn(sys.argv[1:])
36 ' env TERM
=xterm
/usr
/bin
/screen
-c /dev
/null bash
-c 'gmake '"$@"' 2>&1 | tee outfile'