From c53fee51f01db0d803a803b380d5f476278ea5fd Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 10 Aug 2025 21:16:07 +0200 Subject: integration: Add tempdir() This utility function centralizes the creation and error handling for temporary test directories to run native sim firmware or scripts to start a real DUT (device under test). --- integration/utils.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 integration/utils.go (limited to 'integration/utils.go') diff --git a/integration/utils.go b/integration/utils.go new file mode 100644 index 0000000..12e1f62 --- /dev/null +++ b/integration/utils.go @@ -0,0 +1,14 @@ +package integration + +import ( + "os" + "testing" +) + +func tempdir(t *testing.T) string { + dir, err := os.MkdirTemp("", "iot-contact-go-integration-test-*") + if err != nil { + t.Skip("Could not create temporary directory for integration test.") + } + return dir +} -- cgit v1.2.3-70-g09d2