hack/run.sh

30 lines
862 B
Bash
Raw Normal View History

2024-05-15 18:52:32 +03:00
#!/bin/zsh
PROJECT_NAME=$(basename $PWD)
run() {
command meson compile -C build
2025-01-03 10:25:22 +03:00
cd build
./bin/$PROJECT_NAME
cd ..
2024-05-15 18:52:32 +03:00
}
2025-01-03 10:25:22 +03:00
# run test [name_test]
# example: run test pattrens
2025-01-03 10:58:50 +03:00
if [[ "$1" == "test" ]]; then
2025-01-03 10:25:22 +03:00
echo ""
meson test $2 -C build
echo ""
awk '/^-------------------------------------------------------------------------------/{flag=1} /===============================================================================/{flag=0} flag' ./build/meson-logs/testlog.txt
2025-01-03 10:58:50 +03:00
elif [[ "$1" == "tests" ]]; then
2025-01-03 10:25:22 +03:00
echo ""
meson test -C build
echo ""
# awk '/^-------------------------------------------------------------------------------/{flag=1} /===============================================================================/{flag=0} flag' ./build/meson-logs/testlog.txt
2025-01-03 10:58:50 +03:00
elif [[ -d "build" ]]; then
2024-05-15 18:52:32 +03:00
run
else
command meson setup build
run
fi