SeasonI/C++/scripts/build.sh
sigonasr2 5827bcb8a6 Test suite setup preparation
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
2022-10-23 02:47:09 -05:00

16 lines
539 B
Bash
Executable File

#Compiles the entire program then runs it, producing an executable. If the "test" argument is included, will try and run tests too (in the test folder)
#C++
printf "Running program...\n\n\n"
if [ "$1" = "test" ]
then
printf "Running tests...\n"
if g++ $(find . -type f -name "*.cpp") ${CUSTOM_PARAMS} -o ${PROJECT_NAME}; then
./${PROJECT_NAME} "$@"
fi
else
if g++ $(find . -type f -name "*.cpp" -not -path "./test/*") ${CUSTOM_PARAMS} -o ${PROJECT_NAME}; then
./${PROJECT_NAME} "$@"
fi
fi
printf "\n\n"