From 3cd5af09fcb3e811de58d6460bbf0dccf3a4e01c Mon Sep 17 00:00:00 2001 From: Robert Xiao Date: Sat, 11 Apr 2020 00:43:46 -0700 Subject: [PATCH] Have TestRunner output IDA scripts too This is done as a sanity check to make sure we aren't breaking IDA output. --- Il2CppTests/TestRunner.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Il2CppTests/TestRunner.cs b/Il2CppTests/TestRunner.cs index d944075..225d8aa 100644 --- a/Il2CppTests/TestRunner.cs +++ b/Il2CppTests/TestRunner.cs @@ -43,12 +43,19 @@ namespace Il2CppInspector // Dump each image in the binary separately int i = 0; - foreach (var il2cpp in inspectors) - new CSharpCodeStubs(new Il2CppModel(il2cpp)) { - ExcludedNamespaces = Constants.DefaultExcludedNamespaces, - SuppressMetadata = false, - MustCompile = true - }.WriteSingleFile(testPath + @"\test-result" + (i++ > 0 ? "-" + (i - 1) : "") + ".cs"); + foreach (var il2cpp in inspectors) { + var model = new Il2CppModel(il2cpp); + var nameSuffix = i++ > 0 ? "-" + (i - 1) : ""; + + new CSharpCodeStubs(model) { + 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 for (i = 0; i < inspectors.Count; i++) {