package planr import ( "log" ) type TestStatus uint const ( NOT_RUN TestStatus = iota PASSING COMPILATION_FAILURE RUNTIME_FAILURE ) type TestResult struct { Id string Status TestStatus DebugOutput string TestOutput string Tc TestCase } // Program-wide testcase config type TestCaseConfig struct { Defaults Title *string Description *string } func (c TestCaseConfig) ensureSatisfied(name string) { if (c.Adapter == nil) { log.Fatalf("Adapter must be provided for testcase %s", name) } } type TestCase struct { // absolute path to the test case configuration Path string // The canonical name is a semantically meaningful name // guaranteed to be unique among the tests // Obtained by replacing separators in the relative path of the // configuration with dots. The `toml` extension is also stripped. // rubric/alpha/beta/tc1.toml -> alpha.beta.tc1 Cname string Config TestCaseConfig } func (tc TestCase) AdapterConfig() InheritableConfig { return tc.Config.adapters_[*tc.Config.Adapter] }