graphene icon indicating copy to clipboard operation
graphene copied to clipboard

1.10.4: installed_tests=true tests=true does not build, execute and install any tests

Open kloczek opened this issue 3 years ago • 5 comments

I'm using below set of meson settings:

        -D gtk_doc=true \
        -D installed_tests=true \
        -D introspection=enabled \
        -D tests=true \
[tkloczko@barrel x86_64-redhat-linux-gnu]$ ninja test
[0/1] Running all tests.
No tests defined.

And the same none of the tests are installed as well.

kloczek avatar Feb 10 '21 12:02 kloczek

Just checked 1.10.2 and everytjing is as expected.

kloczek avatar Feb 10 '21 12:02 kloczek

Does not reproduce, using the same set of options:

meson setup -Dgtk_doc=true -Dinstalled_tests=true -Dintrospection=enabled -Dtests=true _build .
meson compile -C _build
meson test -C _build
ninja: Entering directory `/var/home/ebassi/gnome/source/graphene/_build'
ninja: no work to do.
 1/21 mutest / general      OK             0.02s
 2/21 mutest / hooks        OK             0.03s
 3/21 mutest / types        OK             0.03s
 4/21 graphene / box        OK             0.01s
 5/21 graphene / euler      OK             0.02s
 6/21 graphene / frustum    OK             0.02s
 7/21 graphene / matrix     OK             0.01s
 8/21 graphene / plane      OK             0.02s
 9/21 graphene / point      OK             0.01s
10/21 graphene / point3d    OK             0.01s
11/21 graphene / quad       OK             0.02s
12/21 graphene / quaternion OK             0.01s
13/21 graphene / ray        OK             0.03s
14/21 graphene / rect       OK             0.02s
15/21 graphene / simd       OK             0.02s
16/21 graphene / size       OK             0.02s
17/21 graphene / sphere     OK             0.02s
18/21 graphene / triangle   OK             0.02s
19/21 graphene / vec2       OK             0.01s
20/21 graphene / vec3       OK             0.02s
21/21 graphene / vec4       OK             0.01s

Ok:                 21  
Expected Fail:      0   
Fail:               0   
Unexpected Pass:    0   
Skipped:            0   
Timeout:            0   

Full log written to /var/home/ebassi/gnome/source/graphene/_build/meson-logs/testlog.txt

Nothing has changed in the tests between 1.10.2 and 1.10.4; you may want to bisect the Git history, or check if something has changed in your own environment.

The only reason why tests would be disabled is if the mutest dependency is not available, and if subprojects were disabled.

ebassi avatar Feb 10 '21 13:02 ebassi

I found ehat is causing that. In testx/mesoon.build is:

# Make tests conditional on having mutest-1 installed system-wide, or
# available as a subproject
mutest_dep = dependency('mutest-1',
  fallback: ['mutest', 'mutest_dep'],
  default_options: ['static=true'],
  required: false,
  disabler: true,
)

if mutest_dep.found()
  foreach unit: unit_tests
[..]
  endforeach
endif
```
I have no installed `mutest-1`. Where I can find that library?

And it is a bit odd that current logic does not warn that without installed `mutest-1` test suite will be not generated and/or installed.

kloczek avatar Mar 10 '21 12:03 kloczek

I have no installed mutest-1. Where I can find that library?

It's available here: https://github.com/ebassi/mutest

And it is a bit odd that current logic does not warn that without installed mutest-1 test suite will be not generated and/or installed.

That's because mutest is included as a Meson sub-project. If Graphene cannot find mutest installed, it'll automatically fall back to cloning and building a static, uninstalled copy of mutest inside the subprojects directory; unless you build Graphene with --wrap-mode=nofallback, in which case Meson will not fall back to the subproject copy of mutest.

Of course, if you:

  • do not install mutest
  • disable subproject fallback

then Graphene can only disable the tests.

ebassi avatar Mar 10 '21 12:03 ebassi

I'm using autogenerated tagged tar balls so that tar ball does not have mutest :) Instead including that subproject IMO it woild be better to have hard dependency and fail if tests=true and not found mutest. OK will try to package mutest and than will beck :P

kloczek avatar Mar 10 '21 13:03 kloczek