blob: 8b08373621a4327c6ea21ec5461c125b27dff109 [file] [log] [blame]
Ash Wilson6791f4d2016-02-25 23:07:50 -06001#!/bin/bash
2
3TEST_DIR=`dirname "$0"`
Ash Wilson1c514982016-04-10 23:24:03 -07004
Ash Wilson4613c1d2016-04-10 23:48:35 -07005export AP_DECODE="grgsm_decode"
Piotr Krysik533f58a2016-04-11 22:20:35 +02006export CAPFILE="../../test_data/vf_call6_a725_d174_g5_Kc1EF00BAB3BAC7002.cfile"
Ash Wilson1c514982016-04-10 23:24:03 -07007export SHORTENED_CAPFILE="tmp.cfile"
Piotr Krysik533f58a2016-04-11 22:20:35 +02008export RESULT_EXPECTED="../fixtures/grgsm_decode_test1_expected"
Ash Wilson1c514982016-04-10 23:24:03 -07009export RESULT_OBTAINED="grgsm_decode_test1_result"
Piotr Krysik259080b2016-07-17 11:05:36 +020010export RUNLINE="$AP_DECODE -c $SHORTENED_CAPFILE -s $((100000000/174)) -m BCCH -t 0 -v --ppm -10"
Ash Wilson6791f4d2016-02-25 23:07:50 -060011echo "Testing with:"
12echo " $RUNLINE"
13gnuradio-companion --version
Ash Wilson4613c1d2016-04-10 23:48:35 -070014
Ash Wilson6791f4d2016-02-25 23:07:50 -060015cd $TEST_DIR
16cat $CAPFILE | head -c 6000000 > $SHORTENED_CAPFILE
Ash Wilson4613c1d2016-04-10 23:48:35 -070017
Piotr Krysik89f36242016-07-15 14:58:09 +020018$RUNLINE | grep -A 999999 "860933 1329237: 59 06 1a 8f 6d 18 10 80 00 00 00 00 00 00 00 00 00 00 00 78 b9 00 00" | tee $RESULT_OBTAINED
Ash Wilson6791f4d2016-02-25 23:07:50 -060019diff $RESULT_EXPECTED $RESULT_OBTAINED
20TEST_RESULT=$?
Ash Wilson4613c1d2016-04-10 23:48:35 -070021
Ash Wilson6791f4d2016-02-25 23:07:50 -060022rm $RESULT_OBTAINED
23rm $SHORTENED_CAPFILE
Ash Wilson4613c1d2016-04-10 23:48:35 -070024
Ash Wilson6791f4d2016-02-25 23:07:50 -060025if [ $TEST_RESULT == 0 ]
26then
27 echo " Result: PASSED"
28 exit 0
29else
30 echo " Result: FAILED"
31 exit 1
32fi