#!/bin/zsh PROJECT_NAME=$(basename $PWD) run() { command meson compile -C build cd build ./bin/$PROJECT_NAME cd .. } # 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 run else command meson setup build run fi