diff options
author | Flu0r1ne <flur01ne@flu0r1ne.net> | 2021-08-13 17:03:57 -0500 |
---|---|---|
committer | Flu0r1ne <flur01ne@flu0r1ne.net> | 2021-08-13 17:03:57 -0500 |
commit | 9954b5fa87f74c035739159f4bb831900e5e35be (patch) | |
tree | 7e5a005b4fd0a502bc73a9d53a825324226f6494 | |
parent | 3337257fe24b67871406217e98862d34647dd725 (diff) | |
download | planr-9954b5fa87f74c035739159f4bb831900e5e35be.tar.xz planr-9954b5fa87f74c035739159f4bb831900e5e35be.zip |
Fenced test & compilation output
-rw-r--r-- | adapters/gtest/results.go | 2 | ||||
-rw-r--r-- | cmd/planr/sub/cli.go | 34 |
2 files changed, 33 insertions, 3 deletions
diff --git a/adapters/gtest/results.go b/adapters/gtest/results.go index c556749..0e96edc 100644 --- a/adapters/gtest/results.go +++ b/adapters/gtest/results.go @@ -55,7 +55,7 @@ func failureMsg(failures []gFailure) string { failure_msg := "" for _, failure := range failures { - failure_msg += failure.Failure + failure_msg += failure.Failure + "\n" } return failure_msg diff --git a/cmd/planr/sub/cli.go b/cmd/planr/sub/cli.go index 42d1c81..2bcaed9 100644 --- a/cmd/planr/sub/cli.go +++ b/cmd/planr/sub/cli.go @@ -42,6 +42,34 @@ func pprintLabeled(label, value string) { fmt.Println(value) } +const ( + FENCE_WIDTH = 80 +) + +func pprintFenced(title, value string) { + wingWidth := FENCE_WIDTH - len(title) - 2 + + for i := 0; i < wingWidth / 2; i++ { + fmt.Print("-") + } + + fmt.Printf(" %s ", title) + + for i := 0; i < wingWidth / 2; i++ { + fmt.Print("-") + } + + fmt.Println() + + fmt.Print(value) + + for i := 0; i < FENCE_WIDTH; i++ { + fmt.Print("-") + } + + fmt.Println() +} + func tcStatusLine(tc planr.TestCase) { title := tcTitle(tc) status := tcStatus(tc) @@ -68,11 +96,13 @@ func tcPprint(tc planr.TestCase) { } if tc.Result.DebugOutput != "" { - pprintLabeled("debug output", tc.Result.DebugOutput) + fmt.Println() + pprintFenced("compilation output", tc.Result.DebugOutput); } if tc.Result.FailureMsg != "" { - pprintLabeled("failure", tc.Result.FailureMsg); + fmt.Println() + pprintFenced("test output", tc.Result.FailureMsg); } fmt.Println() |