summaryrefslogtreecommitdiffstats
path: root/src/test/templates
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2017-05-09 00:23:11 -0400
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2017-06-04 22:40:30 -0400
commitc9e173f84effdfbdda9f0d5e8650644572a2d95e (patch)
treea01acde00fb4f47dcfc011290e274704d71b6c00 /src/test/templates
parente73b2c35a375af51b6c7341e9a98f9571f76b266 (diff)
downloadphosphor-dbus-monitor-c9e173f84effdfbdda9f0d5e8650644572a2d95e.tar.gz
phosphor-dbus-monitor-c9e173f84effdfbdda9f0d5e8650644572a2d95e.zip
Add testcases for property and property groups
Change-Id: I4b30d0729a704d6833c840ea08daeee961a5730b Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'src/test/templates')
-rw-r--r--src/test/templates/propertygentest.mako.hpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/test/templates/propertygentest.mako.hpp b/src/test/templates/propertygentest.mako.hpp
new file mode 100644
index 0000000..16febd7
--- /dev/null
+++ b/src/test/templates/propertygentest.mako.hpp
@@ -0,0 +1,34 @@
+const std::array<std::string, ${len(meta)}> meta = {
+% for m in meta:
+ "${m.name}"s,
+% endfor
+};
+
+const std::array<std::string, ${len(interfaces)}> interfaces = {
+% for i in interfaces:
+ "${i.name}"s,
+% endfor
+};
+
+const std::array<std::string, ${len(propertynames)}> properties = {
+% for p in propertynames:
+ "${p.name}"s,
+% endfor
+};
+
+const std::array<GroupOfProperties, ${len(propertygroups)}> groups = {{
+% for g in propertygroups:
+ // ${g.name}
+ {
+ % for p in g.members:
+ Property{ interfaces[${p[0]}], properties[${p[1]}], meta[${p[2]}] },
+ % endfor
+ },
+% endfor
+}};
+
+const std::array<std::string, ${len(propertygroups)}> types = {
+% for g in propertygroups:
+ "${g.datatype}"s,
+% endfor
+};
OpenPOWER on IntegriCloud