summaryrefslogtreecommitdiff
path: root/testcase.go
blob: 70c188e5f137348e2b3a077d452d10e74ad2a07d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package planr

type TestResult struct {
  Pass bool
}

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) ContainsAdapter(name string) bool {
  for adapter := range tc.Config.adapters_ {
    if adapter == name {
      return true;
    }
  }

  return false;
}

func (tc TestCase) AdapterConfig(name string) InheritableConfig {
  return tc.Config.adapters_[name]
}