From bab6dfbc0ee5fb3ce2b84029ed118a5ba9af0a56 Mon Sep 17 00:00:00 2001
From: Simon Ruderich <simon@ruderich.org>
Date: Sun, 9 May 2021 20:44:02 +0200
Subject: [PATCH] remote: tests: hide testRunner functions in test output

This is not perfect because they are called from files like
cmd/safcm-remote/sync/commands.go which is not very helpful to figure
out which test case failed. However, it's better than showing
cmd/safcm-remote/sync/sync_test.go which was the previous behavior.
---
 cmd/safcm-remote/sync/sync_test.go | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/cmd/safcm-remote/sync/sync_test.go b/cmd/safcm-remote/sync/sync_test.go
index 52d7435..8ee1459 100644
--- a/cmd/safcm-remote/sync/sync_test.go
+++ b/cmd/safcm-remote/sync/sync_test.go
@@ -54,6 +54,8 @@ func (r *testRunner) Run(cmd *exec.Cmd) error {
 	return resErr
 }
 func (r *testRunner) CombinedOutput(cmd *exec.Cmd) ([]byte, error) {
+	r.t.Helper()
+
 	stdout, stderr, err := r.check("combinedOutput", cmd)
 	if stderr != nil {
 		// stdout also contains stderr
@@ -63,6 +65,7 @@ func (r *testRunner) CombinedOutput(cmd *exec.Cmd) ([]byte, error) {
 }
 func (r *testRunner) check(method string, cmd *exec.Cmd) (
 	[]byte, []byte, error) {
+	r.t.Helper()
 
 	if len(r.expCmds) == 0 {
 		r.t.Fatalf("%s: empty expCmds", method)
@@ -133,6 +136,8 @@ func prepareSync(req safcm.MsgSyncReq, runner *testRunner) (
 }
 
 func (s *syncTestResult) Wait() []string {
+	s.runner.t.Helper()
+
 	close(s.ch)
 	s.wg.Wait()
 
-- 
2.49.0