diff options
| author | Joe Richey joerichey@google.com <joerichey@google.com> | 2017-07-18 21:08:02 -0700 |
|---|---|---|
| committer | Joe Richey joerichey@google.com <joerichey@google.com> | 2017-07-18 21:08:02 -0700 |
| commit | 3afdd84a5c0cea217043e9d32ce61e9f6bccf18b (patch) | |
| tree | 9503e9bb95db4938dababa0bfe2819d7cd7d7e56 /actions | |
| parent | f898a826ab24e03019323ade6a8785e2bf463a41 (diff) | |
tests: Unit tests and Integration tests work
Now the testing functions will skip the integration tests if a testing
filesystem is not specified.
Diffstat (limited to 'actions')
| -rw-r--r-- | actions/context_test.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/actions/context_test.go b/actions/context_test.go index a92ef34..4b38a33 100644 --- a/actions/context_test.go +++ b/actions/context_test.go @@ -28,6 +28,7 @@ import ( "time" "github.com/google/fscrypt/util" + "github.com/pkg/errors" ) const testTime = 10 * time.Millisecond @@ -38,7 +39,7 @@ var testContext *Context // Makes a context using the testing locations for the filesystem and // configuration file. func setupContext() (ctx *Context, err error) { - mountpoint, err := util.TestPath() + mountpoint, err := util.TestRoot() if err != nil { return nil, err } @@ -83,8 +84,11 @@ func TestMain(m *testing.M) { var err error testContext, err = setupContext() if err != nil { - fmt.Printf("setupContext() = %v\n", err) - os.Exit(1) + fmt.Println(err) + if errors.Cause(err) != util.ErrSkipIntegration { + os.Exit(1) + } + os.Exit(0) } returnCode := m.Run() |