[PATCH wayland v2 1/4] Revert "wayland-egl-symbols-check: pass the DSO name via the build system"

Daniel Stone daniel at fooishbar.org
Mon Mar 12 11:25:53 UTC 2018


Hi,

On 12 March 2018 at 11:21, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> On 9 March 2018 at 11:09, Daniel Stone <daniel at fooishbar.org> wrote:
>> On 9 March 2018 at 10:59, Emil Velikov <emil.l.velikov at gmail.com> wrote:
>>>  - above all, the internal path is a 'dummy' fallback. anyone can
>>> provide the binary name as an argument
>>> $ .../wayland-egl-symbols-check .../libwayland-egl.so
>>>  - since we have a fallback - a plain .../wayland-egl-symbols-check
>>> will work most of the time
>>
>> That makes sense, running it from the build root. Is that just because
>> 'make check' is slow, or? (sanity-test is really slow.)
>>
> Short back story: I was playing with OBS and getting the build
> artefacts (the contents of a failing test) was a pain.
> Admittedly, there may be another way to handle that, although in general:
>
> Passing the file as argument makes debugging a lot quicker/easier.

Sure, that makes sense. I have a suggestion though: why don't we try
argv[1] first, then fall back to $WAYLAND_EGL_LIB, and error out if
neither are set? That way we don't hardcode internal autotools
implementation details into our own scripts (remove fallback
definition), allow autotools tests to run easily (environment
variable), and allow people to use it manually for debugging
(command-line argument). For the latter, I think being explicit is
better: it means you can't accidentally forget to set an environment
variable and end up testing the wrong thing.

>>>  - handling env. variables (as opposed to arguments) is a pain with meson
>>
>> Hm, not really. You just add an 'env' argument when declaring the test, e.g.:
>>     egl_sym_check = find_program('wayland-egl-symbols-check')
>>     test_egl_syms = test('egl-symbols', egl_sym_check, env: [
>> 'WAYLAND_EGL_LIB=@0@'.format(lib_wayland_egl) ])
>>
> Once you add NM and potentially others, it does get tiny bit messier.

No more complicated than it needs to be:
egl_sym_check_env = [
  'WAYLAND_EGL_LIB=@0@'.format(lib_wayland_egl),
  'NM=@0@'.format(nm_prog),
  ...
]
test('egl-symbols', egl_sym_check, env: egl_sym_check_env)

Cheers,
Daniel


More information about the wayland-devel mailing list