Skip to content

Commit 3c938b5

Browse files
committed
Include included tests in test count
1 parent 4a2376e commit 3c938b5

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

include/hello.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
--echo Hello from the included file
2+
SELECT 1

r/source.result

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
first line
22
Hello from the included file
3+
SELECT 1
4+
1
5+
1
36
last line

src/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ func (t *tester) runQueries(queries []query) (int, error) {
425425
if t.enableConcurrent {
426426
concurrentQueue = append(concurrentQueue, q)
427427
} else if err = t.execute(q); err != nil {
428-
err = errors.Annotate(err, fmt.Sprintf("sql:%v", q.Query))
428+
err = errors.Annotate(err, fmt.Sprintf("sql:%v line:%s", q.Query, q.location()))
429429
t.addFailure(&testSuite, &err, testCnt)
430430
return testCnt, err
431431
}
@@ -549,10 +549,11 @@ func (t *tester) runQueries(queries []query) (int, error) {
549549
if err != nil {
550550
return testCnt, errors.Annotate(err, fmt.Sprintf("error loading queries from %s", fileName))
551551
}
552-
_, err = t.runQueries(includedQueries)
552+
includeCnt, err := t.runQueries(includedQueries)
553553
if err != nil {
554554
return testCnt, err
555555
}
556+
testCnt += includeCnt
556557
default:
557558
log.WithFields(log.Fields{"command": q.firstWord, "arguments": q.Query, "line": q.location()}).Warn("command not implemented")
558559
}

0 commit comments

Comments
 (0)