From 3fa480dd87eab39de0cb292687ee4f36611906c6 Mon Sep 17 00:00:00 2001 From: albaropereyra22 <141711575+albaropereyra22@users.noreply.github.com> Date: Thu, 10 Aug 2023 21:00:23 -0700 Subject: [PATCH] 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. --- test.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test.sh b/test.sh index e16184b3..91b3e423 100755 --- a/test.sh +++ b/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"