2022-06-25 01:03:08 +01:00
|
|
|
package voicemeeter_test
|
|
|
|
|
|
|
|
import (
|
2022-12-08 10:52:15 +00:00
|
|
|
"bytes"
|
2022-06-25 01:03:08 +01:00
|
|
|
"testing"
|
|
|
|
|
2022-12-08 10:52:15 +00:00
|
|
|
log "github.com/sirupsen/logrus"
|
|
|
|
|
|
|
|
"github.com/onyx-and-iris/voicemeeter/v2"
|
2022-06-25 01:03:08 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2022-12-08 10:52:15 +00:00
|
|
|
logstring bytes.Buffer
|
|
|
|
vm, err = voicemeeter.NewRemote("potato", 30)
|
2022-06-25 01:03:08 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestMain(m *testing.M) {
|
2022-08-23 03:16:43 +01:00
|
|
|
if err != nil {
|
2022-08-23 03:35:34 +01:00
|
|
|
log.Fatal(err)
|
2022-08-23 03:16:43 +01:00
|
|
|
}
|
2022-06-30 23:08:35 +01:00
|
|
|
|
2022-09-14 16:05:15 +01:00
|
|
|
err = vm.Login()
|
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err)
|
2022-06-30 23:08:35 +01:00
|
|
|
}
|
2022-09-14 16:05:15 +01:00
|
|
|
defer vm.Logout()
|
|
|
|
|
2022-12-08 10:52:15 +00:00
|
|
|
log.SetOutput(&logstring)
|
|
|
|
|
2022-09-14 16:05:15 +01:00
|
|
|
m.Run()
|
2022-06-30 23:08:35 +01:00
|
|
|
}
|