forked from u2takey/ffmpeg-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathffmpeg_windows_test.go
More file actions
35 lines (31 loc) · 882 Bytes
/
ffmpeg_windows_test.go
File metadata and controls
35 lines (31 loc) · 882 Bytes
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
package ffmpeg_go
import (
"os/exec"
"syscall"
"testing"
"github.com/stretchr/testify/assert"
)
func TestCompileWithOptions(t *testing.T) {
out := Input("dummy.mp4").Output("dummy2.mp4")
cmd := out.Compile(func(s *Stream, cmd *exec.Cmd) {
if cmd.SysProcAttr == nil {
cmd.SysProcAttr = &syscall.SysProcAttr{}
}
cmd.SysProcAttr.HideWindow = true
})
assert.Equal(t, true, cmd.SysProcAttr.HideWindow)
}
func TestGlobalCommandOptions(t *testing.T) {
out := Input("dummy.mp4").Output("dummy2.mp4")
GlobalCommandOptions = append(GlobalCommandOptions, func(cmd *exec.Cmd) {
if cmd.SysProcAttr == nil {
cmd.SysProcAttr = &syscall.SysProcAttr{}
}
cmd.SysProcAttr.HideWindow = true
})
defer func() {
GlobalCommandOptions = GlobalCommandOptions[0 : len(GlobalCommandOptions)-1]
}()
cmd := out.Compile()
assert.Equal(t, true, cmd.SysProcAttr.HideWindow)
}