Skip to content

Commit

Permalink
Only add gcov flag when it's specified (#183)
Browse files Browse the repository at this point in the history
Solve problems running in environments without gcov.

Fix numpy tests on [x86-64, LP64 OpenBLAS
(MSVC)](https://github.com/numpy/numpy/actions/runs/8966988031/job/24623596948?pr=26388#logs)
and [x86-64, LP64 OpenBLAS
(Clang-cl)](https://github.com/numpy/numpy/actions/runs/8966988031/job/24623597659?pr=26388#logs)

```
Run spin test
  spin test
  shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
  env:
    pythonLocation: C:\hostedtoolcache\windows\Python\3.11.9\x64
    PKG_CONFIG_PATH: D:\a\numpy\numpy/.openblas
    Python_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.11.9\x64
    Python2_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.11.9\x64
    Python3_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.11.9\x64
Invoking `build` prior to running tests:
Error: build() got an unexpected keyword argument 'gcov'; aborting.
Error: Process completed with exit code 1.
```
  • Loading branch information
stefanv authored May 6, 2024
2 parents 83238dd + f184be4 commit 0157ef5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion spin/cmds/meson.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,10 @@ def test(
click.secho(
"Invoking `build` prior to running tests:", bold=True, fg="bright_green"
)
ctx.invoke(build_cmd, gcov=bool(gcov))
if gcov is not None:
ctx.invoke(build_cmd, gcov=bool(gcov))
else:
ctx.invoke(build_cmd)

package = cfg.get("tool.spin.package", None)
if (not pytest_args) and (not tests):
Expand Down

0 comments on commit 0157ef5

Please sign in to comment.