Esempio n. 1
0
def do(msg_proto_file_list, output_dir, base_idx, gap, pkg_name,
       namespace_list):
    msg_list_group = []

    for msg_proto_file in msg_proto_file_list:
        one_file_msg_mgr_ = one_file_msg_mgr.OneFileMsgMgr()

        if one_file_msg_mgr_.read_msg(msg_proto_file) != 0:
            return -1

        msg_list_group.append(one_file_msg_mgr_.msg_list)

    generator_list = [
        msg_id_proto_file_generator.generate_msg_id_proto_file,
        cpp_msg_handler_files_generator.generate_cpp_msg_handler_file,
        test_action_files_generator.generate_test_action_file,
        test_case_files_generator.generate_test_case_file,
        csharp_msg_handler_file_generator.generate_csharp_msg_handler_file
    ]

    for generator in generator_list:
        if generator(msg_proto_file, msg_list_group, output_dir, base_idx, gap,
                     pkg_name, namespace_list) != 0:
            return -1

    return 0
Esempio n. 2
0
def test_001():
    msg_list_group = []
    msg_mgr_ = one_file_msg_mgr.OneFileMsgMgr()

    msg_proto_file = 'demo_msg.proto'
    if msg_mgr_.read_msg(msg_proto_file) != 0:
        return -1

    msg_list_group.append(msg_mgr_.msg_list)

    if generate_cpp_msg_handler_file(msg_proto_file, msg_list_group, './output/demo', None, None,
                                     'com::moon::demo', ['proto_tcp', 'http']) != 0:
        return -1

    return 0
def test_001():
    msg_list_group = []
    one_file_msg_mgr_ = one_file_msg_mgr.OneFileMsgMgr()

    msg_proto_file = 'demo_msg.proto'
    if one_file_msg_mgr_.read_msg(msg_proto_file) != 0:
        return -1

    msg_list_group.append(one_file_msg_mgr_.msg_list)

    if generate_msg_id_proto_file(msg_proto_file, msg_list_group,
                                  './output/demo', 1000, 50, 'com.moon.demo',
                                  None) != 0:
        return -1

    return 0