Skip to content

Commit f43a339

Browse files
add sytest-coverage debug flag (#512)
1 parent 5c243d9 commit f43a339

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

cmd/sytest-coverage/main.go

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package main
55

66
import (
7+
"flag"
78
"fmt"
89
"go/parser"
910
"go/token"
@@ -23,11 +24,23 @@ var (
2324
testFilenameRegexp = regexp.MustCompile(`/tests/(.*)\.pl`)
2425
)
2526

27+
var debug bool
28+
var verbose bool
29+
30+
func init() {
31+
debugFlag := flag.Bool("d", false, "debug mode")
32+
verboseFlag := flag.Bool("v", false, "verbose mode")
33+
34+
flag.Parse()
35+
36+
debug = *debugFlag
37+
verbose = *verboseFlag
38+
}
39+
2640
// Maps test names to filenames then looks for:
2741
// sytest: $test_name
2842
// in all files in ./tests - if there's a match it marks that test as converted.
2943
func main() {
30-
verbose := len(os.Args) == 2 && os.Args[1] == "-v"
3144

3245
filenameToTestName, testNameToFilename := getList()
3346

@@ -53,6 +66,9 @@ func main() {
5366
for _, line := range lines {
5467
_, ok := testNameToFilename[line]
5568
if !ok {
69+
if debug && strings.Contains(line, "sytest:") {
70+
fmt.Printf("Found unrecognised sytest marker in %s: %v\n", path, line)
71+
}
5672
continue
5773
}
5874
convertedTests[line] = true

sytest.ignored.list

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ Room initialSync
4040
Room initialSync with limit=0 gives no messages
4141
Read receipts are visible to /initialSync
4242
Newly created users see their own presence in /initialSync (SYT-34)
43-
Push rules come down in an initial /sync
4443
Guest user calling /events doesn't tightloop
4544
Guest user cannot call /events globally
4645
!53groups

0 commit comments

Comments
 (0)