aboutsummaryrefslogtreecommitdiff
path: root/mvn-test.sh
blob: f85fd3ddf6c9f3b4e95e12f3b9b8b3f1a139e89b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

workingdir=`9p read acme/$winid/tag | head -1 | grep -oE '^/.*src' | sed 's/src//'`
cd $workingdir

tests="$1"

if [ -z "$1" ]; then
    IFS=''
    while read -r LINE || [ -n "$LINE" ]; do
        tests="$LINE"
        break
    done
    classname=`9p read acme/$winid/tag | grep -oE '[A-Za-z]*\.java' | sed 's/.java//' | head -1`
    if [ ! -z $classname ] && [ ! -z $tests ] && [ $tests != $classname ]; then
        tests=$classname'#'$tests
    fi
fi


if [ ! -z "$tests" ]; then
    mvn test -DtrimStackTrace=false -Dtest=$tests
else
    mvn test -DtrimStackTrace=false
fi