Skip to content

Commit

Permalink
Simplify incoming call testing
Browse files Browse the repository at this point in the history
- do not run in background
- avoid the cleanup

Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed Oct 23, 2016
1 parent 8b4c86d commit 4717417
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions gammu/test-incoming.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,15 @@

set -x
set -e
GAMMU_PID=0

CMAKE_CURRENT_BINARY_DIR="$1"

cd $CMAKE_CURRENT_BINARY_DIR
cd "$CMAKE_CURRENT_BINARY_DIR"

EXE="$CMAKE_CURRENT_BINARY_DIR/gammu@CMAKE_EXECUTABLE_SUFFIX@"
CONFIG="$CMAKE_CURRENT_BINARY_DIR/.gammurc"
DUMMY="$CMAKE_CURRENT_BINARY_DIR/.gammu-dummy"

cleanup() {
if [ $GAMMU_PID -ne 0 ] ; then
kill $GAMMU_PID
sleep 1
fi
}

trap cleanup INT QUIT EXIT

$EXE -c "$CONFIG" monitor 10 &
GAMMU_PID=$!

sleep 1

touch $DUMMY/incoming-call

sleep 1
exec "$EXE" -c "$CONFIG" monitor 1

0 comments on commit 4717417

Please sign in to comment.