Update test.sh appended prefix "X" to string variable comparisons (#1711)
Added the prefix "X" to string variable comparisons because it is the convention mentioned in the book with the turtle. This is done because comparing a variable to a - causes issues.
This commit is contained in:
parent
56f620717e
commit
3fa480dd87
16
test.sh
16
test.sh
|
@ -4,7 +4,7 @@ echo "First arg:"
|
|||
echo $1
|
||||
|
||||
os='linux'
|
||||
if [ "$1" = "-w" ]; then
|
||||
if [ "X$1" = "X-w" ]; then
|
||||
os='windows'
|
||||
fi
|
||||
|
||||
|
@ -12,7 +12,7 @@ src_dir=$(pwd)
|
|||
|
||||
echo "OS:" $os
|
||||
|
||||
if [ $os = "linux" ]; then
|
||||
if [ "X$os" = "Xlinux" ]; then
|
||||
drogon_ctl_exec=$(pwd)/build/drogon_ctl/drogon_ctl
|
||||
else
|
||||
drogon_ctl_exec=$(pwd)/build/drogon_ctl/Debug/drogon_ctl.exe
|
||||
|
@ -21,7 +21,7 @@ fi
|
|||
echo ${drogon_ctl_exec}
|
||||
cd build/lib/tests/
|
||||
|
||||
if [ $os = "windows" ]; then
|
||||
if [ "X$os" = "Xwindows" ]; then
|
||||
cd Debug
|
||||
fi
|
||||
|
||||
|
@ -42,7 +42,7 @@ case $(nproc) in
|
|||
;;
|
||||
esac
|
||||
|
||||
if [ $os = "linux" ]; then
|
||||
if [ "X$os" = "Xlinux" ]; then
|
||||
if [ -f /bin/ninja ]; then
|
||||
cmake_gen='-G Ninja'
|
||||
else
|
||||
|
@ -51,7 +51,7 @@ if [ $os = "linux" ]; then
|
|||
fi
|
||||
|
||||
#Make integration_test_server run as a daemon
|
||||
if [ $os = "linux" ]; then
|
||||
if [ "X$os" = "Xlinux" ]; then
|
||||
sed -i -e "s/\"run_as_daemon.*$/\"run_as_daemon\": true\,/" config.example.json
|
||||
fi
|
||||
sed -i -e "s/\"relaunch_on_error.*$/\"relaunch_on_error\": true\,/" config.example.json
|
||||
|
@ -131,7 +131,7 @@ cd ../views
|
|||
echo "Hello, world!" >>hello.csp
|
||||
|
||||
cd ../build
|
||||
if [ $os = "windows" ]; then
|
||||
if [ "X$os" = "Xwindows" ]; then
|
||||
cmake_gen="$cmake_gen -DCMAKE_TOOLCHAIN_FILE=$src_dir/conan_toolchain.cmake \
|
||||
-DCMAKE_PREFIX_PATH=$src_dir/install \
|
||||
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW \
|
||||
|
@ -151,7 +151,7 @@ if [ $? -ne 0 ]; then
|
|||
exit -1
|
||||
fi
|
||||
|
||||
if [ $os = "linux" ]; then
|
||||
if [ "X$os" = "Xlinux" ]; then
|
||||
if [ ! -f "drogon_test" ]; then
|
||||
echo "Failed to build drogon_test"
|
||||
exit -1
|
||||
|
@ -166,7 +166,7 @@ fi
|
|||
cd ../../
|
||||
rm -rf drogon_test
|
||||
|
||||
if [ "$1" = "-t" ]; then
|
||||
if [ "X$1" = "X-t" ]; then
|
||||
#unit testing
|
||||
cd ../../
|
||||
echo "Unit testing"
|
||||
|
|
Loading…
Reference in New Issue