MCPcopy Create free account
hub / github.com/boost-ext/di / create_java_test

Function create_java_test

benchmark/generate_test.py:93–106  ·  view source on GitHub ↗
(types, ctor_args, iterations, expected, file, struct, header, module, main, impl)

Source from the content-addressed store, hash-verified

91 f.write("}\n")
92
93def create_java_test(types, ctor_args, iterations, expected, file, struct, header, module, main, impl):
94 with open(file, 'w') as f:
95 f.write(header)
96 f.write("class Global { public static long g = 0; }\n")
97 for o in create_data(types, ctor_args, struct):
98 f.write(o + "\n")
99 f.write("\n" + module + "\n")
100 f.write("\npublic class " + os.path.splitext(file)[0] + " {\n")
101 f.write("\npublic static void main(String[] args) {\n")
102 f.write(main)
103 f.write("\nfor (int i = 0; i < " + str(iterations) + "; ++i) {\n")
104 f.write(impl)
105 f.write("}\nSystem.exit(" + str(expected) + "!= Global.g ? 1 : 0);")
106 f.write("\n}\n}")
107
108def create_csharp_test(types, ctor_args, iterations, expected, file, struct, header, module, main, impl):
109 with open(file, 'w') as f:

Callers 1

generate_test.pyFile · 0.85

Calls 1

create_dataFunction · 0.85

Tested by

no test coverage detected