2022-06-25 01:03:08 +01:00
|
|
|
package voicemeeter_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"testing"
|
2022-06-30 23:08:35 +01:00
|
|
|
"time"
|
2022-06-25 01:03:08 +01:00
|
|
|
|
2022-07-09 19:01:58 +01:00
|
|
|
"github.com/onyx-and-iris/voicemeeter-api-go"
|
2022-06-25 01:03:08 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2022-07-18 16:23:15 +01:00
|
|
|
vm = voicemeeter.NewRemote("potato")
|
2022-06-25 01:03:08 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestMain(m *testing.M) {
|
2022-07-18 16:23:15 +01:00
|
|
|
vm.Login()
|
2022-06-25 01:03:08 +01:00
|
|
|
code := m.Run()
|
2022-07-18 16:23:15 +01:00
|
|
|
vm.Logout()
|
2022-06-25 01:03:08 +01:00
|
|
|
os.Exit(code)
|
|
|
|
}
|
2022-06-30 23:08:35 +01:00
|
|
|
|
|
|
|
func sync() {
|
|
|
|
time.Sleep(30 * time.Millisecond)
|
2022-07-18 16:23:15 +01:00
|
|
|
for vm.Pdirty() || vm.Mdirty() {
|
2022-06-30 23:08:35 +01:00
|
|
|
}
|
|
|
|
}
|