|
@@ -8,11 +8,12 @@ printHelpExit() {
|
|
|
echo "$0 build | build everything"
|
|
|
echo "$0 install | move build results into the install folder"
|
|
|
echo "$0 test | run the tests"
|
|
|
+ echo "$0 valgrind | run the tests with valgrind"
|
|
|
echo "$0 coverage | generate code coverage"
|
|
|
echo "$0 performance | run the performance tests"
|
|
|
echo "$0 final | find classes / structs which are not final"
|
|
|
echo "$0 macro | find macros without CORE"
|
|
|
- echo "$0 include | find system includes in header files"
|
|
|
+ echo "$0 include | find system includes"
|
|
|
echo "$0 time | check build time"
|
|
|
exit 0
|
|
|
}
|
|
@@ -27,10 +28,12 @@ fi
|
|
|
# tasks
|
|
|
build=false
|
|
|
test=false
|
|
|
+valgrind=false
|
|
|
performance=false
|
|
|
time=false
|
|
|
install=false
|
|
|
coverage=false
|
|
|
+profile=$(cat profile)
|
|
|
|
|
|
# parsing
|
|
|
if [ "$task" = "clean" ]; then
|
|
@@ -48,6 +51,9 @@ elif [ "$task" = "coverage" ]; then
|
|
|
elif [ "$task" = "test" ]; then
|
|
|
build=true
|
|
|
test=true
|
|
|
+elif [ "$task" = "valgrind" ]; then
|
|
|
+ build=true
|
|
|
+ valgrind=true
|
|
|
elif [ "$task" = "performance" ]; then
|
|
|
build=true
|
|
|
performance=true
|
|
@@ -55,14 +61,18 @@ elif [ "$task" = "time" ]; then
|
|
|
build=true
|
|
|
time=true
|
|
|
elif [ "$task" = "final" ]; then
|
|
|
- grep -r " class" src | grep -v -E 'final|enum|.git' || true
|
|
|
- grep -r " struct" src | grep -v -E 'final|enum|.git' || true
|
|
|
+ grep -r " class" src include | grep -v -E 'final|enum|.git' || true
|
|
|
+ grep -r " struct" src include | grep -v -E 'final|enum|.git' || true
|
|
|
exit 0
|
|
|
elif [ "$task" = "macro" ]; then
|
|
|
- grep -r "#define" src | grep -v " CORE" || true
|
|
|
+ grep -r "#define" src include | grep -v " CORE" || true
|
|
|
exit 0
|
|
|
elif [ "$task" = "include" ]; then
|
|
|
- grep -r "#include <" src | grep "\.hpp" || true
|
|
|
+ echo "System includes in header files:"
|
|
|
+ grep -r "#include <" src include | grep "\.hpp" || true
|
|
|
+ echo "-------------------------------------------------"
|
|
|
+ echo "System includes in source files:"
|
|
|
+ grep -r "#include <" src include | grep "\.cpp" || true
|
|
|
exit 0
|
|
|
else
|
|
|
echo "unknown task"
|
|
@@ -72,7 +82,8 @@ fi
|
|
|
# task execution
|
|
|
if $build; then
|
|
|
if [ ! -e build ]; then
|
|
|
- cmake -B build -S . -G Ninja -DCMAKE_INSTALL_PREFIX=./install
|
|
|
+ cmake -B build -S . -G Ninja -DCMAKE_INSTALL_PREFIX=./install \
|
|
|
+ -DCMAKE_BUILD_TYPE=$profile
|
|
|
fi
|
|
|
ninja -C build
|
|
|
fi
|
|
@@ -81,7 +92,12 @@ if $install; then
|
|
|
fi
|
|
|
if $test; then
|
|
|
cd build
|
|
|
- ./test || true
|
|
|
+ ./test light || true
|
|
|
+ cd ..
|
|
|
+fi
|
|
|
+if $valgrind; then
|
|
|
+ cd build
|
|
|
+ valgrind ./test light valgrind || true
|
|
|
cd ..
|
|
|
fi
|
|
|
if $performance; then
|