@@ -22,11 +22,11 @@ cd "${RUN_DIR}"
2222# way of performing a rough comparsion of two output speech files that are not exactly the same
2323
2424function compare_energy() {
25- energy_ref=$( python -c " import numpy as np; x=np.fromfile(\" ref_demod.raw\" ,dtype=\" int16\" ).astype(float); print(10*np.log10(np.dot(x,x)))" )
26- energy_target=$( python -c " import numpy as np; x=np.fromfile(\" stm_out.raw\" ,dtype=\" int16\" ).astype(float); print(10*np.log10(np.dot(x,x)))" )
25+ energy_ref=$( python3 -c " import numpy as np; x=np.fromfile(\" ref_demod.raw\" ,dtype=\" int16\" ).astype(float); print(10*np.log10(np.dot(x,x)))" )
26+ energy_target=$( python3 -c " import numpy as np; x=np.fromfile(\" stm_out.raw\" ,dtype=\" int16\" ).astype(float); print(10*np.log10(np.dot(x,x)))" )
2727 printf " ref energy: %f target energy: %f\n" $energy_ref $energy_target
2828
29- python -c " import sys; sys.exit(1) if abs($energy_ref -$energy_target ) < 1 else sys.exit(0)"
29+ python3 -c " import sys; sys.exit(1) if abs($energy_ref -$energy_target ) < 1 else sys.exit(0)"
3030 if [[ $? -eq 1 ]]; then echo " energy compare OK" ;
3131 else echo " energy compare BAD" ;
3232 let Fails=($Fails + 1)
@@ -68,7 +68,7 @@ case "${TEST_OPT}" in
6868 # for such a short test, so we'll just sanity check the
6969 # reference uncoded BER here. Bash can't compare floats
7070 # .... so use return code of some python script
71- python -c " import sys; sys.exit(1) if $uber_ref < 0.1 else sys.exit(0)"
71+ python3 -c " import sys; sys.exit(1) if $uber_ref < 0.1 else sys.exit(0)"
7272 if [[ $? -eq 1 ]]; then echo " OK" ;
7373 else echo " BAD" ;
7474 let Fails=($Fails + 1)
@@ -78,7 +78,7 @@ case "${TEST_OPT}" in
7878 uber_target=$( cat stderr.log | sed -n " s/^BER.*: \([0-9..]*\).*Tbits.*/\1/p" )
7979 cber_target=$( cat stderr.log | sed -n " s/^Coded BER.*: \([0-9..]*\).*Tbits.*/\1/p" )
8080 printf " TARGET uncoded BER: %f coded BER: %f\n" $uber_target $cber_target
81- python -c " import sys; sys.exit(1) if $uber_target < 0.1 and abs($cber_ref -$cber_target ) < 0.01 else sys.exit(0)"
81+ python3 -c " import sys; sys.exit(1) if $uber_target < 0.1 and abs($cber_ref -$cber_target ) < 0.01 else sys.exit(0)"
8282 if [[ $? -eq 1 ]]; then echo " OK" ;
8383 else echo " BAD" ;
8484 let Fails=($Fails + 1)
@@ -109,7 +109,7 @@ case "${TEST_OPT}" in
109109 # make sure execution time stays within bounds
110110 execution_time=mktmp
111111 cat stdout.log | sed -n " s/.*freedv_rx \([0-9..]*\) msecs/\1/p" > $execution_time
112- python -c " import sys; import numpy as np; x=np.loadtxt(\" $execution_time \" ); print(\" execution time max:: %5.2f mean: %5.2f ms\" % (np.max(x), np.mean(x))); sys.exit(1) if np.max(x) < 80.0 else sys.exit(0)"
112+ python3 -c " import sys; import numpy as np; x=np.loadtxt(\" $execution_time \" ); print(\" execution time max:: %5.2f mean: %5.2f ms\" % (np.max(x), np.mean(x))); sys.exit(1) if np.max(x) < 80.0 else sys.exit(0)"
113113 if [[ $? -eq 1 ]]; then echo " execution time OK" ;
114114 else echo " BAD" ;
115115 let Fails=($Fails + 1)
@@ -145,7 +145,7 @@ case "${TEST_OPT}" in
145145 # for such a short test, so we'll just sanity check the
146146 # reference uncoded BER here. Bash can't compare floats
147147 # .... so use return code of some python script
148- python -c " import sys; sys.exit(1) if $uber_ref < 0.1 else sys.exit(0)"
148+ python3 -c " import sys; sys.exit(1) if $uber_ref < 0.1 else sys.exit(0)"
149149 if [[ $? -eq 1 ]]; then echo " OK" ;
150150 else echo " BAD" ;
151151 let Fails=($Fails + 1)
@@ -155,7 +155,7 @@ case "${TEST_OPT}" in
155155 uber_target=$( cat stderr.log | sed -n " s/^BER.*: \([0-9..]*\).*Tbits.*/\1/p" )
156156 cber_target=$( cat stderr.log | sed -n " s/^Coded BER.*: \([0-9..]*\).*Tbits.*/\1/p" )
157157 printf " TARGET uncoded BER: %f coded BER: %f\n" $uber_target $cber_target
158- python -c " import sys; sys.exit(1) if $uber_target < 0.1 and abs($cber_ref -$cber_target ) < 0.01 else sys.exit(0)"
158+ python3 -c " import sys; sys.exit(1) if $uber_target < 0.1 and abs($cber_ref -$cber_target ) < 0.01 else sys.exit(0)"
159159 if [[ $? -eq 1 ]]; then echo " OK" ;
160160 else echo " BAD" ;
161161 let Fails=($Fails + 1)
@@ -186,7 +186,7 @@ case "${TEST_OPT}" in
186186 # make sure execution time stays within bounds
187187 execution_time=mktmp
188188 cat stdout.log | sed -n " s/.*freedv_rx \([0-9..]*\) msecs/\1/p" > $execution_time
189- python -c " import sys; import numpy as np; x=np.loadtxt(\" $execution_time \" ); print(\" execution time max:: %5.2f mean: %5.2f ms\" % (np.max(x), np.mean(x))); sys.exit(1) if np.max(x) < 80.0 else sys.exit(0)"
189+ python3 -c " import sys; import numpy as np; x=np.loadtxt(\" $execution_time \" ); print(\" execution time max:: %5.2f mean: %5.2f ms\" % (np.max(x), np.mean(x))); sys.exit(1) if np.max(x) < 80.0 else sys.exit(0)"
190190 if [[ $? -eq 1 ]]; then echo " execution time OK" ;
191191 else echo " BAD" ;
192192 let Fails=($Fails + 1)
0 commit comments