Skip to content

Commit

Permalink
Include included tests in test count
Browse files Browse the repository at this point in the history
  • Loading branch information
dveeden committed Jul 26, 2024
1 parent 4a2376e commit 3c938b5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions include/hello.inc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
--echo Hello from the included file
SELECT 1
3 changes: 3 additions & 0 deletions r/source.result
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
first line
Hello from the included file
SELECT 1
1
1
last line
5 changes: 3 additions & 2 deletions src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ func (t *tester) runQueries(queries []query) (int, error) {
if t.enableConcurrent {
concurrentQueue = append(concurrentQueue, q)
} else if err = t.execute(q); err != nil {
err = errors.Annotate(err, fmt.Sprintf("sql:%v", q.Query))
err = errors.Annotate(err, fmt.Sprintf("sql:%v line:%s", q.Query, q.location()))
t.addFailure(&testSuite, &err, testCnt)
return testCnt, err
}
Expand Down Expand Up @@ -549,10 +549,11 @@ func (t *tester) runQueries(queries []query) (int, error) {
if err != nil {
return testCnt, errors.Annotate(err, fmt.Sprintf("error loading queries from %s", fileName))
}
_, err = t.runQueries(includedQueries)
includeCnt, err := t.runQueries(includedQueries)
if err != nil {
return testCnt, err
}
testCnt += includeCnt
default:
log.WithFields(log.Fields{"command": q.firstWord, "arguments": q.Query, "line": q.location()}).Warn("command not implemented")
}
Expand Down

0 comments on commit 3c938b5

Please sign in to comment.