
On Wed, Jul 29, 2020 at 09:11:11AM +0200, Pavel Hrdina wrote:
So I was trying to figure out what to do with our syntax-check and this could be one solution:
rc = run_command( 'sed', '-n', 's/^\\(sc_[a-zA-Z0-9_-]*\\):.*/\\1/p', meson.current_source_dir() / 'syntax-check.mk', check: true, )
sc_tests = rc.stdout().strip().split()
This is how syntax-check.mk gets the list of targets to run for syntax-check target. We can use the same list to define tests like this:
foreach target : sc_tests rc = run_command( python3_prog, '-c', 'print("@0@".replace("sc_", ""))'.format(target), check: true, env: runutf8, ) name = rc.stdout().strip()
test( name, make_prog, args: [ '-C', meson.current_build_dir(), target ], depends: [ potfiles_dep, ], suite: 'syntax-check', ) endforeach
I like this idea as it eliminates a little bit more of the "make" usage. BTW, can we just run them more directly instead of via "python_prog" ? The tests don't use python, so avoiding creating a python intepretor for each syntax check rule probably wins for performance a litle Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|