diff --git a/tests/test_default_options.py b/tests/test_default_options.py new file mode 100644 index 000000000..e7898b39a --- /dev/null +++ b/tests/test_default_options.py @@ -0,0 +1,15 @@ +import os +import subprocess + +import pytest + +import mesonpy + + +@pytest.mark.parametrize('args', [[], ['-Dbuildtype=release']], ids=['defaults', '-Dbuildtype=release']) +def test_ndebug(package_scipy_like, tmp_path, args): + with mesonpy._project({'setup-args': args}) as project: + command = subprocess.run( + ['ninja', '-C', os.fspath(project._build_dir), '-t', 'commands', '../../mypkg/extmod.c^'], + stdout=subprocess.PIPE, check=True).stdout + assert b'-DNDEBUG' in command