treewide: rename osbase/test/launch to osbase/test/qemu
Change-Id: Ia0775c462c8c909dc2080f01ff1f609b6d099179
Reviewed-on: https://review.monogon.dev/c/monogon/+/4046
Tested-by: Jenkins CI
Reviewed-by: Jan Schär <jan@monogon.tech>
diff --git a/metropolis/test/launch/log.go b/metropolis/test/launch/log.go
new file mode 100644
index 0000000..f251d5b
--- /dev/null
+++ b/metropolis/test/launch/log.go
@@ -0,0 +1,25 @@
+// Copyright The Monogon Project Authors.
+// SPDX-License-Identifier: Apache-2.0
+
+package launch
+
+import (
+ "fmt"
+ "strings"
+)
+
+// logf is compatible with the output of ConciseString as used in the Metropolis
+// console log, making the output more readable in unified test logs.
+func logf(f string, args ...any) {
+ formatted := fmt.Sprintf(f, args...)
+ for i, line := range strings.Split(formatted, "\n") {
+ if len(line) == 0 {
+ continue
+ }
+ if i == 0 {
+ fmt.Printf("TT| %20s ! %s\n", "test launch", line)
+ } else {
+ fmt.Printf("TT| %20s | %s\n", "", line)
+ }
+ }
+}