Commit fe02f781 authored by Ben Gamari's avatar Ben Gamari 🐢

testsuite: Assert the opsys names are known

Previously opsys would take any string. This meant it was very easy for
a typo to silently render the predicate ineffective. Fix this by
checking the given operating system name against a list of known values.
parent 3fe8444f
......@@ -501,7 +501,18 @@ def fast() -> bool:
def platform( plat: str ) -> bool:
return config.platform == plat
KNOWN_OPERATING_SYSTEMS = set([
'mingw32',
'freebsd',
'openbsd',
'aix',
'linux',
'darwin',
'solaris2',
])
def opsys( os: str ) -> bool:
assert os in KNOWN_OPERATING_SYSTEMS
return config.os == os
def arch( arch: str ) -> bool:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment