From 3488ec8596e62aec48314c2eab3ba842d486bfe9 Mon Sep 17 00:00:00 2001 From: Georgi Chorbadzhiyski Date: Mon, 3 Oct 2011 19:34:52 +0300 Subject: [PATCH] Add script that checks if every biTStream header can be used standalone. Add headers_test.sh. A script that checks if every biTStream header can be used standalone (includes all needed headers to implement its functionality). --- headers_test.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 headers_test.sh diff --git a/headers_test.sh b/headers_test.sh new file mode 100755 index 0000000..cbd7203 --- /dev/null +++ b/headers_test.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# Test if each header can be used standalone +# Copyright (C) 2011 Unix Solutions Ltd. +# +# License: MIT +# Authors: Georgi Chorbadzhiyski +# + +HEADER_LIST="dvb/sim.h ietf/rtp.h" +# Find is used in such a way in order to work on OS X as well as Linux +# If you want to test only particular headers comment the line bellow +HEADER_LIST=$(find * | grep \\.h$ | sort | sed -e 's|^\./||') + +for HDR in $HEADER_LIST +do + test_file=$(echo $HDR | sed -e 's|/|_|g;s|\.h$||') + echo "Testing: $HDR" + printf "#include \"$HDR\"\n\nint main(void) { return 0; }\n" > $test_file.c + gcc -I.. -Werror -Wall -Wextra -Wno-unused -Wno-sign-compare -Wformat-security $test_file.c -o $test_file + [ $? != 0 ] && exit 1 + rm $test_file $test_file.c +done