Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jacobsa-fuse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
jacobsa-fuse
Commits
a7674283
Commit
a7674283
authored
May 01, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Plumb through the ogletest context.
parent
18af108b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
samples/in_process.go
samples/in_process.go
+3
-2
samples/subprocess.go
samples/subprocess.go
+3
-3
No files found.
samples/in_process.go
View file @
a7674283
...
...
@@ -59,7 +59,7 @@ type SampleTest struct {
//
// REQUIRES: t.Server has been set.
func
(
t
*
SampleTest
)
SetUp
(
ti
*
ogletest
.
TestInfo
)
{
err
:=
t
.
initialize
(
t
.
Server
,
&
t
.
MountConfig
)
err
:=
t
.
initialize
(
t
i
.
Ctx
,
t
.
Server
,
&
t
.
MountConfig
)
if
err
!=
nil
{
panic
(
err
)
}
...
...
@@ -67,10 +67,11 @@ func (t *SampleTest) SetUp(ti *ogletest.TestInfo) {
// Like SetUp, but doens't panic.
func
(
t
*
SampleTest
)
initialize
(
ctx
context
.
Context
,
server
fuse
.
Server
,
config
*
fuse
.
MountConfig
)
(
err
error
)
{
// Initialize the context.
t
.
Ctx
=
c
ontext
.
Background
()
t
.
Ctx
=
c
tx
// Initialize the clock.
t
.
Clock
.
SetTime
(
time
.
Date
(
2012
,
8
,
15
,
22
,
56
,
0
,
0
,
time
.
Local
))
...
...
samples/subprocess.go
View file @
a7674283
...
...
@@ -68,7 +68,7 @@ type SubprocessTest struct {
// Mount the file system and initialize the other exported fields of the
// struct. Panics on error.
func
(
t
*
SubprocessTest
)
SetUp
(
ti
*
ogletest
.
TestInfo
)
{
err
:=
t
.
initialize
()
err
:=
t
.
initialize
(
ti
.
Ctx
)
if
err
!=
nil
{
panic
(
err
)
}
...
...
@@ -184,9 +184,9 @@ func waitForReady(readyReader *os.File, c chan<- struct{}) {
}
// Like SetUp, but doens't panic.
func
(
t
*
SubprocessTest
)
initialize
()
(
err
error
)
{
func
(
t
*
SubprocessTest
)
initialize
(
ctx
context
.
Context
)
(
err
error
)
{
// Initialize the context.
t
.
Ctx
=
c
ontext
.
Background
()
t
.
Ctx
=
c
tx
// Set up a temporary directory.
t
.
Dir
,
err
=
ioutil
.
TempDir
(
""
,
"sample_test"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment