jak-project/scripts/add-reference-test.py
Tyler Wilding 698d96cc4e
Decompilation: Next batch of files (#539)
* decomp: `collide-frag-h`

* decomp: `effect-control-h`

* decomp: `cam-update-h`

* decomp: `collide-func`

variable pass failed on ray-plane-intersect: invalid unordered_map<K, T> key

* decomp: `cylinder` with vector dot product issue

* decomp: `debug-sphere`

* decomp: `generic`

* decomp: fix `effect-control-h`

* scripts: improve decomp-next script

* decomp: Fix `debug-sphere` issues via type casting

* decomp: Add `collide-frag-h` to reference tests

* scripts: Add script to add a new reference test

* decomp: Add `cam-update-h` to reference tests

* goalc: Fix empty let removal issue

* decomp: Not adding cylinder to goal_src yet either

* decomp: Add `debug-sphere` to reference tests

* decomp: Attempt to finish `generic` but blocked by decomp issue

https://github.com/water111/jak-project/issues/563

* linting

* decomp: Resolve failing tests

* decomp: Address feedback
2021-06-06 23:01:30 -04:00

35 lines
874 B
Python

# Decompiles and adds the file to the reference test folder
from jak1_file_list import file_list
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--file")
args = parser.parse_args()
if not args.file:
print("No --file argument provided!")
exit(1)
import os
# TODO - make customizable
if not os.path.exists("./decompiler_out/jak1/{}_disasm.gc".format(args.file)):
print("File not already decompiled!")
exit(1)
src_path = ""
for f in file_list:
if f[2] != 3:
continue
if f[0] == args.file:
src_path = f[4]
break
if not os.path.exists("./test/decompiler/reference/{}".format(src_path)):
os.makedirs("./test/decompiler/reference/{}".format(src_path))
import shutil
shutil.copy("./decompiler_out/jak1/{}_disasm.gc".format(args.file), "./test/decompiler/reference/{}/{}_REF.gc".format(src_path, args.file))
print("Copied!")