aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlu0r1ne <flur01ne@flu0r1ne.net>2021-08-13 17:03:57 -0500
committerFlu0r1ne <flur01ne@flu0r1ne.net>2021-08-13 17:03:57 -0500
commit9954b5fa87f74c035739159f4bb831900e5e35be (patch)
tree7e5a005b4fd0a502bc73a9d53a825324226f6494
parent3337257fe24b67871406217e98862d34647dd725 (diff)
downloadplanr-9954b5fa87f74c035739159f4bb831900e5e35be.tar.xz
planr-9954b5fa87f74c035739159f4bb831900e5e35be.zip
Fenced test & compilation output
-rw-r--r--adapters/gtest/results.go2
-rw-r--r--cmd/planr/sub/cli.go34
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()