aboutsummaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
authorFlu0r1ne <flur01ne@flu0r1ne.net>2021-08-05 18:41:53 -0500
committerFlu0r1ne <flur01ne@flu0r1ne.net>2021-08-05 18:41:53 -0500
commitcbc5fbdf941cd40dc6a9546fb924689f5d6978c7 (patch)
tree734bfa515ddeab208c35c50624cfd9f1124ce6cf /config.go
parent05ce22f9d2308bca51b48fb60558d17f2e381227 (diff)
downloadplanr-cbc5fbdf941cd40dc6a9546fb924689f5d6978c7.tar.xz
planr-cbc5fbdf941cd40dc6a9546fb924689f5d6978c7.zip
Improvised a basic text report, finished evaluation mappings
Diffstat (limited to 'config.go')
-rw-r--r--config.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/config.go b/config.go
index 6dd264b..6efa90d 100644
--- a/config.go
+++ b/config.go
@@ -60,6 +60,7 @@ type AdapterConfig struct {
// in defaults.toml
type Defaults struct {
Points *float32
+ Adapter *string
/*
The TOML library only parses exported fields.
@@ -89,6 +90,12 @@ type TestCaseConfig struct {
Description *string
}
+func (c TestCaseConfig) ensureSatisfied(name string) {
+ if (c.Adapter == nil) {
+ log.Fatalf("Adapter must be provided for testcase %s", name)
+ }
+}
+
// The default configuration must be able in inherit from
// other defaults further up the tree
//
@@ -101,6 +108,10 @@ func (child *Defaults) Inherit(p interface{}) {
child.Points = parent.Points;
}
+ if child.Adapter == nil {
+ child.Adapter = parent.Adapter;
+ }
+
// Call the inherit method as defined by the adapters
// If an adapter is undefined, inherit the parent configuration
//