package pi import ( "os" "path/filepath" "testing" "amadan.net/oficina/equipo/internal/fakepi" "amadan.net/oficina/equipo/internal/runner/containment" "amadan.net/rastrillo/rastrillo/budget" ) // TestMain is also the namespace helper, the fake Pi (started as Node, // with the Pi CLI's path first) 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 "node": os.Exit(fakepi.Main(os.Args[2:], 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)) }