@@ -0,0 +1,1593 @@
+import argparse%0Aimport os%0A%0Afrom fun_parse import fun_parse%0Afrom fun_list_get import fun_list_get%0Afrom generate_mock_h import generate_mock_h%0Afrom generate_mock_c import generate_mock_c%0A%0Aargp = argparse.ArgumentParser(description='Generate mocks from given header file.')%0Aargp.add_argument('file', help=%22Header file from which mock is generated.%22)%0Aargp.add_argument('-o', '--out', default=%22%22, dest='out', help=%22Directory where generated mocks should be stored.%22)%0Aargp.add_argument('-i', '--include_path', default=%22%22, dest='inc', metavar='INC', help=%22Include directory for mocked header used in generated source files.%22)%0Aargp.add_argument('--version', action='version', version='%25(prog)s 0.1.0')%0A%0Aargs = argp.parse_args()%0A%0Afilepath = args.file%0Aout_dir = args.out%0Ainc_path = args.inc%0A%0Afilename = os.path.basename(filepath)%0Afile_no_ext = os.path.splitext(filename)%5B0%5D%0A%0Aif out_dir%5B-1%5D is not '/':%0A    out_dir += '/'%0A%0Aif inc_path%5B-1%5D is not '/':%0A    inc_path += '/'%0A%0Awith open(filepath, %22r%22) as file:%0A    fun_list = fun_list_get(file.read())%0A%0Afun_data = %5B%5D%0Afor fun in fun_list:%0A    fun_name, ret_type, arg_types = fun_parse(fun)%0A    fun_data.append((fun_name, ret_type, arg_types))%0A%0Amock_h = generate_mock_h(file_no_ext, fun_data)%0Amock_c = generate_mock_c(file_no_ext, inc_path, fun_data)%0A%0Amock_c_file = %22%7B0%7D%7B1%7D.c%22.format(out_dir, file_no_ext)%0Amock_h_file = %22%7B0%7D%7B1%7D.h%22.format(out_dir, file_no_ext)%0A%0Aif out_dir is not %22%22 and not os.path.exists(out_dir):%0A    os.makedirs(out_dir)%0A%0Awith open(mock_h_file, %22w%22) as file:%0A    file.write(mock_h)%0A%0Awith open(mock_c_file, %22w%22) as file:%0A    file.write(mock_c)

create script for generating mocks from a given header.