Skip to content

Commit 45fe2fb

Browse files
committed
Add more logging
1 parent b6c5399 commit 45fe2fb

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

pkg/runtime/runtime.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ func runTest(test TestCase) TestResult {
157157
}
158158

159159
log.Println("title: '"+test.Title+"'", " Command: ", cut.Cmd)
160+
log.Println("title: '"+test.Title+"'", " Directory: ", cut.Dir)
161+
log.Println("title: '"+test.Title+"'", " Env: ", cut.Env)
160162

161163
// Write test result
162164
test.Result = CommandResult{

pkg/runtime/validator.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package runtime
33
import (
44
"fmt"
55
"github.com/SimonBaeumer/commander/pkg/matcher"
6+
"log"
67
"strings"
78
)
89

@@ -24,7 +25,9 @@ func newValidationResult(m matcher.MatcherResult) ValidationResult {
2425
func Validate(test TestCase) TestResult {
2526
equalMatcher := matcher.NewMatcher(matcher.Equal)
2627

28+
log.Println("title: '"+test.Title+"'", " Stdout-Expected: ", test.Expected.Stdout)
2729
matcherResult := validateExpectedOut(test.Result.Stdout, test.Expected.Stdout)
30+
log.Println("title: '"+test.Title+"'", " Stdout-Result: ", matcherResult.Success)
2831
if !matcherResult.Success {
2932
return TestResult{
3033
ValidationResult: newValidationResult(matcherResult),
@@ -33,7 +36,9 @@ func Validate(test TestCase) TestResult {
3336
}
3437
}
3538

39+
log.Println("title: '"+test.Title+"'", " Stderr-Expected: ", test.Expected.Stderr)
3640
matcherResult = validateExpectedOut(test.Result.Stderr, test.Expected.Stderr)
41+
log.Println("title: '"+test.Title+"'", " Stderr-Result: ", matcherResult.Success)
3742
if !matcherResult.Success {
3843
return TestResult{
3944
ValidationResult: newValidationResult(matcherResult),
@@ -42,7 +47,9 @@ func Validate(test TestCase) TestResult {
4247
}
4348
}
4449

50+
log.Println("title: '"+test.Title+"'", " Exit-Expected: ", test.Expected.ExitCode)
4551
matcherResult = equalMatcher.Match(test.Result.ExitCode, test.Expected.ExitCode)
52+
log.Println("title: '"+test.Title+"'", " Exit-Result: ", matcherResult.Success)
4653
if !matcherResult.Success {
4754
return TestResult{
4855
ValidationResult: newValidationResult(matcherResult),

0 commit comments

Comments
 (0)