Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
d617938d
Commit
d617938d
authored
Jun 29, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
085049f6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
go/xcommon/tracing/cmd/gotrace/gotrace_test.go
go/xcommon/tracing/cmd/gotrace/gotrace_test.go
+11
-11
No files found.
go/xcommon/tracing/cmd/gotrace/gotrace_test.go
View file @
d617938d
...
...
@@ -34,20 +34,24 @@ const (
// prepareTestTree copies files from src to dst recursively processing *.ok and *.rm depending on mode
// dst should not initially exist
func
prepareTestTree
(
src
,
dst
string
,
mode
TreePrepareMode
)
error
{
println
(
"AAA"
,
dst
)
err
:=
os
.
MkdirAll
(
dst
,
0777
)
if
err
!=
nil
{
return
err
}
return
filepath
.
Walk
(
src
,
func
(
srcpath
string
,
info
os
.
FileInfo
,
err
error
)
error
{
dstpath
:=
dst
+
"/"
+
strings
.
TrimPrefix
(
srcpath
,
src
)
println
(
"*"
,
srcpath
)
if
srcpath
==
src
/* skip root */
||
err
!=
nil
{
return
err
}
dstpath
:=
dst
+
strings
.
TrimPrefix
(
srcpath
,
src
)
//println("·", dstpath)
if
info
.
IsDir
()
{
err
:=
os
.
Mkdir
(
dstpath
,
0777
)
if
err
!=
nil
{
return
err
}
return
prepareTestTree
(
srcpath
,
dstpath
,
mode
)
}
var
isOk
,
isRm
bool
if
strings
.
HasSuffix
(
srcpath
,
".ok"
)
{
...
...
@@ -85,11 +89,7 @@ func prepareTestTree(src, dst string, mode TreePrepareMode) error {
}
err
=
ioutil
.
WriteFile
(
dstpath
,
data
,
info
.
Mode
())
if
err
!=
nil
{
return
err
}
return
nil
})
}
...
...
@@ -117,7 +117,7 @@ func TestGoTraceGen(t *testing.T) {
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
defer
os
.
RemoveAll
(
tmp
)
//
defer os.RemoveAll(tmp)
good
:=
tmp
+
"/good"
work
:=
tmp
+
"/work"
...
...
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