test: isolate appdir environment

This commit is contained in:
Bjarne Øverli
2026-07-05 13:50:51 +02:00
parent 7e6a637dda
commit 5cf895eeb1
11 changed files with 123 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
package cmd
import (
"os"
"testing"
)
func TestMain(m *testing.M) {
os.Unsetenv("CLIAMP_CONFIG_DIR")
os.Unsetenv("XDG_CONFIG_HOME")
os.Exit(m.Run())
}
+12
View File
@@ -0,0 +1,12 @@
package config
import (
"os"
"testing"
)
func TestMain(m *testing.M) {
os.Unsetenv("CLIAMP_CONFIG_DIR")
os.Unsetenv("XDG_CONFIG_HOME")
os.Exit(m.Run())
}
+12
View File
@@ -0,0 +1,12 @@
package radio
import (
"os"
"testing"
)
func TestMain(m *testing.M) {
os.Unsetenv("CLIAMP_CONFIG_DIR")
os.Unsetenv("XDG_CONFIG_HOME")
os.Exit(m.Run())
}
+12
View File
@@ -0,0 +1,12 @@
package spotify
import (
"os"
"testing"
)
func TestMain(m *testing.M) {
os.Unsetenv("CLIAMP_CONFIG_DIR")
os.Unsetenv("XDG_CONFIG_HOME")
os.Exit(m.Run())
}
+12
View File
@@ -0,0 +1,12 @@
package ytmusic
import (
"os"
"testing"
)
func TestMain(m *testing.M) {
os.Unsetenv("CLIAMP_CONFIG_DIR")
os.Unsetenv("XDG_CONFIG_HOME")
os.Exit(m.Run())
}
+12
View File
@@ -0,0 +1,12 @@
package resume
import (
"os"
"testing"
)
func TestMain(m *testing.M) {
os.Unsetenv("CLIAMP_CONFIG_DIR")
os.Unsetenv("XDG_CONFIG_HOME")
os.Exit(m.Run())
}
+12
View File
@@ -0,0 +1,12 @@
package ipc
import (
"os"
"testing"
)
func TestMain(m *testing.M) {
os.Unsetenv("CLIAMP_CONFIG_DIR")
os.Unsetenv("XDG_CONFIG_HOME")
os.Exit(m.Run())
}
+12
View File
@@ -0,0 +1,12 @@
package luaplugin
import (
"os"
"testing"
)
func TestMain(m *testing.M) {
os.Unsetenv("CLIAMP_CONFIG_DIR")
os.Unsetenv("XDG_CONFIG_HOME")
os.Exit(m.Run())
}
+12
View File
@@ -0,0 +1,12 @@
package pluginmgr
import (
"os"
"testing"
)
func TestMain(m *testing.M) {
os.Unsetenv("CLIAMP_CONFIG_DIR")
os.Unsetenv("XDG_CONFIG_HOME")
os.Exit(m.Run())
}
+12
View File
@@ -0,0 +1,12 @@
package theme
import (
"os"
"testing"
)
func TestMain(m *testing.M) {
os.Unsetenv("CLIAMP_CONFIG_DIR")
os.Unsetenv("XDG_CONFIG_HOME")
os.Exit(m.Run())
}
+3
View File
@@ -15,6 +15,9 @@ import (
var sharedPlayer player.Engine
func TestMain(m *testing.M) {
os.Unsetenv("CLIAMP_CONFIG_DIR")
os.Unsetenv("XDG_CONFIG_HOME")
sr := player.DeviceSampleRate()
if sr <= 0 {
sr = 44100