package webread import ( "os" "testing" "amadan.net/rastrillo/rastrillo/budget" ) // The test binary doubles as the fetcher, so the launch test can run it // under bubblewrap: argv "webread " is Main, "webread-probe // " reports what the process can see. func TestMain(m *testing.M) { if len(os.Args) > 1 { switch os.Args[1] { case "webread": os.Exit(Main(os.Args[2:], os.Stdin, os.Stderr)) case "webread-probe": os.Exit(probeMain(os.Args[2:])) case "webread-limits": os.Exit(limitsMain(false)) case "webread-limits-over": os.Exit(limitsMain(true)) case "webread-nochild": os.Exit(noChildMain(os.Args[2:])) } } os.Exit(budget.Main(m)) }