| 1 |
// Package testutil wraps select test utilities to make them externally usable. |
| 2 |
package testutil |
| 3 |
|
| 4 |
import ( |
| 5 |
"io" |
| 6 |
"testing" |
| 7 |
|
| 8 |
"github.com/google/go-tpm-tools/internal/test" |
| 9 |
) |
| 10 |
|
| 11 |
// GetTPM is a cross-platform testing helper function that retrives the |
| 12 |
// appropriate TPM device from the flags passed into "go test". |
| 13 |
// |
| 14 |
// If using a test TPM, this will also retrieve a test eventlog. In this case, |
| 15 |
// GetTPM extends the test event log's events into the test TPM. |
| 16 |
func GetTPM(tb testing.TB) io.ReadWriteCloser { |
| 17 |
return test.GetTPM(tb) |
| 18 |
} |