Add shell script for generate parser files for api

This commit is contained in:
Parker Liu
2022-02-18 11:13:02 +08:00
parent fdd18850b8
commit 326a7cff88
2 changed files with 25 additions and 12 deletions
+13
View File
@@ -0,0 +1,13 @@
#!/bin/sh
outdir=${outc_dir:-"."}
json-autotype --clang --no-autounify --debug -t json_error ./neu_json_error.json -o neu_json_error.c
json-autotype --clang --no-autounify --debug -t json_group_config ./neu_json_group_config.json -o neu_json_group_config.c
json-autotype --clang --no-autounify --debug -t json_node ./neu_json_node.json -o neu_json_node.c
json-autotype --clang --no-autounify --debug -t json_plugin ./neu_json_plugin.json -o neu_json_plugin.c
json-autotype --clang --no-autounify --debug -t json_rw ./neu_json_rw.json -o neu_json_rw.c
json-autotype --clang --no-autounify --debug -t json_tag ./neu_json_tag.json -o neu_json_tag.c
json-autotype --clang --no-autounify --debug -t json_tty ./neu_json_tty.json -o neu_json_tty.c
mv *.c *.h ${outdir}/
+12 -12
View File
@@ -10,12 +10,12 @@ TEST(PersistenceAdapterTest, Adapter)
const char *adapters_fname = neu_persister_get_adapters_fname(persister);
const char *plugins_fname = neu_persister_get_plugins_fname(persister);
neu_json_node_req_node_t node1 = { (char *) "sample-driver-adapter", 1, 1,
(char *) "sample-drv-plugin" };
neu_json_node_req_node_t node2 = { (char *) "sample-app-adapter", 5, 2,
(char *) "sample-app-plugin" };
neu_json_node_req_node_t node3 = { (char *) "mqtt-adapter", 3, 3,
(char *) "mqtt-plugin" };
neu_json_node_req_node_t node1 = { (char *) "sample-driver-adapter", 1,
(char *) "sample-drv-plugin", 1 };
neu_json_node_req_node_t node2 = { (char *) "sample-app-adapter", 5,
(char *) "sample-app-plugin", 2 };
neu_json_node_req_node_t node3 = { (char *) "mqtt-adapter", 3,
(char *) "mqtt-plugin", 3 };
neu_json_node_req_t *req =
(neu_json_node_req_t *) malloc(sizeof(neu_json_node_req_t));
@@ -152,12 +152,12 @@ TEST(PersistenceDatatagTest, Datatag)
const char *grp_config_name = "test-group";
const char *plugins_fname = neu_persister_get_plugins_fname(persister);
neu_json_datatag_req_tag_t tag1 = { (char *) "modbus1", 3, 1,
(char *) "1!400001" };
neu_json_datatag_req_tag_t tag2 = { (char *) "modbus2", 4, 1,
(char *) "1!400002" };
neu_json_datatag_req_tag_t tag3 = { (char *) "modbus3", 5, 1,
(char *) "1!400003" };
neu_json_datatag_req_tag_t tag1 = { (char *) "1!400001", (char *) "modbus1",
3, 1 };
neu_json_datatag_req_tag_t tag2 = { (char *) "1!400002", (char *) "modbus2",
4, 1 };
neu_json_datatag_req_tag_t tag3 = { (char *) "1!400003", (char *) "modbus3",
5, 1 };
neu_json_datatag_req_t *req =
(neu_json_datatag_req_t *) malloc(sizeof(neu_json_datatag_req_t));