<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 6, 2015 at 5:32 AM, Peter Hutterer <span dir="ltr"><<a href="mailto:peter.hutterer@who-t.net" target="_blank">peter.hutterer@who-t.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Thu, Feb 05, 2015 at 09:33:19AM +0100, Marek Chalupa wrote:<br>
> This patch adds simple script that compares libinput.sym file to the<br>
> functions that are marked by LIBINPUT_EXPORT. This script is added<br>
> to make check target.<br>
><br>
> v2. use noinst_SCRIPTS instead of dummy target<br>
> drop .sh suffix<br>
> generate the script from .in file<br>
> use -u swich when running diff<br>
><br>
> v3. use AC_CONFIG_FILES to generate scripts from .in file<br>
> use pipes instead of creating files<br>
><br>
> Signed-off-by: Marek Chalupa <<a href="mailto:mchqwerty@gmail.com">mchqwerty@gmail.com</a>><br>
> ---<br>
> <a href="http://configure.ac" target="_blank">configure.ac</a> | 2 ++<br>
> test/Makefile.am | 3 ++-<br>
> test/<a href="http://symbols-leak-test.in" target="_blank">symbols-leak-test.in</a> | 17 +++++++++++++++++<br>
> 3 files changed, 21 insertions(+), 1 deletion(-)<br>
> create mode 100755 test/<a href="http://symbols-leak-test.in" target="_blank">symbols-leak-test.in</a><br>
><br>
> diff --git a/<a href="http://configure.ac" target="_blank">configure.ac</a> b/<a href="http://configure.ac" target="_blank">configure.ac</a><br>
> index 803d573..dea65bf 100644<br>
> --- a/<a href="http://configure.ac" target="_blank">configure.ac</a><br>
> +++ b/<a href="http://configure.ac" target="_blank">configure.ac</a><br>
> @@ -164,6 +164,8 @@ AC_CONFIG_FILES([Makefile<br>
> src/libinput-version.h<br>
> test/Makefile<br>
> tools/Makefile])<br>
> +AC_CONFIG_FILES([test/symbols-leak-test], [chmod +x test/symbols-leak-test])<br>
> +<br>
<br>
</div></div>hmm, any particular reason you didn't add this to the AC_CONFIG_FILES right<br>
above?<br></blockquote><div><br></div><div>Yep, adding it to the one above did not work. It threw an error about "multiple definition" of the "target".<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="h5"><br>
> AC_OUTPUT<br>
><br>
> AC_MSG_RESULT([<br>
> diff --git a/test/Makefile.am b/test/Makefile.am<br>
> index 5b9c7ab..5743ca4 100644<br>
> --- a/test/Makefile.am<br>
> +++ b/test/Makefile.am<br>
> @@ -50,7 +50,8 @@ build_tests = \<br>
> test-build-std-gnuc90<br>
><br>
> noinst_PROGRAMS = $(build_tests) $(run_tests)<br>
> -TESTS = $(run_tests)<br>
> +noinst_SCRIPTS = symbols-leak-test<br>
> +TESTS = $(run_tests) symbols-leak-test<br>
><br>
> .NOTPARALLEL:<br>
><br>
> diff --git a/test/<a href="http://symbols-leak-test.in" target="_blank">symbols-leak-test.in</a> b/test/<a href="http://symbols-leak-test.in" target="_blank">symbols-leak-test.in</a><br>
> new file mode 100755<br>
> index 0000000..4b315ed<br>
> --- /dev/null<br>
> +++ b/test/<a href="http://symbols-leak-test.in" target="_blank">symbols-leak-test.in</a><br>
> @@ -0,0 +1,17 @@<br>
> +#!/bin/bash<br>
> +<br>
> +### simple check for exported symbols<br>
> +<br>
> +# make sure the paths are alright<br>
> +cd `dirname $0`<br>
<br>
</div></div>do you still need this? you don't use any tmp files anymore now.<br></blockquote><div><br></div><div>Not when make check runs the script, but if you run the symbols-leak-test manually, you'd get an error if you wouldn't change working directory to test/<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br>
> +<br>
> +diff -a -u \<br>
> + <(cat @top_srcdir@/src/libinput.sym | \<br>
> + grep '^\s\+libinput_.*' | \<br>
> + sed -e 's/^\s\+\(.*\);/\1/' | sort) \<br>
> + <(cat @top_srcdir@/src/*.c | \<br>
> + grep LIBINPUT_EXPORT -A 1 | grep '^libinput_.*' | \<br>
> + sed -e 's/(.*//' | sort)<br>
> +CODE=$?<br>
> +<br>
> +exit $CODE<br>
<br>
</span>if you use set -e you can skip CODE and exit, bash will exit if any command<br>
has a non-zero status<br></blockquote><div><br></div><div>good point, will do it..<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Cheers,<br>
Peter<br>
</blockquote></div><br></div><div class="gmail_extra">Thanks,<br>Marek<br></div></div>