aboutsummaryrefslogtreecommitdiffstats
path: root/meson/test cases/windows/16 gui app/gui_app_tester.py
blob: 53e76493f058763f5e668ceaf29b0758257e1b81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python3

import os
import sys
try:
    import pefile
except ImportError:
    if 'CI' in os.environ:
        raise
    # Skip the test if not on CI
    sys.exit(77)

executable = sys.argv[1]
expected = int(sys.argv[2])

actual = pefile.PE(executable).dump_dict()['OPTIONAL_HEADER']['Subsystem']['Value']

print('subsystem expected: %d, actual: %d' % (expected, actual))
sys.exit(0 if (expected == actual) else 1)