tools: fix get_asan_state() in tools/test.py

The output of `node -p process.config.variables.asan` includes
a newline character so it's never exactly "1", which means
asan is always "off" for the status files. This fixes the
detection by stripping whitespaces from the output.

PR-URL: https://github.com/nodejs/node/pull/52766
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
This commit is contained in:
Joyee Cheung 2024-05-02 18:40:39 +02:00
parent 4da1d1aaf3
commit a1770d4a41
No known key found for this signature in database
GPG key ID: 92B78A53C8303B8D

View file

@ -1613,7 +1613,7 @@ def get_env_type(vm, options_type, context):
def get_asan_state(vm, context):
asan = Execute([vm, '-p', 'process.config.variables.asan'], context).stdout
asan = Execute([vm, '-p', 'process.config.variables.asan'], context).stdout.strip()
return "on" if asan == "1" else "off"