From 474b0aa2f615f73b539a77927d8548e85dc2254e Mon Sep 17 00:00:00 2001 From: Snaipe Date: Wed, 9 Dec 2015 13:53:31 +0100 Subject: [PATCH] Added generated protocol sources --- CMakeLists.txt | 2 + src/protocol/criterion.pb.c | 180 ++++++++++++++++++++++++++++++++++++ src/protocol/criterion.pb.h | 177 +++++++++++++++++++++++++++++++++++ 3 files changed, 359 insertions(+) create mode 100644 src/protocol/criterion.pb.c create mode 100644 src/protocol/criterion.pb.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 6093675..2b7f574 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -184,6 +184,8 @@ set(SOURCE_FILES src/entry/options.c src/entry/params.c src/entry/entry.c + src/protocol/criterion.pb.c + src/protocol/criterion.pb.h src/common.h src/config.h ) diff --git a/src/protocol/criterion.pb.c b/src/protocol/criterion.pb.c new file mode 100644 index 0000000..18d6246 --- /dev/null +++ b/src/protocol/criterion.pb.c @@ -0,0 +1,180 @@ +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.3.5-dev at Wed Dec 9 01:51:00 2015. */ + +#include "criterion.pb.h" + +#if PB_PROTO_HEADER_VERSION != 30 +#error Regenerate this file with the current version of nanopb generator. +#endif + +const int32_t criterion_msg_version_default = 1; +const criterion_msg_id_msg_id_type criterion_msg_id_msg_type_default = criterion_msg_id_msg_id_type_PID; + + +const pb_field_t criterion_msg_fields[5] = { + PB_FIELD( 1, INT32 , REQUIRED, STATIC , FIRST, criterion_msg, version, version, &criterion_msg_version_default), + PB_FIELD( 2, MESSAGE , REQUIRED, STATIC , OTHER, criterion_msg, id, version, &criterion_msg_id_msg_fields), + PB_FIELD( 3, UENUM , REQUIRED, STATIC , OTHER, criterion_msg, type, id, 0), + PB_FIELD(100, EXTENSION, OPTIONAL, CALLBACK, OTHER, criterion_msg, extensions, type, 0), + PB_LAST_FIELD +}; + +const pb_field_t criterion_msg_id_msg_fields[4] = { + PB_FIELD( 1, UENUM , REQUIRED, STATIC , FIRST, criterion_msg_id_msg, type, type, &criterion_msg_id_msg_type_default), + PB_FIELD( 2, INT64 , OPTIONAL, STATIC , OTHER, criterion_msg_id_msg, id_int, type, 0), + PB_FIELD( 3, STRING , OPTIONAL, CALLBACK, OTHER, criterion_msg_id_msg, id_str, id_int, 0), + PB_LAST_FIELD +}; + +const pb_field_t criterion_birth_fields[1] = { + PB_LAST_FIELD +}; + +const pb_field_t criterion_pre_init_fields[1] = { + PB_LAST_FIELD +}; + +const pb_field_t criterion_pre_test_fields[2] = { + PB_FIELD( 1, INT64 , OPTIONAL, STATIC , FIRST, criterion_pre_test, timestamp, timestamp, 0), + PB_LAST_FIELD +}; + +const pb_field_t criterion_post_test_fields[2] = { + PB_FIELD( 1, INT64 , OPTIONAL, STATIC , FIRST, criterion_post_test, timestamp, timestamp, 0), + PB_LAST_FIELD +}; + +const pb_field_t criterion_post_fini_fields[1] = { + PB_LAST_FIELD +}; + +const pb_field_t criterion_death_fields[3] = { + PB_FIELD( 1, UENUM , OPTIONAL, STATIC , FIRST, criterion_death, result, result, 0), + PB_FIELD( 2, INT64 , OPTIONAL, STATIC , OTHER, criterion_death, status, result, 0), + PB_LAST_FIELD +}; + +const pb_field_t criterion_assert_fields[5] = { + PB_FIELD( 1, STRING , REQUIRED, CALLBACK, FIRST, criterion_assert, message, message, 0), + PB_FIELD( 2, BOOL , REQUIRED, STATIC , OTHER, criterion_assert, passed, message, 0), + PB_FIELD( 3, STRING , OPTIONAL, CALLBACK, OTHER, criterion_assert, file, passed, 0), + PB_FIELD( 4, INT64 , OPTIONAL, STATIC , OTHER, criterion_assert, line, file, 0), + PB_LAST_FIELD +}; + +typedef struct { + criterion_birth data; +} criterion_birth_data_struct; + +static const pb_field_t criterion_birth_data_field = + PB_FIELD(100, MESSAGE , OPTEXT, STATIC , FIRST, criterion_birth_data_struct, data, data, &criterion_birth_fields); + +const pb_extension_type_t criterion_birth_data = { + NULL, + NULL, + &criterion_birth_data_field +}; + +typedef struct { + criterion_pre_init data; +} criterion_pre_init_data_struct; + +static const pb_field_t criterion_pre_init_data_field = + PB_FIELD(101, MESSAGE , OPTEXT, STATIC , FIRST, criterion_pre_init_data_struct, data, data, &criterion_pre_init_fields); + +const pb_extension_type_t criterion_pre_init_data = { + NULL, + NULL, + &criterion_pre_init_data_field +}; + +typedef struct { + criterion_pre_test data; +} criterion_pre_test_data_struct; + +static const pb_field_t criterion_pre_test_data_field = + PB_FIELD(102, MESSAGE , OPTEXT, STATIC , FIRST, criterion_pre_test_data_struct, data, data, &criterion_pre_test_fields); + +const pb_extension_type_t criterion_pre_test_data = { + NULL, + NULL, + &criterion_pre_test_data_field +}; + +typedef struct { + criterion_post_test data; +} criterion_post_test_data_struct; + +static const pb_field_t criterion_post_test_data_field = + PB_FIELD(103, MESSAGE , OPTEXT, STATIC , FIRST, criterion_post_test_data_struct, data, data, &criterion_post_test_fields); + +const pb_extension_type_t criterion_post_test_data = { + NULL, + NULL, + &criterion_post_test_data_field +}; + +typedef struct { + criterion_post_fini data; +} criterion_post_fini_data_struct; + +static const pb_field_t criterion_post_fini_data_field = + PB_FIELD(104, MESSAGE , OPTEXT, STATIC , FIRST, criterion_post_fini_data_struct, data, data, &criterion_post_fini_fields); + +const pb_extension_type_t criterion_post_fini_data = { + NULL, + NULL, + &criterion_post_fini_data_field +}; + +typedef struct { + criterion_death data; +} criterion_death_data_struct; + +static const pb_field_t criterion_death_data_field = + PB_FIELD(105, MESSAGE , OPTEXT, STATIC , FIRST, criterion_death_data_struct, data, data, &criterion_death_fields); + +const pb_extension_type_t criterion_death_data = { + NULL, + NULL, + &criterion_death_data_field +}; + +typedef struct { + criterion_assert data; +} criterion_assert_data_struct; + +static const pb_field_t criterion_assert_data_field = + PB_FIELD(106, MESSAGE , OPTEXT, STATIC , FIRST, criterion_assert_data_struct, data, data, &criterion_assert_fields); + +const pb_extension_type_t criterion_assert_data = { + NULL, + NULL, + &criterion_assert_data_field +}; + + +/* Check that field information fits in pb_field_t */ +#if !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_32BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * numbers or field sizes that are larger than what can fit in 8 or 16 bit + * field descriptors. + */ +PB_STATIC_ASSERT((pb_membersize(criterion_msg, id) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_criterion_msg_criterion_msg_id_msg_criterion_birth_criterion_pre_init_criterion_pre_test_criterion_post_test_criterion_post_fini_criterion_death_criterion_assert) +#endif + +#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_16BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * numbers or field sizes that are larger than what can fit in the default + * 8 bit descriptors. + */ +PB_STATIC_ASSERT((pb_membersize(criterion_msg, id) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_criterion_msg_criterion_msg_id_msg_criterion_birth_criterion_pre_init_criterion_pre_test_criterion_post_test_criterion_post_fini_criterion_death_criterion_assert) +#endif + + diff --git a/src/protocol/criterion.pb.h b/src/protocol/criterion.pb.h new file mode 100644 index 0000000..35b9759 --- /dev/null +++ b/src/protocol/criterion.pb.h @@ -0,0 +1,177 @@ +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.3.5-dev at Wed Dec 9 01:51:00 2015. */ + +#ifndef PB_CRITERION_PB_H_INCLUDED +#define PB_CRITERION_PB_H_INCLUDED +#include + +#if PB_PROTO_HEADER_VERSION != 30 +#error Regenerate this file with the current version of nanopb generator. +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Enum definitions */ +typedef enum _criterion_msg_msg_type { + criterion_msg_msg_type_BIRTH = 0, + criterion_msg_msg_type_PRE_INIT = 1, + criterion_msg_msg_type_PRE_TEST = 2, + criterion_msg_msg_type_POST_TEST = 3, + criterion_msg_msg_type_POST_FINI = 4, + criterion_msg_msg_type_DEATH = 5, + criterion_msg_msg_type_ASSERT = 6 +} criterion_msg_msg_type; + +typedef enum _criterion_msg_id_msg_id_type { + criterion_msg_id_msg_id_type_PID = 0 +} criterion_msg_id_msg_id_type; + +typedef enum _criterion_death_result_type { + criterion_death_result_type_NORMAL = 0, + criterion_death_result_type_CRASH = 1, + criterion_death_result_type_TIMEOUT = 2 +} criterion_death_result_type; + +/* Struct definitions */ +typedef struct _criterion_birth { + uint8_t dummy_field; +} criterion_birth; + +typedef struct _criterion_post_fini { + uint8_t dummy_field; +} criterion_post_fini; + +typedef struct _criterion_pre_init { + uint8_t dummy_field; +} criterion_pre_init; + +typedef struct _criterion_assert { + pb_callback_t message; + bool passed; + pb_callback_t file; + bool has_line; + int64_t line; +} criterion_assert; + +typedef struct _criterion_death { + bool has_result; + criterion_death_result_type result; + bool has_status; + int64_t status; +} criterion_death; + +typedef struct _criterion_msg_id_msg { + criterion_msg_id_msg_id_type type; + bool has_id_int; + int64_t id_int; + pb_callback_t id_str; +} criterion_msg_id_msg; + +typedef struct _criterion_post_test { + bool has_timestamp; + int64_t timestamp; +} criterion_post_test; + +typedef struct _criterion_pre_test { + bool has_timestamp; + int64_t timestamp; +} criterion_pre_test; + +typedef struct _criterion_msg { + int32_t version; + criterion_msg_id_msg id; + criterion_msg_msg_type type; + pb_extension_t *extensions; +} criterion_msg; + +/* Extensions */ +extern const pb_extension_type_t criterion_birth_data; /* field type: criterion_birth data; */ +extern const pb_extension_type_t criterion_pre_init_data; /* field type: criterion_pre_init data; */ +extern const pb_extension_type_t criterion_pre_test_data; /* field type: criterion_pre_test data; */ +extern const pb_extension_type_t criterion_post_test_data; /* field type: criterion_post_test data; */ +extern const pb_extension_type_t criterion_post_fini_data; /* field type: criterion_post_fini data; */ +extern const pb_extension_type_t criterion_death_data; /* field type: criterion_death data; */ +extern const pb_extension_type_t criterion_assert_data; /* field type: criterion_assert data; */ + +/* Default values for struct fields */ +extern const int32_t criterion_msg_version_default; +extern const criterion_msg_id_msg_id_type criterion_msg_id_msg_type_default; + +/* Initializer values for message structs */ +#define criterion_msg_init_default {1, criterion_msg_id_msg_init_default, (criterion_msg_msg_type)0, NULL} +#define criterion_msg_id_msg_init_default {criterion_msg_id_msg_id_type_PID, false, 0, {{NULL}, NULL}} +#define criterion_birth_init_default {0} +#define criterion_pre_init_init_default {0} +#define criterion_pre_test_init_default {false, 0} +#define criterion_post_test_init_default {false, 0} +#define criterion_post_fini_init_default {0} +#define criterion_death_init_default {false, (criterion_death_result_type)0, false, 0} +#define criterion_assert_init_default {{{NULL}, NULL}, 0, {{NULL}, NULL}, false, 0} +#define criterion_msg_init_zero {0, criterion_msg_id_msg_init_zero, (criterion_msg_msg_type)0, NULL} +#define criterion_msg_id_msg_init_zero {(criterion_msg_id_msg_id_type)0, false, 0, {{NULL}, NULL}} +#define criterion_birth_init_zero {0} +#define criterion_pre_init_init_zero {0} +#define criterion_pre_test_init_zero {false, 0} +#define criterion_post_test_init_zero {false, 0} +#define criterion_post_fini_init_zero {0} +#define criterion_death_init_zero {false, (criterion_death_result_type)0, false, 0} +#define criterion_assert_init_zero {{{NULL}, NULL}, 0, {{NULL}, NULL}, false, 0} + +/* Field tags (for use in manual encoding/decoding) */ +#define criterion_assert_message_tag 1 +#define criterion_assert_passed_tag 2 +#define criterion_assert_file_tag 3 +#define criterion_assert_line_tag 4 +#define criterion_death_result_tag 1 +#define criterion_death_status_tag 2 +#define criterion_msg_id_msg_type_tag 1 +#define criterion_msg_id_msg_id_int_tag 2 +#define criterion_msg_id_msg_id_str_tag 3 +#define criterion_post_test_timestamp_tag 1 +#define criterion_pre_test_timestamp_tag 1 +#define criterion_msg_version_tag 1 +#define criterion_msg_id_tag 2 +#define criterion_msg_type_tag 3 +#define criterion_birth_data_tag 100 +#define criterion_pre_init_data_tag 101 +#define criterion_pre_test_data_tag 102 +#define criterion_post_test_data_tag 103 +#define criterion_post_fini_data_tag 104 +#define criterion_death_data_tag 105 +#define criterion_assert_data_tag 106 + +/* Struct field encoding specification for nanopb */ +extern const pb_field_t criterion_msg_fields[5]; +extern const pb_field_t criterion_msg_id_msg_fields[4]; +extern const pb_field_t criterion_birth_fields[1]; +extern const pb_field_t criterion_pre_init_fields[1]; +extern const pb_field_t criterion_pre_test_fields[2]; +extern const pb_field_t criterion_post_test_fields[2]; +extern const pb_field_t criterion_post_fini_fields[1]; +extern const pb_field_t criterion_death_fields[3]; +extern const pb_field_t criterion_assert_fields[5]; + +/* Maximum encoded size of messages (where known) */ +#define criterion_msg_size (19 + criterion_msg_id_msg_size) +#define criterion_birth_size 0 +#define criterion_pre_init_size 0 +#define criterion_pre_test_size 11 +#define criterion_post_test_size 11 +#define criterion_post_fini_size 0 +#define criterion_death_size 13 + +/* Message IDs (where set with "msgid" option) */ +#ifdef PB_MSGID + +#define CRITERION_MESSAGES \ + + +#endif + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif