aboutsummaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-06-06 17:02:19 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-06-06 17:02:19 +0200
commit76ee49defb58fa70d9a14fa1aa1f121e8b69d46c (patch)
tree0d7555a2d748de39e1b5715c3520150dec1ec37d /sys
parent7bb7a86bdc6b181c16387de097293e203bbc154f (diff)
sys: add a new test for resource ctors
TestTransitivelyEnabledCalls detects when there is a resource that has no ctors, but it does not provide any details (e.g. resource name). Add another test that detects exact resource that can't be created.
Diffstat (limited to 'sys')
-rw-r--r--sys/decl_test.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/decl_test.go b/sys/decl_test.go
index 18385c321..aa81f33e6 100644
--- a/sys/decl_test.go
+++ b/sys/decl_test.go
@@ -7,6 +7,16 @@ import (
"testing"
)
+func TestResourceCtors(t *testing.T) {
+ for _, c := range Calls {
+ for _, res := range c.InputResources() {
+ if len(resourceCtors(res.Desc.Kind, true)) == 0 {
+ t.Errorf("call %v requires input resource %v, but there are no calls that can create this resource", c.Name, res.Desc.Name)
+ }
+ }
+ }
+}
+
func TestTransitivelyEnabledCalls(t *testing.T) {
t.Parallel()
calls := make(map[*Call]bool)