| @@ -1,9 +1,24 @@ |
| 1 | | − |
| 2 | 1 | #!/bin/bash |
| 3 | | − |
| 4 | | − |
| 5 | | −#usage:runMain ${TestType} ${TestBitStream} |
| 6 | | −runMain() |
| 2 | +#********************************************************************************** |
| 3 | +# This script is for test on travis.Currently there are 5 jobs running on |
| 4 | +# travis in parallel status which are listed as below: |
| 5 | +# 1.Unit test with gcc compiler; |
| 6 | +# 2.Unit test with clang compiler; |
| 7 | +# 3.Binary comparison test for test bit stream A; |
| 8 | +# 4.Binary comparison test for test bit stream B; |
| 9 | +# 5.Binary comparison test for test bit stream C. |
| 10 | +# For binary comparison test,before running all test cases, it need to prepare |
| 11 | +# the test space.On travis,as those parallel jobs are running on different VMs, |
| 12 | +# so each job need to prepare for its test space for itself. |
| 13 | +# |
| 14 | +# --usage: |
| 15 | +# ./runTest.sh UnitTest |
| 16 | +# or ./runTest.sh BinaryCompare ${TestBitStreamName} |
| 17 | +# |
| 18 | +# date: 10/06/2014 Created |
| 19 | +#********************************************************************************** |
| 20 | +#usage: runInputParamCheck ${TestType} ${TestBitStream} |
| 21 | +runInputParamCheck() |
| 7 | 22 | { |
| 8 | 23 | local ParameterFlag="" |
| 9 | 24 | if [ $# -eq 1 -a "$1" = "UnitTest" ] |
| @@ -15,41 +30,64 @@ runMain() · 5 unmodified lines |
| 15 | 30 | else |
| 16 | 31 | let "ParameterFlag=1" |
| 17 | 32 | fi |
| 18 | | − |
| 19 | | − if [ ! ${ParameterFlag} -eq 0 ] |
| 33 | + return ${ParameterFlag} |
| 34 | +} |
| 35 | +#usage: runUnitTest |
| 36 | +runUnitTest() |
| 37 | +{ |
| 38 | + make -B ENABLE64BIT=Yes BUILDTYPE=Release all plugin test |
| 39 | + make -B ENABLE64BIT=Yes BUILDTYPE=Debug all plugin test |
| 40 | + make -B ENABLE64BIT=No BUILDTYPE=Release all plugin test |
| 41 | + make -B ENABLE64BIT=No BUILDTYPE=Debug all plugin test |
| 42 | + return $? |
| 43 | +} |
| 44 | +#usage: runPrepareAndBinaryTest $TestBitStream |
| 45 | +runPrepareAndBinaryTest() |
| 46 | +{ |
| 47 | + if [ ! $# -eq 1 ] |
| 20 | 48 | then |
| 21 | | − echo "usage: runMain UnitTest " |
| 22 | | − echo " or runMain BinaryCompare \${TestBitStreamName} " |
| 49 | + echo "usage: runPrepareAndBinaryTest \$TestBitStream" |
| 23 | 50 | exit 1 |
| 24 | 51 | fi |
| 25 | | − |
| 26 | | − |
| 52 | + local TestBitStream=$1 |
| 53 | + local WorkingDir=`pwd` |
| 54 | + local BinaryTestDir="test/encoder_binary_comparison" |
| 55 | + local TestSpacePrepareLog="AllTestSpacePrepare.log" |
| 56 | + cd ${BinaryTestDir} |
| 57 | + ./run_PrepareAllTestData.sh 64 2>${TestSpacePrepareLog} |
| 58 | + cd ${WorkingDir} |
| 59 | + echo "" |
| 60 | + echo " binary compare test, test bit stream is ${TestBitStream}" |
| 61 | + echo "" |
| 62 | + ./test/encoder_binary_comparison/run_OneBitStream.sh ${TestBitStream} |
| 63 | + return $? |
| 64 | +} |
| 65 | +#usage:runMain ${TestType} ${TestBitStream} |
| 66 | +runMain() |
| 67 | +{ |
| 27 | 68 | local TestType=$1 |
| 28 | 69 | local TestBitStream=$2 |
| 29 | | − |
| 70 | + runInputParamCheck ${TestType} ${TestBitStream} |
| 71 | + if [ ! $? -eq 0 ] |
| 72 | + then |
| 73 | + echo "usage: ./runTest.sh UnitTest \${PrepareFlag}" |
| 74 | + echo " or ./runTest.sh BinaryCompare \${TestBitStreamName} \${PrepareFlag} " |
| 75 | + exit 1 |
| 76 | + fi |
| 30 | 77 | if [ "${TestType}" = "UnitTest" ] |
| 31 | 78 | then |
| 32 | 79 | set -e |
| 33 | | − make -B ENABLE64BIT=Yes BUILDTYPE=Release all plugin test |
| 34 | | − make -B ENABLE64BIT=Yes BUILDTYPE=Debug all plugin test |
| 35 | | − make -B ENABLE64BIT=No BUILDTYPE=Release all plugin test |
| 36 | | − make -B ENABLE64BIT=No BUILDTYPE=Debug all plugin test |
| 37 | | − elif [ "${TestType}" = "BinaryCompare" ] |
| 80 | + runUnitTest |
| 81 | + return $? |
| 82 | + fi |
| 83 | + if [ "${TestType}" = "BinaryCompare" ] |
| 38 | 84 | then |
| 39 | | − echo "" |
| 40 | | − echo " binary compare test, test bit stream is ${TestBitStream}" |
| 41 | | − echo "" |
| 42 | | − ./test/encoder_binary_comparison/run_OneBitStream.sh ${TestBitStream} |
| 85 | + set -e |
| 86 | + runPrepareAndBinaryTest ${TestBitStream} |
| 87 | + return $? |
| 43 | 88 | fi |
| 44 | | − |
| 45 | 89 | } |
| 46 | | − |
| 47 | 90 | TestType=$1 |
| 48 | 91 | TestBitStream=$2 |
| 49 | | − |
| 50 | 92 | runMain ${TestType} ${TestBitStream} |
| 51 | 93 | |
| 52 | | − |
| 53 | | − |
| 54 | | − |
| 55 | | − |