Have TestRunner output IDA scripts too

This is done as a sanity check to make sure we aren't breaking IDA output.
This commit is contained in:
Robert Xiao
2020-04-11 00:43:46 -07:00
committed by Katy
parent ab5fc836a1
commit 3cd5af09fc

View File

@@ -43,12 +43,19 @@ namespace Il2CppInspector
// Dump each image in the binary separately // Dump each image in the binary separately
int i = 0; int i = 0;
foreach (var il2cpp in inspectors) foreach (var il2cpp in inspectors) {
new CSharpCodeStubs(new Il2CppModel(il2cpp)) { var model = new Il2CppModel(il2cpp);
ExcludedNamespaces = Constants.DefaultExcludedNamespaces, var nameSuffix = i++ > 0 ? "-" + (i - 1) : "";
SuppressMetadata = false,
MustCompile = true new CSharpCodeStubs(model) {
}.WriteSingleFile(testPath + @"\test-result" + (i++ > 0 ? "-" + (i - 1) : "") + ".cs"); ExcludedNamespaces = Constants.DefaultExcludedNamespaces,
SuppressMetadata = false,
MustCompile = true
}.WriteSingleFile(testPath + $@"\test-result{nameSuffix}.cs");
new IDAPythonScript(model)
.WriteScriptToFile(testPath + $@"\test-ida-result{nameSuffix}.py");
}
// Compare test result with expected result // Compare test result with expected result
for (i = 0; i < inspectors.Count; i++) { for (i = 0; i < inspectors.Count; i++) {