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 /cmd/planr | |
parent | 3337257fe24b67871406217e98862d34647dd725 (diff) | |
download | deb-planr-9954b5fa87f74c035739159f4bb831900e5e35be.tar.xz deb-planr-9954b5fa87f74c035739159f4bb831900e5e35be.zip |
Fenced test & compilation output
Diffstat (limited to 'cmd/planr')
-rw-r--r-- | cmd/planr/sub/cli.go | 34 |
1 files changed, 32 insertions, 2 deletions
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() |