diff options
| author | xengineering <me@xengineering.eu> | 2025-08-10 21:16:07 +0200 |
|---|---|---|
| committer | xengineering <me@xengineering.eu> | 2025-08-10 21:16:07 +0200 |
| commit | c53fee51f01db0d803a803b380d5f476278ea5fd (patch) | |
| tree | 79a50aa8ac0a30ad41819ad1315085614cece582 /integration/utils.go | |
| parent | 0b45492bb3e0da4c1956b25bdc2e3f7c5f3f887b (diff) | |
| download | iot-contact-go-c53fee51f01db0d803a803b380d5f476278ea5fd.tar iot-contact-go-c53fee51f01db0d803a803b380d5f476278ea5fd.tar.zst iot-contact-go-c53fee51f01db0d803a803b380d5f476278ea5fd.zip | |
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).
Diffstat (limited to 'integration/utils.go')
| -rw-r--r-- | integration/utils.go | 14 |
1 files changed, 14 insertions, 0 deletions
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 +} |
