Skip to content

Commit 57feaea

Browse files
authoredJul 21, 2021
Merge pull request #6 from minoritea/minoritea-patch-4
Update help and README.md
2 parents 9ab12ee + 3430f4e commit 57feaea

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed
 

‎README.md

+11-6
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,27 @@ go-splittestgen splits test cases into some subsets and print commands to run on
77

88
## Usage
99

10+
`go-splittestgen` is parsing output of `go test -list` from stdin(in the usual case, it is piped),
11+
generating test commands from the test cases divided by a number,
12+
and then printing one of the commands by an index number.
13+
14+
if you want to run the generated test commands immediately, just pipe it to a shell.
15+
1016
```bash
1117
# print test commands
12-
$ go test ./... -list . | go-splittestgen
18+
$ go test ./... -list . | go-splittestgen -total 3 -index 2
1319

1420
# execute tests
15-
$ go test ./... -list . | go-splittestgen | sh
21+
$ go test ./... -list . | go-splittestgen -total 3 -index 2 | sh
1622
```
1723

18-
1924
### Options
2025

2126
```
22-
-index uint
23-
index of parallel testing(default 0)
27+
-index uint
28+
index of test processes (default 0, must be less than the total number)
2429
-total uint
25-
process num of parallel testing (default 1)
30+
total number of test processes (default 1)
2631
```
2732

2833
## Installation

‎cmd/go-splittestgen/main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import (
1212
)
1313

1414
func main() {
15-
index := flag.Uint("index", 0, "index of parallel testing")
16-
total := flag.Uint("total", 1, "process num of parallel testing")
15+
total := flag.Uint("total", 1, "total number of test processes")
16+
index := flag.Uint("index", 0, "index of test processes (default 0, must be less than the total number)")
1717
flag.Parse()
1818

1919
input, err := ioutil.ReadAll(os.Stdin)

0 commit comments

Comments
 (0)
Please sign in to comment.