Milo Lin | 0ddb778 | 2022-08-17 20:40:43 -0700 | [diff] [blame^] | 1 | def config_validator_rule(name, config, visibility = None): |
| 2 | ''' |
| 3 | Macro to take a config and pass it to the config validator to validate that it will work on a real system. |
| 4 | |
| 5 | Currently just checks that the system can startup, but will check that timestamp channels are properly logged in the future. |
| 6 | |
| 7 | Args: |
| 8 | name: name that the config validator uses, e.g. "test_config", |
| 9 | config: config rule that needs to be validated, e.g. "//aos/events:pingpong_config", |
| 10 | ''' |
| 11 | config_bfbs = config + ".bfbs" |
| 12 | native.genrule( |
| 13 | name = name, |
| 14 | outs = [name + ".txt"], |
| 15 | cmd = "$(location //aos/util:config_validator) --config $(location %s) > $@" % config_bfbs, |
| 16 | srcs = [config_bfbs], |
| 17 | tools = ["//aos/util:config_validator"], |
| 18 | testonly = True, |
| 19 | visibility = visibility, |
| 20 | ) |