File tree 8 files changed +64
-12
lines changed
8 files changed +64
-12
lines changed Original file line number Diff line number Diff line change @@ -28,3 +28,4 @@ vendor/
28
28
29
29
# Code coverage
30
30
coverage. *
31
+ coverage /
Original file line number Diff line number Diff line change 1
- GO_TEST =cd ./sh && sh ./go.test.sh
2
- GO_TEST_WITH_REAL_DB =$(GO_TEST ) --tags=with_real_db
3
-
4
1
DIR =$(PWD )
5
- COVERAGE_FILE =` echo $( DIR) /coverage.out `
2
+
3
+ GO_TEST =cd ./sh && bash ./go.test.sh
4
+ GO_TEST_COVERAGE =cd ./sh && bash ./go.test.coverage.sh
5
+
6
+ GO_TEST_WITH_REAL_DB=--tags =with_real_db
6
7
7
8
test :
8
9
$(GO_TEST )
9
10
10
11
test.with_real_db :
11
- $(GO_TEST_WITH_REAL_DB )
12
+ $(GO_TEST ) $( GO_TEST_WITH_REAL_DB )
12
13
13
- # TODO see in https://gist.github.com/skarllot/13ebe8220822bc19494c8b076aabe9fc
14
14
test.coverage :
15
- $(GO_TEST ) -covermode=atomic -coverprofile= $( COVERAGE_FILE )
15
+ $(GO_TEST_COVERAGE )
16
16
17
17
test.coverage.with_real_db :
18
- $(GO_TEST_WITH_REAL_DB ) -covermode=atomic -coverprofile= $( COVERAGE_FILE )
18
+ $(GO_TEST_COVERAGE ) $( GO_TEST_WITH_REAL_DB )
19
19
20
20
fmt :
21
21
go fmt ./...
Original file line number Diff line number Diff line change
1
+ cd ./module1/cmd
2
+
3
+ mkdir -p codecov
4
+
5
+ go build -cover -o run.exe .
6
+ GOCOVERDIR=./codecov ./run.exe
7
+
8
+ # go test ./... -covermode=atomic -coverprofile=coverage.out
9
+
10
+ cd ../../module2/cmd
11
+
12
+ mkdir -p codecov
13
+
14
+ go build -cover -o run.exe .
15
+ GOCOVERDIR=./codecov ./run.exe
16
+
17
+ # go test ./... -covermode=atomic -coverprofile=coverage.out
18
+
19
+ cd ../../
20
+
21
+ go tool covdata textfmt -i=module1/cmd/codecov,module2/cmd/codecov -o ./output.out
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
1
3
cd ../
2
4
3
5
ROOT=$( pwd)
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
1
3
cd ../
2
4
3
5
ROOT=$( pwd)
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ DIR=$( pwd)
4
+ ROOT=" $( pwd) /.."
5
+
6
+ COVERAGE_TEST=" -cover -covermode=atomic -test.gocoverdir=$ROOT /coverage"
7
+
8
+ drivers=(" $( $DIR /utils/drivers.sh) " )
9
+
10
+ mkdir -p $ROOT /coverage
11
+
12
+ ./go.test.sh $COVERAGE_TEST " $@ "
13
+
14
+ drivers_i=" ${drivers// // coverage,} "
15
+ go tool covdata textfmt -i=" $ROOT /coverage" -o " $ROOT /coverage.out"
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ DIR=$( pwd)
4
+
5
+ drivers=(" $( $DIR /utils/drivers.sh) " )
6
+
1
7
cd ../
2
8
3
9
ROOT=$( pwd)
@@ -9,16 +15,16 @@ golist() {
9
15
gotest () {
10
16
cd $driver
11
17
12
- go test $( golist) -race " $@ "
18
+ go test $( golist) " $@ "
13
19
14
20
cd $ROOT
15
21
}
16
22
17
- go test $( golist) -race " $@ "
23
+ go test $( golist) $@ &
18
24
19
- for driver in ./ drivers/ * ; do
25
+ for driver in $ drivers; do
20
26
if [ -d " $driver " ]; then
21
- gotest " $@ " &
27
+ gotest $@ &
22
28
fi
23
29
done
24
30
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ cd ../
4
+
5
+ echo drivers/*
You can’t perform that action at this time.
0 commit comments