tests: fix "make check" with dash
authorDaiki Ueno <ueno@unixuser.org>
Fri, 24 Aug 2012 14:13:41 +0000 (23:13 +0900)
committerDaiki Ueno <ueno@unixuser.org>
Fri, 24 Aug 2012 14:13:41 +0000 (23:13 +0900)
/bin/dash does not support ERR trap signal and ">&" redirect.  Also
fix copying non-existing component file.

BUG=none

Review URL: https://codereview.appspot.com/6478058

src/tests/setupenv

index 591557e..df269e4 100755 (executable)
@@ -4,14 +4,14 @@
 : ${top_srcdir:=../..}
 : ${builddir:=.}
 
-trap 'exit' ERR
-trap '. $IBUS_ADDRESS_FILE; kill $IBUS_DAEMON_PID >& /dev/null; rm -fr components $IBUS_ADDRESS_FILE' EXIT
+trap 'exit' 1 2 3 15
+trap '. $IBUS_ADDRESS_FILE; kill $IBUS_DAEMON_PID &> /dev/null; rm -fr components $IBUS_ADDRESS_FILE' EXIT
 
 # copy some component files necessary for testing, under components/
 copy_component() {
     file=$1
     base=`basename $file`
-    if test -f $file; then
+    if test -f $file.in; then
        mkdir -p components
        ( libexecdir=`dirname $file`;
            s=`cat $file.in`;