diff --git a/Il2CppTests/TestRunner.cs b/Il2CppTests/TestRunner.cs index 1401e71..370d0e4 100644 --- a/Il2CppTests/TestRunner.cs +++ b/Il2CppTests/TestRunner.cs @@ -54,6 +54,9 @@ namespace Il2CppInspector MustCompile = true }.WriteSingleFile(testPath + $@"\test-result{nameSuffix}.cs"); + new JSONMetadata(appModel) + .Write(testPath + $@"\test-result{nameSuffix}.json"); + new IDAPythonScript(appModel) .WriteScriptToFile(testPath + $@"\test-ida-result{nameSuffix}.py", testPath + $@"\test-cpp-result{nameSuffix}\appdata\il2cpp-types.h"); @@ -67,6 +70,7 @@ namespace Il2CppInspector var suffix = (i > 0 ? "-" + i : ""); compareFiles(testPath, suffix + ".cs", $"test-result{suffix}.cs"); + compareFiles(testPath, suffix + ".json", $"test-result{suffix}.json"); compareFiles(testPath, suffix + ".h", $@"test-cpp-result{suffix}\appdata\il2cpp-types.h"); compareFiles(testPath, suffix + ".py", $"test-ida-result{suffix}.py"); } diff --git a/Il2CppTests/update-expected-results.ps1 b/Il2CppTests/update-expected-results.ps1 index 97d3dcc..1ee26ca 100644 --- a/Il2CppTests/update-expected-results.ps1 +++ b/Il2CppTests/update-expected-results.ps1 @@ -6,8 +6,10 @@ # It is only intended to be used during development, not for end-user scenarios # Get all test results -$bin = (gci "$PSScriptRoot/TestBinaries/*/*" -Filter test-result.cs) -$bin2 = (gci "$PSScriptRoot/TestBinaries/*/*" -Filter test-result-1.cs) +$cs = (gci "$PSScriptRoot/TestBinaries/*/*" -Filter test-result.cs) +$cs2 = (gci "$PSScriptRoot/TestBinaries/*/*" -Filter test-result-1.cs) +$json = (gci "$PSScriptRoot/TestBinaries/*/*" -Filter test-result.json) +$json2 = (gci "$PSScriptRoot/TestBinaries/*/*" -Filter test-result-1.json) $py = (gci "$PSScriptRoot/TestBinaries/*/*" -Filter test-ida-result.py) $py2 = (gci "$PSScriptRoot/TestBinaries/*/*" -Filter test-ida-result-1.py) $cpp = (gci "$PSScriptRoot/TestBinaries/*/test-cpp-result/appdata/*" -Filter il2cpp-types.h) @@ -16,16 +18,26 @@ $cpp2 = (gci "$PSScriptRoot/TestBinaries/*/test-cpp-result-1/appdata/*" -Filter # Get path to expected test results $results = "$PSScriptRoot/TestExpectedResults" -$bin | % { +$cs | % { $target = $results + "/" + (Split-Path -Path (Split-Path -Path $_) -Leaf) + ".cs" cp $_ -Destination $target -Force } -$bin2 | % { +$cs2 | % { $target = $results + "/" + (Split-Path -Path (Split-Path -Path $_) -Leaf) + "-1.cs" cp $_ -Destination $target -Force } +$json | % { + $target = $results + "/" + (Split-Path -Path (Split-Path -Path $_) -Leaf) + ".json" + cp $_ -Destination $target -Force +} + +$json2 | % { + $target = $results + "/" + (Split-Path -Path (Split-Path -Path $_) -Leaf) + "-1.json" + cp $_ -Destination $target -Force +} + $py | % { $target = $results + "/" + (Split-Path -Path (Split-Path -Path $_) -Leaf) + ".py" cp $_ -Destination $target -Force @@ -37,11 +49,11 @@ $py2 | % { } $cpp | % { - $target = $results + "/" + (Split-Path -Path (Split-Path -Path (Split-Path -Path $_)) -Leaf) + ".h" + $target = $results + "/" + (Split-Path -Path (Split-Path -Path (Split-Path -Path (Split-Path -Path $_))) -Leaf) + ".h" cp $_ -Destination $target -Force } $cpp2 | % { - $target = $results + "/" + (Split-Path -Path (Split-Path -Path (Split-Path -Path $_)) -Leaf) + "-1.h" + $target = $results + "/" + (Split-Path -Path (Split-Path -Path (Split-Path -Path (Split-Path -Path $_))) -Leaf) + "-1.h" cp $_ -Destination $target -Force } \ No newline at end of file