2022-06-25 01:03:08 +01:00
|
|
|
package voicemeeter_test
|
|
|
|
|
|
|
|
import (
|
2022-08-23 03:35:34 +01:00
|
|
|
"log"
|
2022-06-25 01:03:08 +01:00
|
|
|
"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-08-23 03:16:43 +01:00
|
|
|
vm, err = voicemeeter.NewRemote("potato")
|
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
|
|
|
}
|
|
|
|
defer vm.Logout()
|
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|