Files
nginx-unit/test/unit/option.py
Andrei Zeliankou 99da2f3c8e Tests: check for the AddressSanitizer flag during discovery
This flag is necessary to either run or skip certain tests that have
specific behavior depending on whether AddressSanitizer is enabled.

For instance, some tests may fail only when the binary is compiled
with AddressSanitizer.
2024-02-21 17:40:25 +00:00

27 lines
587 B
Python

import os
import platform
class Options:
_options = {
'architecture': platform.architecture()[0],
'available': {'modules': {}, 'features': {}},
'configure_flag': {},
'is_privileged': os.geteuid() == 0,
'skip_alerts': [],
'skip_sanitizer': False,
'system': platform.system(),
}
def __setattr__(self, name, value):
Options._options[name] = value
def __getattr__(self, name):
if name in Options._options:
return Options._options[name]
raise AttributeError
option = Options()