blob: 453c5c2667aebd87f38ab5dfe072c47d707ea076 [file] [log] [blame]
milind-uc6e437a2023-03-01 23:40:40 -08001def config_validator_rule(name, config, extension = ".bfbs", visibility = None):
Milo Lin0ddb7782022-08-17 20:40:43 -07002 '''
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 '''
milind-uc6e437a2023-03-01 23:40:40 -080011 config_file = config + extension
Milo Lin0ddb7782022-08-17 20:40:43 -070012 native.genrule(
13 name = name,
14 outs = [name + ".txt"],
milind-uc6e437a2023-03-01 23:40:40 -080015 cmd = "$(location //aos/util:config_validator) --config $(location %s) > $@" % config_file,
16 srcs = [config_file],
Milo Lin0ddb7782022-08-17 20:40:43 -070017 tools = ["//aos/util:config_validator"],
18 testonly = True,
19 visibility = visibility,
20 )