Skip to content

Commit

Permalink
Tests: check for the AddressSanitizer flag during discovery
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
andrey-zelenkov committed Feb 21, 2024
1 parent 7320b69 commit 87590ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/unit/check/discover_available.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ def discover_available(unit):
[unit['unitd'], '--version'], stderr=subprocess.STDOUT
).decode()

option.configure_flag['asan'] = '-fsanitize=address' in output_version

# wait for controller start

if Log.wait_for_record(r'controller started') is None:
Expand Down
1 change: 1 addition & 0 deletions test/unit/option.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class Options:
_options = {
'architecture': platform.architecture()[0],
'available': {'modules': {}, 'features': {}},
'configure_flag': {},
'is_privileged': os.geteuid() == 0,
'skip_alerts': [],
'skip_sanitizer': False,
Expand Down

0 comments on commit 87590ed

Please sign in to comment.