hack/run.sh

30 lines
850 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
if [ $1 = "test" ]; then
echo ""
meson test $2 -C build
echo ""
awk '/^-------------------------------------------------------------------------------/{flag=1} /===============================================================================/{flag=0} flag' ./build/meson-logs/testlog.txt
elif [ $1 = "tests" ]; then
echo ""
meson test -C build
echo ""
# awk '/^-------------------------------------------------------------------------------/{flag=1} /===============================================================================/{flag=0} flag' ./build/meson-logs/testlog.txt
elif [ -d "build" ]; then
2024-05-15 18:52:32 +03:00
run
else
command meson setup build
run
fi