nightly.clean 5.57 KB
#!/bin/sh
#
# set tabsbtop=4

RST=`pwd`/`basename $1`.result
UPD=`pwd`/`basename $1`.update

echo "* * * Test run on `hostname` at `pwd` * * *" >> $RST
if [ "$SNPSLMD_LICENSE_FILE" = "" ]; then
	echo "#################################################" >> $RST
	echo "Test Failed : Please setup vcs environment first" >> $RST
	echo "#################################################" >> $RST
	exit 1
fi

cd ..
BB_PATH=`pwd`

######## update libbcppli #######
cd ${BB_PATH}/lib/libbcppli
#cvs update -df >> $UPD 2>&1
make 

######## update sim.ipc #########
cd ${BB_PATH}/hw2
#cvs update -df >> $UPD 2>&1
cd chip/vsim
make sim.ipc > /dev/null 2>&1 || {
   echo "Make sim.ipc Failed" >> $RST
}

echo "+ + + Nightly  Test  Start(component level) + + +"  >> $RST
date >> $RST

######## Component level test come first ##########
#### VI component
cd ${BB_PATH}/rdpsim/test/vi
make rtests > result 2>&1
grep errors result | grep -v "errors:[[:space:]]*0" && {
    echo "Failed: vi componet level error" >> $RST
    echo "please check file: ${BB_PATH}/rdpsim/test/vi/result" >> $RST
}

grep ERROR result | grep -v "NO ERRORS" && {
    echo "Failed: vi componet level error" >> $RST
    echo "please check file: ${BB_PATH}/rdpsim/test/vi/result" >> $RST
}

#RSP test

cd $BB_PATH
cd rspsim/vuregre
make clean

# SU TEST
make su >/dev/null 2>&1
grep "Failed :0" rsptest/SUTest/regression.log /dev/null 2>&1 && {
    echo "BCP rsp SU test passed" >> $RST
} || {
    echo "ERROR: BCP rsp SU test Failed" >> $RST
    echo "please refer to ${cur_path}/rsp/rspsim/vuregre/rsptest/SUTest/regression.log" >> $RST
}


# SU SINGLE STEP TEST
make su_single >/dev/null 2>&1
grep "Failed :0" rsptest/SUTestSingle/regression.log /dev/null 2>&1 && {
    echo "BCP rsp SU SINGLE STEP test passed" >> $RST
} || {
    echo "ERROR: BCP rsp SU SINGLE_STEP test Failed" >> $RST
    echo "please refer to ${cur_path}/rsp/rspsim/vuregre/rsptest/SUTestSingle/regression.log" >> $RST
}


# VU TEST
make vu >/dev/null 2>&1
grep "Failed :0" rsptest/VUTest/regression.log /dev/null 2>&1 && {
    echo "BCP rsp VU test passed" >> $RST
} || {
    echo "ERROR: BCP rsp VU test Failed"
    echo "please refer to ${cur_path}/rsp/rspsim/vuregre/rsptest/VUTest/regression.log"  >> $RST
}

# VU SINGLE STEP TEST
make vu_single >/dev/null 2>&1
grep "Failed :0" rsptest/VUTestSingle/regression.log > /dev/null 2>&1 && {
    echo "BCP rsp VU Single step test passed"  >> $RST
} || {
    echo "ERROR: BCP rsp VU single step test Failed"  >> $RST
    echo "please refer to ${cur_path}/rsp/rspsim/vuregre/rsptest/VUTestSingle/regression.log"  >> $RST
}

export IOSIM_SERVER=127.0.0.1
export IOSIM_PORT=6767
###### check out new iosim tests ######
cd ${BB_PATH}/include
#cvs update -df >>$UPD 2>&1
make headers

cd ${BB_PATH}/iosim
#cvs update -df >>$UPD 2>&1
cd src
make 

###### START SIM.IPC ########
cd ${BB_PATH}/hw2/chip/vsim
./sim.ipc +vcs+lic+wait &

cd ${BB_PATH}/tests
echo "+ + + Nightly  Test  Start(base on ipc simulator) + + +"  >> $RST
date  >> $RST

../iosim/src/iosim -f ../iosim/test/bcp_init.tst

# IOSIM AI test
echo 
echo "Start BCP AI test "
../iosim/src/iosim	-f ../iosim/test/bcp_ai.tst > tmp.$$ 2>&1
grep -i "Fail" tmp.$$ && {
	echo "AI IOSIM test failed" >> $RST
} || {
    echo "AI IOSIM test passed"  >> $RST
}
cat tmp.$$

#IOSIM ri test
../iosim/src/iosim	-f ../iosim/test/bcp_ri.tst > tmp.$$ 2>&1
grep -i "Fail" tmp.$$ && {
    echo "RI IOSIM test failed" >> $RST
} || {
    echo "RI IOSIM test passed"  >> $RST
}
cat tmp.$$

#IOSIM sp test
../iosim/src/iosim -f ../iosim/test/bcp_sp.tst > tmp.$$ 2>&1
grep -i "Fail"  tmp.$$ && {
    echo "SP IOSIM test failed" >> $RST
} || {
    echo "SP IOSIM test passed"  >> $RST
}
cat tmp.$$
rm -rf tmp

##### Iosim Vi test ######
### 3 test failed
[ -d ${BB_PATH}/rdpsim/backend/test/Iosim/OutData ] || {
   mkdir -p ${BB_PATH}/rdpsim/backend/test/Iosim/OutData
}
cd ${BB_PATH}/rdpsim/backend/test/Iosim/OutData
rm -rf *
cd ..
make clean
make allvi_clean
grep -v equate OutData/Results && {
   echo "Failed: Vi iosim test error." >> $RST
} || {
   echo "VI IOSIM test passed"  >> $RST
}

##### rsp iosim test ######
#  dma pin pin_single
#

cd $BB_PATH
cd rspsim/vuregre

# DMA TEST
make dma >/dev/null 2>&1
grep "Failed" rsptest/dmatest/test.result > /dev/null 2>&1 && {
    echo "ERROR: BCP rsp DMA test Failed"  >> $RST
} || {
    echo "BCP rsp DMA test passed" >> $RST
}

# PIN TEST
make pin >/dev/null 2>&1
grep "Failed" rsptest/pinTest/test.result > /dev/null 2>&1 && {
    echo "ERROR: BCP rsp PIN test Failed" >> $RST
} || {
    echo "BCP rsp PIN test passed" >> $RST
}

# PIN SINGLE STEP TEST
make pin_single >/dev/null 2>&1
grep "Failed" rsptest/pinTestSingle/test.result > /dev/null 2>&1 && {
    echo "ERROR: BCP rsp pin Single step test Failed" >> $RST
} || {
    echo "BCP rsp PIN Single step test passed" >> $RST
}
cd $BB_PATH/iosim
./src/iosim -f ./test/bcp_quit.tst

###### VI iorand test
cd $BB_PATH
cd iosim/data/dma80
make >/dev/null 2>&1
make vitest > test.result 2>&1
count=`grep "total error = 0" test.result | wc -l`
if [ $count -eq 6 ]; then
   echo "VI IORAND test passed" >> $RST
else
   echo "ERROR: Vi IORAND test Failed" >> $RST
fi

##### rdp iosim test #####
# test039_tex cov bit failed 
#
# Make dp test one by one again
#
cd ${BB_PATH}/rdpsim/test/rdp
rm -f Outdata/*.cov
rm -f Outdata/*.rgb
rm -f Outdata/*.z
rm -f result.diff
make nightly_rdp_io > result 2>&1
make image_diff_hwio >> result.diff
grep -i error result.diff | grep -v "ERROR: Image files OutData/test039_tex_hw_0.cov" && {
   echo "Failed: rdp iosim error" >> $RST
} || {
   echo "Succeed: rdp iosim test passed" >> $RST
}

echo "+ + + Nightly  Test  End + + +" >> $RST
date >> $RST