| @@ -1,9 +1,24 @@ |
| 1 | | | |
| 2 | #!/bin/bash | 1 | #!/bin/bash |
| 3 | | 2 | #********************************************************************************** |
| 4 | | 3 | # This script is for test on travis.Currently there are 5 jobs running on |
| 5 | #usage:runMain ${TestType} ${TestBitStream} | 4 | # travis in parallel status which are listed as below: |
| 6 | runMain() | 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 | local ParameterFlag="" | 23 | local ParameterFlag="" |
| 9 | if [ $# -eq 1 -a "$1" = "UnitTest" ] | 24 | if [ $# -eq 1 -a "$1" = "UnitTest" ] |
| @@ -15,41 +30,64 @@ runMain() · 5 unmodified lines |
| 15 | else | 30 | else |
| 16 | let "ParameterFlag=1" | 31 | let "ParameterFlag=1" |
| 17 | fi | 32 | fi |
| 18 | | 33 | return ${ParameterFlag} |
| 19 | if [ ! ${ParameterFlag} -eq 0 ] | 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 | then | 48 | then |
| 21 | echo "usage: runMain UnitTest " | 49 | echo "usage: runPrepareAndBinaryTest \$TestBitStream" |
| 22 | echo " or runMain BinaryCompare \${TestBitStreamName} " | | |
| 23 | exit 1 | 50 | exit 1 |
| 24 | fi | 51 | fi |
| 25 | | 52 | local TestBitStream=$1 |
| 26 | | 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 | local TestType=$1 | 68 | local TestType=$1 |
| 28 | local TestBitStream=$2 | 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 | if [ "${TestType}" = "UnitTest" ] | 77 | if [ "${TestType}" = "UnitTest" ] |
| 31 | then | 78 | then |
| 32 | set -e | 79 | set -e |
| 33 | make -B ENABLE64BIT=Yes BUILDTYPE=Release all plugin test | 80 | runUnitTest |
| 34 | make -B ENABLE64BIT=Yes BUILDTYPE=Debug all plugin test | 81 | return $? |
| 35 | make -B ENABLE64BIT=No BUILDTYPE=Release all plugin test | 82 | fi |
| 36 | make -B ENABLE64BIT=No BUILDTYPE=Debug all plugin test | 83 | if [ "${TestType}" = "BinaryCompare" ] |
| 37 | elif [ "${TestType}" = "BinaryCompare" ] | | |
| 38 | then | 84 | then |
| 39 | echo "" | 85 | set -e |
| 40 | echo " binary compare test, test bit stream is ${TestBitStream}" | 86 | runPrepareAndBinaryTest ${TestBitStream} |
| 41 | echo "" | 87 | return $? |
| 42 | ./test/encoder_binary_comparison/run_OneBitStream.sh ${TestBitStream} | | |
| 43 | fi | 88 | fi |
| 44 | | | |
| 45 | } | 89 | } |
| 46 | | | |
| 47 | TestType=$1 | 90 | TestType=$1 |
| 48 | TestBitStream=$2 | 91 | TestBitStream=$2 |
| 49 | | | |
| 50 | runMain ${TestType} ${TestBitStream} | 92 | runMain ${TestType} ${TestBitStream} |
| 51 | | 93 | |
| 52 | | | |
| 53 | | | |
| 54 | | | |
| 55 | | | |