pre cw with probe and a bunch script to read game behavior

This commit is contained in:
CAtlas0784 committed 2026-10-21 20:40:13 +07:00
1 parent 5120219ae2
commit da8a32f60d
310 files changed
+219693 -872

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
package gameserver
import (
"fmt"
"os"
"path/filepath"
"runtime"
"testing"
)
func TestMain(m *testing.M) {
_, source, _, ok := runtime.Caller(0)
if !ok {
fmt.Fprintln(os.Stderr, "cannot locate gameserver test helper source")
os.Exit(2)
}
root := filepath.Clean(filepath.Join(filepath.Dir(source), "..", ".."))
if err := os.Chdir(root); err != nil {
fmt.Fprintf(os.Stderr, "cannot change to repository root %s: %v\n", root, err)
os.Exit(2)
}
os.Exit(m.Run())
}
func chdirRepositoryRoot(t *testing.T) {
t.Helper()
_, source, _, ok := runtime.Caller(0)
if !ok {
t.Fatal("cannot locate gameserver test helper source")
}
root := filepath.Clean(filepath.Join(filepath.Dir(source), "..", ".."))
if _, err := os.Stat(filepath.Join(root, "go.mod")); err != nil {
t.Fatalf("cannot locate repository root from %s: %v", source, err)
}
t.Chdir(root)
}