Files
GitJournal/scripts/watch_test.sh
2021-02-03 17:10:40 +01:00

19 lines
549 B
Bash
Executable File

#!/usr/bin/env bash
set -eu
# Runs the test which is marked with solo
FILENAME=$(grep -rn solo test/* | awk -F ':' '{ print $1 }')
LINE_NUM=$(grep -rn solo test/* | awk -F ':' '{ print $2 }')
FUNC_NAME=""
while [[ -z $FUNC_NAME ]]; do
LINE_NUM=$((LINE_NUM - 1))
LINE=$(sed -n ${LINE_NUM}p test/autocompletion/tags_test.dart)
FUNC_NAME=$(echo "$LINE" | sed -n -E "s#test\([\"'](.+)[\"'].*#\1#p" | xargs)
done
echo flutter test --name "$FUNC_NAME" "$FILENAME"
find . -name '*.dart' | entr flutter test --name "$FUNC_NAME" "$FILENAME"