diff --git a/C++/scripts/debug.sh b/C++/scripts/debug.sh index 3d84b84..d52d475 100755 --- a/C++/scripts/debug.sh +++ b/C++/scripts/debug.sh @@ -1,7 +1,15 @@ -#Compiles the entire program with debug flags then runs it in gdb. +#Compiles the entire program with debug flags then runs it in gdb. If the "test" argument is included, will try and run tests too (in the test folder) #C++ printf "Running program...\n\n\n" -if g++ $(find . -type f -name "*.cpp") -g ${CUSTOM_PARAMS} -o ${PROJECT_NAME}; then - gdb ./${PROJECT_NAME} "$@" +if [ "$1" = "test" ] +then + printf "Running tests...\n" + if g++ $(find . -type f -name "*.cpp") -g ${CUSTOM_PARAMS} -o ${PROJECT_NAME}; then + gdb ./${PROJECT_NAME} "$@" + fi +else + if g++ $(find . -type f -name "*.cpp -not -path "./test/*") -g ${CUSTOM_PARAMS} -o ${PROJECT_NAME}; then + gdb ./${PROJECT_NAME} "$@" + fi fi printf "\n\n" diff --git a/C++/scripts/md5 b/C++/scripts/md5 index 0dfebb2..d323858 100644 --- a/C++/scripts/md5 +++ b/C++/scripts/md5 @@ -1,7 +1,7 @@ build.sh:ca58f10d4e30d807987ea0105930ae51 - commit.sh:d03a46e721060c22ccb146e19d27e70a - -debug.sh:abbbb0c6d9f2409f3a90738ab3d9d44f - +debug.sh:131aac078fc1ae3c2278209a09e99a3d - lines.sh:3b907786f7fc9204025993016c9080de - -release.sh:a54e2002be80814cc1293a11dff4d116 - +release.sh:0a525311cc14b9c8aefc6f2b816129a1 - temp:d41d8cd98f00b204e9800998ecf8427e - -web.sh:3dcc2fe7e036359eedd257a864e9a1e1 - +web.sh:96f2c316536011a3defac50aecae487d - diff --git a/C++/scripts/release.sh b/C++/scripts/release.sh index b1620e8..807a40b 100755 --- a/C++/scripts/release.sh +++ b/C++/scripts/release.sh @@ -1,7 +1,7 @@ #Creates a release build that focuses on high runtime performance. #C++ printf "Running program...\n\n\n" -if g++ $(find . -type f -name "*.cpp") ${CUSTOM_PARAMS} -O3 -s -DNDEBUG -o ${PROJECT_NAME}; then +if g++ $(find . -type f -name "*.cpp" -not -path "./test/*") ${CUSTOM_PARAMS} -O3 -s -DNDEBUG -o ${PROJECT_NAME}; then ./${PROJECT_NAME} "$@" fi printf "\n\n" diff --git a/C++/scripts/web.sh b/C++/scripts/web.sh index 2e1a1f3..991d44f 100755 --- a/C++/scripts/web.sh +++ b/C++/scripts/web.sh @@ -1,9 +1,9 @@ #Compiles emscripten instance of this project for the web. #C++ if [ -d "assets" ]; then - em++ -std=c++17 -O2 -s ALLOW_MEMORY_GROWTH=1 -s MAX_WEBGL_VERSION=2 -s MIN_WEBGL_VERSION=2 -s USE_SDL_MIXER=2 -s USE_LIBPNG=1 $(find . -type f -name "*.cpp") -o ${PROJECT_NAME}.html -I pixelGameEngine.h --preload-file ./assets + em++ -std=c++17 -O2 -s ALLOW_MEMORY_GROWTH=1 -s MAX_WEBGL_VERSION=2 -s MIN_WEBGL_VERSION=2 -s USE_SDL_MIXER=2 -s USE_LIBPNG=1 $(find . -type f -name "*.cpp" -not -path "./test/*") -o ${PROJECT_NAME}.html -I pixelGameEngine.h --preload-file ./assets else - em++ -std=c++17 -O2 -s ALLOW_MEMORY_GROWTH=1 -s MAX_WEBGL_VERSION=2 -s MIN_WEBGL_VERSION=2 -s USE_SDL_MIXER=2 -s USE_LIBPNG=1 $(find . -type f -name "*.cpp") -o ${PROJECT_NAME}.html -I pixelGameEngine.h + em++ -std=c++17 -O2 -s ALLOW_MEMORY_GROWTH=1 -s MAX_WEBGL_VERSION=2 -s MIN_WEBGL_VERSION=2 -s USE_SDL_MIXER=2 -s USE_LIBPNG=1 $(find . -type f -name "*.cpp" -not -path "./test/*") -o ${PROJECT_NAME}.html -I pixelGameEngine.h fi cp buildtemplate.html ${PROJECT_NAME}.html