C:\...\PP4E\System\Tester> dir /B Inputs
test-basic-args.in
test-basic-streams.inC:\...\PP4E\System\Tester> dir /B Outputs
test-basic-args.out
test-basic-stdout.out
test-basic-streams.out
test-basic-this.out
test-errors-runtime.out.bad
test-errors-syntax.out.bad
test-status-bad.out.bad
test-status-good.outC:\...\PP4E\System\Tester> dir /B Errors
test-errors-runtime.err
test-errors-syntax.errI won’t list all these files here (as you can see, there are many, and all are available in
the book examples distribution package), but to give you the general flavor, here are
the files associated with the test script test-basic-args.py:
C:\...\PP4E\System\Tester> type Scripts\test-basic-args.py
# test args, streams
import sys, os
print(os.getcwd()) # to Outputs
print(sys.path[0])print('[argv]')
for arg in sys.argv: # from Args
print(arg) # to Outputsprint('[interaction]') # to Outputs
text = input('Enter text:') # from Inputs
rept = sys.stdin.readline() # from Inputs
sys.stdout.write(text * int(rept)) # to OutputsC:\...\PP4E\System\Tester> type Args\test-basic-args.args
-command -line --stuffC:\...\PP4E\System\Tester> type Inputs\test-basic-args.in
Eggs
10C:\...\PP4E\System\Tester> type Outputs\test-basic-args.out
C:\Users\mark\Stuff\Books\4E\PP4E\dev\Examples\PP4E\System\Tester
C:\Users\mark\Stuff\Books\4E\PP4E\dev\Examples\PP4E\System\Tester\Scripts
[argv]
.\Scripts\test-basic-args.py
-command
-line
--stuff
[interaction]
Enter text:EggsEggsEggsEggsEggsEggsEggsEggsEggsEggsA Regression Test Script | 301