package opencode import ( "os" "path/filepath" "testing" "amadan.net/oficina/equipo/internal/fakeopencode" "amadan.net/oficina/equipo/internal/runner/containment" "amadan.net/rastrillo/rastrillo/budget" ) // TestMain is also the namespace helper, the fake OpenCode (started as // the binary, opencode) and the tool proxy: the tests run them from // copies of this binary. func TestMain(m *testing.M) { switch filepath.Base(os.Args[0]) { case "opencode": os.Exit(fakeopencode.Main(os.Args[1:], os.Stdin, os.Stdout, os.Stderr)) case "equipo-tool-proxy": os.Exit(serveToolProxy(os.Args)) } if len(os.Args) > 1 && os.Args[1] == "__namespace" { os.Exit(containment.NamespaceMain(os.Args[2:])) } os.Exit(budget.Main(m)) }