3 # Generates set of files which simply include one of Gammu headers
5 # - header completeness
6 # - header reneterability
9 start
='# Auto generated include tests begin'
10 end
='# Auto generated include tests end'
13 echo "$@" >> $tmpcmake
17 cecho
"# Do not modify this section, change gen-include-test.sh instead"
19 for x
in `ls ../include/ | grep -v gammu.h | grep -v CMake` ; do
22 filename
=include-
$base.c
23 executable
=include-
$base
25 echo "/* Automatically generated test for validating header file $x */"
26 echo "/* See gen-include-test.sh for details */"
31 echo "/* We do not want to push another header, so we need to copy definiton of UNUSED */"
34 echo "# define UNUSED __attribute__ ((unused))"
36 echo "# define UNUSED"
40 echo "int main(int argc UNUSED, char **argv UNUSED)"
48 cecho
"# Test for header $x"
49 cecho
"add_executable($executable $filename)"
50 cecho
"target_link_libraries($executable libGammu \${LIBINTL_LIBRARIES})"
51 cecho
"add_test($executable \"\${GAMMU_TEST_PATH}/$executable\${GAMMU_TEST_SUFFIX}\")"
59 sed -e "/^$start/,/^$end/{
63 " CMakeLists.txt
> CMakeLists.txt.new
64 cat CMakeLists.txt.new
> CMakeLists.txt
65 rm -f $tmpcmake CMakeLists.txt.new