summaryrefslogtreecommitdiff
path: root/integrationtests/helpers_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'integrationtests/helpers_test.go')
-rw-r--r--integrationtests/helpers_test.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/integrationtests/helpers_test.go b/integrationtests/helpers_test.go
index edf57b9..7db54b2 100644
--- a/integrationtests/helpers_test.go
+++ b/integrationtests/helpers_test.go
@@ -36,6 +36,16 @@ func absPath(t *testing.T, rel string) string {
return p
}
+// writeScript creates an executable shell script in dir and returns its path.
+func writeScript(t *testing.T, dir, name, content string) string {
+ t.Helper()
+ path := filepath.Join(dir, name)
+ if err := os.WriteFile(path, []byte("#!/bin/sh\n"+content+"\n"), 0o755); err != nil {
+ t.Fatalf("write script %s: %v", name, err)
+ }
+ return path
+}
+
func runScenario(t *testing.T, scenario string, expected []ExpectedEvent) {
t.Helper()
h := newTestHarness(t)