test cases/windows/16 gui app/gui_app_tester.py
raw| 1 | #!/usr/bin/env python3 |
| 2 | |
| 3 | import os |
| 4 | import sys |
| 5 | try: |
| 6 | import pefile |
| 7 | except ImportError: |
| 8 | if 'CI' in os.environ: |
| 9 | raise |
| 10 | # Skip the test if not on CI |
| 11 | sys.exit(77) |
| 12 | |
| 13 | executable = sys.argv[1] |
| 14 | expected = int(sys.argv[2]) |
| 15 | |
| 16 | actual = pefile.PE(executable).dump_dict()['OPTIONAL_HEADER']['Subsystem']['Value'] |
| 17 | |
| 18 | print('subsystem expected: %d, actual: %d' % (expected, actual)) |
| 19 | sys.exit(0 if (expected == actual) else 1) |