[NOBIN] Added a script for regression tests

This commit is contained in:
hasherezade
2019-11-23 20:56:15 +01:00
parent c47eb3aad5
commit 623a2c81ba
3 changed files with 33 additions and 0 deletions
+1
View File
@@ -1,4 +1,5 @@
build/
build_qt5/
build_qt4/
test_cases/
+5
View File
@@ -36,5 +36,10 @@ if(CMD_BUILD_TESTING)
# 0) does the application run
add_test (TestRuns ${CMAKE_BINARY_DIR}/bearcommander)
set_tests_properties(TestRuns PROPERTIES PASS_REGULAR_EXPRESSION "Bearparser")
# 1) regression tests for the commander
add_test (TestRegression ${CMAKE_SOURCE_DIR}/test.sh ${CMAKE_SOURCE_DIR})
set_tests_properties(TestRegression PROPERTIES PASS_REGULAR_EXPRESSION "All passed")
endif()
Executable
+27
View File
@@ -0,0 +1,27 @@
#!/bin/bash
START_DIR=$(pwd)
SOURCE_DIR=$1
cd "$SOURCE_DIR"
echo "Source Dir: ""$SOURCE_DIR"
rm -rf test_cases
mkdir test_cases
cd test_cases
wget "https://drive.google.com/uc?export=download&id=1johP6rf7iS8-mi6xrT5mCX4wnbKk8rq8" -O test_cases.zip
7z x test_cases.zip
rm *.zip
cd ..
BCMD_DIR=$(pwd)/build/
cd test_cases
chmod +x test1.sh
./test1.sh "$BCMD_DIR" "info" "x64/QtGui4"
if [[ "$?" != 0 ]]; then
exit 1
fi
./test1.sh "$BCMD_DIR" "winfo0" "x64/QtGui4"
if [[ "$?" != 0 ]]; then
exit 1
fi
echo "All passed"
cd "$START_DIR"