2022-11-17 20:16:47 -06:00
#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"
2022-11-23 22:51:30 -06:00
output = $( dpkg -l | grep libx11-dev)
if [ [ -z $output ] ]
then
sudo apt install libx11-dev libpulse-dev mesa-common-dev libpng-dev
fi
2022-11-17 20:16:47 -06:00
if [ " $1 " = "test" ]
then
printf "Running tests...\n"
echo "#define TEST_SUITE" > ./test/test.h
if g++ $( find . -type f -name "*.cpp" ) ${ CUSTOM_PARAMS } -o ${ PROJECT_NAME } ; then
./${ PROJECT_NAME } " $@ "
fi
else
echo "" > ./test/test.h
if g++ $( find . -type f -name "*.cpp" -not -path "./test/*" ) ${ CUSTOM_PARAMS } -o ${ PROJECT_NAME } ; then
./${ PROJECT_NAME } " $@ "
fi
fi
printf "\n\n"