|
|
@@ -3,8 +3,9 @@ debugFileName=$progName"Debug.log" |
|
|
|
|
|
|
|
if [ "$(uname --operating-system)" == "Msys" ] |
|
|
|
then |
|
|
|
CFLAGS='-I.. -Wall -std=c++11 -DWIN32 -pthread -DDEBUG_LOG_FILE="' |
|
|
|
CFLAGS='-I.. -Wall -std=c++11 -DWIN32 -pthread -static -DDEBUG_LOG_FILE="' |
|
|
|
CFLAGS=$CFLAGS$(pwd)/$debugFileName\" |
|
|
|
CFLAGS='-I.. -Wall -std=c++11 -DWIN32 -pthread -static' |
|
|
|
else |
|
|
|
CFLAGS='-I.. -Wall -std=c++11 -g -O0 -pthread -DDEBUG_LOG_FILE="' |
|
|
|
CFLAGS=$CFLAGS$(pwd)/$debugFileName\" |
|
|
@@ -36,21 +37,29 @@ run_test() { |
|
|
|
if [ "$(uname --operating-system)" == "Msys" ] |
|
|
|
then |
|
|
|
|
|
|
|
sc create "Test Service" binPath= "$(pwd)/$progName.exe" |
|
|
|
sc create "Test Service" binPath= "$(pwd)/$progName.exe" > /dev/null 2>&1 |
|
|
|
|
|
|
|
sc start "Test Service" "$(pwd)/$logFile" |
|
|
|
#echo "Starting at "$(date +"%H:%M:%S.%N") |
|
|
|
sc start "Test Service" "$(pwd)/$logFile" $message > /dev/null 2>&1 |
|
|
|
#echo "Sleeping 1 s at "$(date +"%H:%M:%S.%N") |
|
|
|
sleep 1 |
|
|
|
|
|
|
|
sc pause "Test Service" "$(pwd)/$logFile" |
|
|
|
#echo "Pausing at "$(date +"%H:%M:%S.%N") |
|
|
|
sc pause "Test Service" > /dev/null 2>&1 |
|
|
|
#echo "Sleeping 2 s at "$(date +"%H:%M:%S.%N") |
|
|
|
sleep 2 |
|
|
|
|
|
|
|
sc continue "Test Service" "$(pwd)/$logFile" |
|
|
|
#echo "Continuing at "$(date +"%H:%M:%S.%N") |
|
|
|
sc continue "Test Service" > /dev/null 2>&1 |
|
|
|
#echo "Sleeping 2 s at "$(date +"%H:%M:%S.%N") |
|
|
|
sleep 2 |
|
|
|
|
|
|
|
sc stop "Test Service" |
|
|
|
#echo "Stopping at "$(date +"%H:%M:%S.%N") |
|
|
|
sc stop "Test Service" > /dev/null 2>&1 |
|
|
|
#echo "Returned at "$(date +"%H:%M:%S.%N") |
|
|
|
sleep 1 |
|
|
|
|
|
|
|
sc delete "Test Service" |
|
|
|
sc delete "Test Service" > /dev/null 2>&1 |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
@@ -114,21 +123,28 @@ return 0 |
|
|
|
|
|
|
|
stat=0 |
|
|
|
|
|
|
|
# Normal test. |
|
|
|
# Run tests. |
|
|
|
run_test Nominal |
|
|
|
nominal_status=$? |
|
|
|
|
|
|
|
# Pause timeout. |
|
|
|
run_test Pause |
|
|
|
pause_status=$? |
|
|
|
if [ "$(uname --operating-system)" != "Msys" ] |
|
|
|
then |
|
|
|
# Pause timeout. |
|
|
|
run_test Pause |
|
|
|
pause_status=$? |
|
|
|
|
|
|
|
# Resume timeout. |
|
|
|
run_test Resume |
|
|
|
resume_status=$? |
|
|
|
# Resume timeout. |
|
|
|
run_test Resume |
|
|
|
resume_status=$? |
|
|
|
|
|
|
|
# Stop timeout. |
|
|
|
run_test Stop |
|
|
|
stop_status=$? |
|
|
|
# Stop timeout. |
|
|
|
run_test Stop |
|
|
|
stop_status=$? |
|
|
|
else |
|
|
|
pause_status=0 |
|
|
|
resume_status=0 |
|
|
|
stop_status=0 |
|
|
|
fi |
|
|
|
|
|
|
|
if [ $nominal_status == "0" -a \ |
|
|
|
$pause_status == "0" -a \ |