test cases/common/109 custom target capture/my_compiler.py
raw| 1 | #!/usr/bin/env python3 |
| 2 | |
| 3 | import sys |
| 4 | |
| 5 | if __name__ == '__main__': |
| 6 | if len(sys.argv) != 2: |
| 7 | print(sys.argv[0], 'input_file') |
| 8 | sys.exit(1) |
| 9 | with open(sys.argv[1]) as f: |
| 10 | ifile = f.read() |
| 11 | if ifile != 'This is a text only input file.\n': |
| 12 | print('Malformed input') |
| 13 | sys.exit(1) |
| 14 | print('This is a binary output file.') |