forked from electricbubble/gidevice
-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathcrashreportmover_test.go
41 lines (34 loc) · 951 Bytes
/
crashreportmover_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package giDevice
import (
"fmt"
"os"
"testing"
)
var crashReportMoverSrv CrashReportMover
func setupCrashReportMoverSrv(t *testing.T) {
setupLockdownSrv(t)
var err error
if lockdownSrv, err = dev.lockdownService(); err != nil {
t.Fatal(err)
}
if crashReportMoverSrv, err = lockdownSrv.CrashReportMoverService(); err != nil {
t.Fatal(err)
}
}
func Test_crashReportMover_Move(t *testing.T) {
setupCrashReportMoverSrv(t)
SetDebug(true)
userHomeDir, _ := os.UserHomeDir()
// err := crashReportMoverSrv.Move(userHomeDir + "/Documents/temp/2021-04/out_gidevice")
// err := crashReportMoverSrv.Move(userHomeDir+"/Documents/temp/2021-04/out_gidevice",
err := crashReportMoverSrv.Move(userHomeDir+"/Documents/temp/2021-04/out_gidevice_extract",
WithKeepCrashReport(true),
WithExtractRawCrashReport(true),
WithWhenMoveIsDone(func(filename string) {
fmt.Println("Copy:", filename)
}),
)
if err != nil {
t.Fatal(err)
}
}