mirror of
https://github.com/open-goal/jak-project.git
synced 2024-11-22 21:59:53 +00:00
tests/jak2: Better prepare offline tests for multiple games (#1591)
* git: ignore vs build dir * cmake: ditch `clang-cl` on windows in favor of actual `clang` * build: suppress a significant number of warnings * build: adjust workflows and vendor nasm * docs: update docs to remove `clang-cl` mentions * tests: move jak1 reference tests into their own folder * tests: update offline tests to support multiple games * tests: some additional fixes and multi-game handling * tests: update reference tests
This commit is contained in:
parent
9ede08977f
commit
8a18072d97
3
.gitattributes
vendored
3
.gitattributes
vendored
@ -1,3 +1,6 @@
|
||||
# Ensure line endings are consistently 'LF'
|
||||
* text=auto
|
||||
|
||||
third-party/**/* linguist-vendored
|
||||
third-party/**/* linguist-generated
|
||||
test/decompiler/reference/** linguist-vendored
|
||||
|
1
.github/workflows/linux-workflow.yaml
vendored
1
.github/workflows/linux-workflow.yaml
vendored
@ -54,7 +54,6 @@ jobs:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
run: |
|
||||
ls -l ${{ github.workspace }}/buildcache/bin/buildcache
|
||||
cmake -B build \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DASAN_BUILD=ON \
|
||||
|
@ -41,56 +41,61 @@
|
||||
"type": "default",
|
||||
"project": "CMakeLists.txt",
|
||||
"projectTarget": "offline-test.exe (bin\\offline-test.exe)",
|
||||
"name": "Tests - Offline Tests",
|
||||
"args": ["${workspaceRoot}/iso_data/jak1"]
|
||||
"name": "Tests - Offline Tests - Jak 1",
|
||||
"args": [
|
||||
"--iso_data_path",
|
||||
"${workspaceRoot}/iso_data/jak1",
|
||||
"--game",
|
||||
"jak1"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "default",
|
||||
"project": "CMakeLists.txt",
|
||||
"projectTarget": "gk.exe (bin\\gk.exe)",
|
||||
"name": "Run - Runtime (no kernel)",
|
||||
"name": "Game - Runtime (no kernel)",
|
||||
"args": ["-fakeiso", "-debug", "-nokernel", "-v", "-nodisplay"]
|
||||
},
|
||||
{
|
||||
"type": "default",
|
||||
"project": "CMakeLists.txt",
|
||||
"projectTarget": "gk.exe (bin\\gk.exe)",
|
||||
"name": "Run - Runtime (with kernel)",
|
||||
"name": "Game - Runtime (with kernel)",
|
||||
"args": ["-fakeiso", "-debug", "-v"]
|
||||
},
|
||||
{
|
||||
"type": "default",
|
||||
"project": "CMakeLists.txt",
|
||||
"projectTarget": "gk.exe (bin\\gk.exe)",
|
||||
"name": "Run - Runtime (boot)",
|
||||
"name": "Game - Runtime (boot)",
|
||||
"args": ["-boot", "-fakeiso", "-debug", "-v"]
|
||||
},
|
||||
{
|
||||
"type": "default",
|
||||
"project": "CMakeLists.txt",
|
||||
"projectTarget": "gk.exe (bin\\gk.exe)",
|
||||
"name": "Run - Runtime (boot no debug)",
|
||||
"name": "Game - Runtime (boot no debug)",
|
||||
"args": ["-boot", "-fakeiso", "-v"]
|
||||
},
|
||||
{
|
||||
"type": "default",
|
||||
"project": "CMakeLists.txt",
|
||||
"projectTarget": "goalc.exe (bin\\goalc.exe)",
|
||||
"name": "Run - REPL",
|
||||
"name": "REPL",
|
||||
"args": ["--user-auto"]
|
||||
},
|
||||
{
|
||||
"type": "default",
|
||||
"project": "CMakeLists.txt",
|
||||
"projectTarget": "goalc.exe (bin\\goalc.exe)",
|
||||
"name": "Run - REPL - Auto Listen",
|
||||
"name": "REPL - Auto Listen",
|
||||
"args": ["--user-auto", "--auto-lt"]
|
||||
},
|
||||
{
|
||||
"type": "default",
|
||||
"project": "CMakeLists.txt",
|
||||
"projectTarget": "decompiler.exe (bin\\decompiler.exe)",
|
||||
"name": "Run - Decompiler - Jak 1",
|
||||
"name": "Decompiler - Jak 1",
|
||||
"args": [
|
||||
"${workspaceRoot}/decompiler/config/jak1_ntsc_black_label.jsonc",
|
||||
"${workspaceRoot}/iso_data",
|
||||
@ -101,7 +106,7 @@
|
||||
"type": "default",
|
||||
"project": "CMakeLists.txt",
|
||||
"projectTarget": "decompiler.exe (bin\\decompiler.exe)",
|
||||
"name": "Run - Decompiler - Jak 1 - Data Only",
|
||||
"name": "Decompiler - Jak 1 - Data Only",
|
||||
"args": [
|
||||
"${workspaceRoot}/decompiler/config/jak1_ntsc_black_label.jsonc",
|
||||
"${workspaceRoot}/iso_data",
|
||||
@ -113,7 +118,7 @@
|
||||
"type": "default",
|
||||
"project": "CMakeLists.txt",
|
||||
"projectTarget": "decompiler.exe (bin\\decompiler.exe)",
|
||||
"name": "Run - Decompiler - Jak 1 PAL",
|
||||
"name": "Decompiler - Jak 1 PAL",
|
||||
"args": [
|
||||
"${workspaceRoot}/decompiler/config/jak1_pal.jsonc",
|
||||
"${workspaceRoot}/iso_data",
|
||||
@ -124,7 +129,7 @@
|
||||
"type": "default",
|
||||
"project": "CMakeLists.txt",
|
||||
"projectTarget": "decompiler.exe (bin\\decompiler.exe)",
|
||||
"name": "Run - Disassembler - Jak 1",
|
||||
"name": "Disassembler - Jak 1",
|
||||
"args": [
|
||||
"${workspaceRoot}/decompiler/config/jak1_ntsc_black_label.jsonc",
|
||||
"${workspaceRoot}/iso_data",
|
||||
@ -135,7 +140,7 @@
|
||||
"type": "default",
|
||||
"project": "CMakeLists.txt",
|
||||
"projectTarget": "decompiler.exe (bin\\decompiler.exe)",
|
||||
"name": "Run - Decompiler - Jak 2",
|
||||
"name": "Decompiler - Jak 2",
|
||||
"args": [
|
||||
"${workspaceRoot}/decompiler/config/jak2_ntsc_v1.jsonc",
|
||||
"${workspaceRoot}/iso_data",
|
||||
@ -146,24 +151,14 @@
|
||||
"type": "default",
|
||||
"project": "CMakeLists.txt",
|
||||
"projectTarget": "memory_dump_tool.exe (bin\\memory_dump_tool.exe)",
|
||||
"name": "Run - EE Memory Analyze",
|
||||
"name": "Tools - EE Memory Analyze",
|
||||
"args": ["${workspaceRoot}/eeMemory.bin", "${workspaceRoot}"]
|
||||
},
|
||||
{
|
||||
"type": "default",
|
||||
"project": "CMakeLists.txt",
|
||||
"projectTarget": "memory_dump_tool.exe (bin\\memory_dump_tool.exe)",
|
||||
"name": "Run - EE Memory Analyze - Test",
|
||||
"args": [
|
||||
"\"C:\\Users\\xtvas\\Repositories\\pcsx2\\128mb\\sstates\\SCUS-97124 (1B3976AB).00.p2s\"",
|
||||
"${workspaceRoot}"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "default",
|
||||
"project": "CMakeLists.txt",
|
||||
"projectTarget": "dgo_unpacker.exe (bin\\dgo_unpacker.exe)",
|
||||
"name": "Run - DGO Unpacker (test)",
|
||||
"name": "Tools - DGO Unpacker (test)",
|
||||
"args": [
|
||||
"C:\\GameData\\Jak1\\Backup\\DGO-PAL\\GAME",
|
||||
"C:\\GameData\\Jak1\\Backup\\DISC-PAL\\CGO\\GAME.CGO"
|
||||
@ -173,8 +168,8 @@
|
||||
"type": "default",
|
||||
"project": "CMakeLists.txt",
|
||||
"projectTarget": "extractor.exe (bin\\extractor.exe)",
|
||||
"name": "Run - Extractor - Extract",
|
||||
"args": ["\"E:\\ISOs\\Jak\\дWTF平仮名WTF\\Jak 1.iso\""]
|
||||
"name": "Tools - Extractor - Extract",
|
||||
"args": ["E:\\ISOs\\Jak\\Jak 1.iso"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
16
Taskfile.yml
16
Taskfile.yml
@ -111,7 +111,7 @@ tasks:
|
||||
# TESTS
|
||||
offline-tests:
|
||||
cmds:
|
||||
- '{{.OFFLINETEST_BIN_RELEASE_DIR}}/offline-test "./iso_data/{{.GAME}}"'
|
||||
- '{{.OFFLINETEST_BIN_RELEASE_DIR}}/offline-test --iso_data_path "./iso_data/{{.GAME}}" --game {{.GAME}}'
|
||||
# TODO - update or replace
|
||||
# add-reference-test:
|
||||
# cmds:
|
||||
@ -122,13 +122,13 @@ tasks:
|
||||
# cmds:
|
||||
# - python ./scripts/add-reference-test.py --file "{{.FILES}}"
|
||||
# - task: offline-tests
|
||||
# update-reference-tests:
|
||||
# cmds:
|
||||
# - cmd: python ./scripts/default-file-or-folder.py --path failures
|
||||
# - cmd: '{{.OFFLINETEST_BIN_RELEASE_DIR}}/offline-test "./iso_data/{{.GAME}}" --dump-mode'
|
||||
# ignore_error: true
|
||||
# - python ./scripts/update_decomp_reference.py ./failures ./test/decompiler/reference/
|
||||
# - task: offline-tests
|
||||
update-reference-tests:
|
||||
cmds:
|
||||
- cmd: python ./scripts/default-file-or-folder.py --path failures
|
||||
- cmd: '{{.OFFLINETEST_BIN_RELEASE_DIR}}/offline-test --iso_data_path "./iso_data/{{.GAME}}" --game {{.GAME}} --dump_current_output'
|
||||
ignore_error: true
|
||||
- python ./scripts/update_decomp_reference.py ./failures ./test/decompiler/reference/
|
||||
- task: offline-tests
|
||||
# find-label-types:
|
||||
# cmds:
|
||||
# - python ./scripts/next-decomp-file.py --files "{{.FILES}}"
|
||||
|
@ -518,4 +518,16 @@ FILE* open_file(const fs::path& path, std::string mode) {
|
||||
#endif
|
||||
}
|
||||
|
||||
std::vector<fs::path> find_files_recursively(const fs::path base_dir, const std::regex& pattern) {
|
||||
std::vector<fs::path> files = {};
|
||||
for (auto& p : fs::recursive_directory_iterator(base_dir)) {
|
||||
if (p.is_regular_file()) {
|
||||
if (std::regex_match(fs::path(p.path()).filename().string(), pattern)) {
|
||||
files.push_back(p.path());
|
||||
}
|
||||
}
|
||||
}
|
||||
return files;
|
||||
}
|
||||
|
||||
} // namespace file_util
|
||||
|
@ -17,6 +17,7 @@
|
||||
#endif
|
||||
|
||||
#include <optional>
|
||||
#include <regex>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@ -54,6 +55,6 @@ void ISONameFromAnimationName(char* dst, const char* src);
|
||||
void assert_file_exists(const char* path, const char* error_message);
|
||||
bool dgo_header_is_compressed(const std::vector<u8>& data);
|
||||
std::vector<u8> decompress_dgo(const std::vector<u8>& data_in);
|
||||
|
||||
FILE* open_file(const fs::path& path, std::string mode);
|
||||
std::vector<fs::path> find_files_recursively(const fs::path base_dir, const std::regex& pattern);
|
||||
} // namespace file_util
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user