From aaf40a0bfd574f954c5e0500611fdf893cc262c8 Mon Sep 17 00:00:00 2001 From: snake-biscuits <36507175+snake-biscuits@users.noreply.github.com> Date: Sat, 27 Nov 2021 18:25:44 +1000 Subject: [PATCH] updating tests for #16 & adding Cry of Fear to tests --- README.md | 5 +- pytest_all_bsps.log | 319 ++++++++++++++++++++++++--------------- tests/maplist.py | 20 ++- tests/test_d3d_bsp.py | 36 +++++ tests/test_idtech_bsp.py | 46 +++--- tests/test_valve_bsp.py | 42 +++--- 6 files changed, 301 insertions(+), 167 deletions(-) create mode 100644 tests/test_d3d_bsp.py diff --git a/README.md b/README.md index c1f49bb6..b90c04b4 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,7 @@ Full documentation: [snake-biscuits.github.io/bsp_tool/](https://snake-biscuits. - Call of Duty: Black Ops III :o: - [Call of Duty: United Offensive](https://github.com/snake-biscuits/bsp_tool/tree/master/bsp_tool/branches/infinity_ward/call_of_duty1.py) :o: - Call of Duty: World at War :o: + - [Cry of Fear](https://github.com/snake-biscuits/bsp_tool/tree/master/bsp_tool/branches/valve/goldsrc.py) - [Fortress Forever](https://github.com/snake-biscuits/bsp_tool/tree/master/bsp_tool/branches/valve/orange_box.py) - [G-String](https://github.com/snake-biscuits/bsp_tool/tree/master/bsp_tool/branches/valve/orange_box.py) - [Garry's Mod](https://github.com/snake-biscuits/bsp_tool/tree/master/bsp_tool/branches/valve/orange_box.py) @@ -156,6 +157,8 @@ Full documentation: [snake-biscuits.github.io/bsp_tool/](https://snake-biscuits. ## Thanks * [BobTheBob](https://github.com/BobTheBob9) - Identified loads of Titanfall lumps (90% of static props + more) + * [Call of Duty Promod Team](https://github.com/promod) + - For distributing safe links to Call of Duty 4 Mod Tools * [Chris Strahl](https://github.com/Chrissstrahl) - Preserving **extensive** documentation, mods & source code for Quake 3 & Ubertools games * [Ficool2](https://github.com/ficool2) @@ -173,4 +176,4 @@ Full documentation: [snake-biscuits.github.io/bsp_tool/](https://snake-biscuits. * [Taskinoz](https://github.com/taskinoz) - Helping me find people that can actively use my research & tools * All of the Wiki Editors - - Except the uncited `Id Tech 3 -> Treyarch NGL` on CoDWiki, that was a massive pain to verify + - Except for the uncited `Id Tech 3 -> Treyarch NGL` on CoDWiki **[citation needed]** diff --git a/pytest_all_bsps.log b/pytest_all_bsps.log index 25fa958b..d1f29a15 100644 --- a/pytest_all_bsps.log +++ b/pytest_all_bsps.log @@ -3,7 +3,7 @@ platform win32 -- Python 3.9.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 -- c:\use cachedir: .pytest_cache rootdir: C:\Users\Jared\Documents\GitHub\bsp_tool plugins: cov-2.12.1 -collecting ... collected 139 items +collecting ... collected 143 items tests/test_bsp.py::test_load_bsp[./-tests/maps-map_dirs0] PASSED [ 0%] tests/test_bsp.py::test_load_bsp[C:/Program Files (x86)/Steam/steamapps/sourcemods-gesource-map_dirs1] PASSED [ 1%] @@ -11,132 +11,136 @@ tests/test_bsp.py::test_load_bsp[C:/Program Files (x86)/Steam/steamapps/sourcemo tests/test_bsp.py::test_load_bsp[C:/Program Files (x86)/Steam/steamapps/sourcemods-TFTS-map_dirs3] PASSED [ 2%] tests/test_bsp.py::test_load_bsp[C:/Program Files (x86)/Steam/steamapps/sourcemods-episodeone-map_dirs4] PASSED [ 3%] tests/test_bsp.py::test_load_bsp[C:/Program Files (x86)/Steam/steamapps/sourcemods-RunThinkShootLiveVille2-map_dirs5] PASSED [ 4%] -tests/test_bsp.py::test_load_bsp[C:/Program Files (x86)/Steam/steamapps/sourcemods-cromulentville2-map_dirs6] PASSED [ 5%] +tests/test_bsp.py::test_load_bsp[C:/Program Files (x86)/Steam/steamapps/sourcemods-cromulentville2-map_dirs6] PASSED [ 4%] tests/test_bsp.py::test_load_bsp[C:/Program Files (x86)/Steam/steamapps/sourcemods-companionpiece2-map_dirs7] PASSED [ 5%] tests/test_bsp.py::test_load_bsp[C:/Program Files (x86)/Steam/steamapps/sourcemods-eyecandy-map_dirs8] PASSED [ 6%] -tests/test_bsp.py::test_load_bsp[C:/Program Files (x86)/Steam/steamapps/sourcemods-tworooms-map_dirs9] PASSED [ 7%] +tests/test_bsp.py::test_load_bsp[C:/Program Files (x86)/Steam/steamapps/sourcemods-tworooms-map_dirs9] PASSED [ 6%] tests/test_bsp.py::test_load_bsp[C:/Program Files (x86)/Steam/steamapps/sourcemods-fusionville2-map_dirs10] PASSED [ 7%] -tests/test_bsp.py::test_load_bsp[C:/Program Files (x86)/Steam/steamapps/sourcemods-lvl2-map_dirs11] PASSED [ 8%] -tests/test_bsp.py::test_load_bsp[C:/Program Files (x86)/Steam/steamapps/sourcemods-thewrapuptwo-map_dirs12] PASSED [ 9%] -tests/test_bsp.py::test_load_bsp[C:/Program Files (x86)/Steam/steamapps/sourcemods-halloweenhorror4-map_dirs13] PASSED [ 10%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Half-Life/cstrike-map_dirs14] PASSED [ 10%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Half-Life/czero-map_dirs15] PASSED [ 11%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Half-Life/czeror-map_dirs16] PASSED [ 12%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Half-Life/dmc-map_dirs17] PASSED [ 12%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Half-Life/dod-map_dirs18] PASSED [ 13%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Half-Life/gearbox-map_dirs19] PASSED [ 14%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Half-Life/ricochet-map_dirs20] PASSED [ 15%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Half-Life/tfc-map_dirs21] PASSED [ 15%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Half-Life/valve-map_dirs22] PASSED [ 16%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Halfquake Trilogy-map_dirs23] PASSED [ 17%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Sven Co-op-map_dirs24] PASSED [ 17%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Alien Swarm-map_dirs25] PASSED [ 18%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Alien Swarm Reactive Drop-map_dirs26] PASSED [ 19%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Blade Symphony-map_dirs27] PASSED [ 20%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Counter-Strike Global Offensive-map_dirs28] PASSED [ 20%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-counter-strike source-map_dirs29] PASSED [ 21%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-day of defeat source-map_dirs30] PASSED [ 22%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Fortress Forever-map_dirs31] PASSED [ 23%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-G String-map_dirs32] PASSED [ 23%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-GarrysMod-map_dirs33] PASSED [ 24%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Half-Life 1 Source Deathmatch-map_dirs34] PASSED [ 25%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-half-life 2/ep2-map_dirs35] PASSED [ 25%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-half-life 2/episodic-map_dirs36] PASSED [ 26%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-half-life 2/hl1-map_dirs37] PASSED [ 27%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-half-life 2/hl2-map_dirs38] PASSED [ 28%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-half-life 2/lostcoast-map_dirs39] PASSED [ 28%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-half-life 2 deathmatch-map_dirs40] PASSED [ 29%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Half-Life 2 Update-map_dirs41] PASSED [ 30%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-left 4 dead-map_dirs42] PASSED [ 30%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Left 4 Dead 2-map_dirs43] PASSED [ 31%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-MINERVA-map_dirs44] PASSED [ 32%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-NEOTOKYO-map_dirs45] PASSED [ 33%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Portal-map_dirs46] PASSED [ 33%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Portal 2-map_dirs47] PASSED [ 34%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Portal Reloaded-map_dirs48] PASSED [ 35%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-SourceFilmmaker-map_dirs49] PASSED [ 35%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Synergy-map_dirs50] PASSED [ 36%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Team Fortress 2-map_dirs51] FAILED [ 37%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Transmissions Element 120-map_dirs52] PASSED [ 38%] -tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Vampire The Masquerade - Bloodlines-map_dirs53] PASSED [ 38%] -tests/test_bsp.py::test_load_bsp[E:/Mod-Anachronox-map_dirs54] PASSED [ 39%] -tests/test_bsp.py::test_load_bsp[E:/Mod-Daikatana-map_dirs55] PASSED [ 40%] -tests/test_bsp.py::test_load_bsp[E:/Mod-HereticII-map_dirs56] PASSED [ 41%] -tests/test_bsp.py::test_load_bsp[E:/Mod-Hexen2-map_dirs57] PASSED [ 41%] -tests/test_bsp.py::test_load_bsp[E:/Mod-RTCW-map_dirs58] PASSED [ 42%] -tests/test_bsp.py::test_load_bsp[E:/Mod-SiN-map_dirs59] PASSED [ 43%] -tests/test_bsp.py::test_load_bsp[E:/Mod-SoF-map_dirs60] PASSED [ 43%] -tests/test_bsp.py::test_load_bsp[E:/Mod-SoF2-map_dirs61] PASSED [ 44%] -tests/test_bsp.py::test_load_bsp[E:/Mod-StarTrekEliteForce-map_dirs62] PASSED [ 45%] -tests/test_bsp.py::test_load_bsp[E:/Mod-Quake-map_dirs63] PASSED [ 46%] -tests/test_bsp.py::test_load_bsp[E:/Mod-QuakeII-map_dirs64] PASSED [ 46%] -tests/test_bsp.py::test_load_bsp[E:/Mod-QuakeIII-map_dirs65] PASSED [ 47%] -tests/test_bsp.py::test_load_bsp[E:/Mod-QuakeLive-map_dirs66] PASSED [ 48%] -tests/test_bsp.py::test_load_bsp[E:/Mod-CoD1-map_dirs67] PASSED [ 48%] -tests/test_bsp.py::test_load_bsp[E:/Mod-CoD2-map_dirs68] PASSED [ 49%] -tests/test_bsp.py::test_load_bsp[E:/Mod-CoD4-map_dirs69] PASSED [ 50%] -tests/test_bsp.py::test_load_bsp[E:/Mod-BlackMesa-map_dirs70] PASSED [ 51%] -tests/test_bsp.py::test_load_bsp[E:/Mod-CSMalvinas-map_dirs71] PASSED [ 51%] -tests/test_bsp.py::test_load_bsp[E:/Mod-CSO2-map_dirs72] FAILED [ 52%] -tests/test_bsp.py::test_load_bsp[E:/Mod-DarkMessiah/singleplayer-map_dirs73] FAILED [ 53%] -tests/test_bsp.py::test_load_bsp[E:/Mod-DarkMessiah/multiplayer-map_dirs74] FAILED [ 53%] -tests/test_bsp.py::test_load_bsp[E:/Mod-Nightfire-map_dirs75] PASSED [ 54%] -tests/test_bsp.py::test_load_bsp[E:/Mod-TacticalIntervention-map_dirs76] PASSED [ 55%] -tests/test_bsp.py::test_load_bsp[E:/Mod-TeamFortressQuake-map_dirs77] PASSED [ 56%] -tests/test_bsp.py::test_load_bsp[E:/Mod-TitanfallOnline-map_dirs78] PASSED [ 56%] -tests/test_bsp.py::test_load_bsp[E:/Mod-Vindictus-map_dirs79] FAILED [ 57%] -tests/test_bsp.py::test_load_bsp[E:/Mod-Titanfall-map_dirs80] PASSED [ 58%] -tests/test_bsp.py::test_load_bsp[E:/Mod-Titanfall2-map_dirs81] PASSED [ 58%] -tests/test_bsp.py::test_load_bsp[E:/Mod-ApexLegends-map_dirs82] PASSED [ 59%] -tests/test_bsp.py::test_load_bsp[E:/Mod-FAKK2-map_dirs83] PASSED [ 60%] -tests/test_bsp.py::test_load_bsp[E:/Mod-Alice-map_dirs84] PASSED [ 61%] -tests/test_bsp.py::test_load_bsp[E:/Mod-MoHAA-map_dirs85] PASSED [ 61%] -tests/test_bsp.py::test_load_bsp[E:/Mod-StarTrekEliteForceII-map_dirs86] PASSED [ 62%] -tests/test_bsp.py::test_load_bsp[E:/Mod-StarWarsJediKnight-map_dirs87] PASSED [ 63%] -tests/test_bsp.py::test_load_bsp[E:/Mod-StarWarsJediKnightII-map_dirs88] PASSED [ 64%] +tests/test_bsp.py::test_load_bsp[C:/Program Files (x86)/Steam/steamapps/sourcemods-tunetwo-map_dirs11] FAILED [ 8%] +tests/test_bsp.py::test_load_bsp[C:/Program Files (x86)/Steam/steamapps/sourcemods-lvl2-map_dirs12] PASSED [ 9%] +tests/test_bsp.py::test_load_bsp[C:/Program Files (x86)/Steam/steamapps/sourcemods-thewrapuptwo-map_dirs13] PASSED [ 9%] +tests/test_bsp.py::test_load_bsp[C:/Program Files (x86)/Steam/steamapps/sourcemods-halloweenhorror4-map_dirs14] PASSED [ 10%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Cry of Fear-map_dirs15] PASSED [ 11%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Half-Life/cstrike-map_dirs16] PASSED [ 11%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Half-Life/czero-map_dirs17] PASSED [ 12%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Half-Life/czeror-map_dirs18] PASSED [ 13%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Half-Life/dmc-map_dirs19] PASSED [ 13%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Half-Life/dod-map_dirs20] PASSED [ 14%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Half-Life/gearbox-map_dirs21] PASSED [ 15%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Half-Life/ricochet-map_dirs22] PASSED [ 16%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Half-Life/tfc-map_dirs23] PASSED [ 16%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Half-Life/valve-map_dirs24] PASSED [ 17%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Halfquake Trilogy-map_dirs25] PASSED [ 18%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Sven Co-op-map_dirs26] PASSED [ 18%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Alien Swarm-map_dirs27] PASSED [ 19%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Alien Swarm Reactive Drop-map_dirs28] PASSED [ 20%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Blade Symphony-map_dirs29] PASSED [ 20%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Counter-Strike Global Offensive-map_dirs30] PASSED [ 21%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-counter-strike source-map_dirs31] PASSED [ 22%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-day of defeat source-map_dirs32] PASSED [ 23%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Fortress Forever-map_dirs33] PASSED [ 23%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-G String-map_dirs34] PASSED [ 24%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-GarrysMod-map_dirs35] PASSED [ 25%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Half-Life 1 Source Deathmatch-map_dirs36] PASSED [ 25%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-half-life 2/ep2-map_dirs37] PASSED [ 26%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-half-life 2/episodic-map_dirs38] PASSED [ 27%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-half-life 2/hl1-map_dirs39] PASSED [ 27%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-half-life 2/hl2-map_dirs40] PASSED [ 28%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-half-life 2/lostcoast-map_dirs41] PASSED [ 29%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-half-life 2 deathmatch-map_dirs42] PASSED [ 30%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Half-Life 2 Update-map_dirs43] PASSED [ 30%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-left 4 dead-map_dirs44] PASSED [ 31%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Left 4 Dead 2-map_dirs45] PASSED [ 32%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-MINERVA-map_dirs46] PASSED [ 32%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-NEOTOKYO-map_dirs47] PASSED [ 33%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Portal-map_dirs48] PASSED [ 34%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Portal 2-map_dirs49] PASSED [ 34%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Portal Reloaded-map_dirs50] PASSED [ 35%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-SourceFilmmaker-map_dirs51] PASSED [ 36%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Synergy-map_dirs52] PASSED [ 37%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Team Fortress 2-map_dirs53] FAILED [ 37%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Transmissions Element 120-map_dirs54] PASSED [ 38%] +tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Vampire The Masquerade - Bloodlines-map_dirs55] PASSED [ 39%] +tests/test_bsp.py::test_load_bsp[E:/Mod-Anachronox-map_dirs56] PASSED [ 39%] +tests/test_bsp.py::test_load_bsp[E:/Mod-Daikatana-map_dirs57] PASSED [ 40%] +tests/test_bsp.py::test_load_bsp[E:/Mod-HereticII-map_dirs58] PASSED [ 41%] +tests/test_bsp.py::test_load_bsp[E:/Mod-Hexen2-map_dirs59] PASSED [ 41%] +tests/test_bsp.py::test_load_bsp[E:/Mod-RTCW-map_dirs60] PASSED [ 42%] +tests/test_bsp.py::test_load_bsp[E:/Mod-SiN-map_dirs61] PASSED [ 43%] +tests/test_bsp.py::test_load_bsp[E:/Mod-SoF-map_dirs62] PASSED [ 44%] +tests/test_bsp.py::test_load_bsp[E:/Mod-SoF2-map_dirs63] PASSED [ 44%] +tests/test_bsp.py::test_load_bsp[E:/Mod-StarTrekEliteForce-map_dirs64] PASSED [ 45%] +tests/test_bsp.py::test_load_bsp[E:/Mod-Quake-map_dirs65] PASSED [ 46%] +tests/test_bsp.py::test_load_bsp[E:/Mod-QuakeII-map_dirs66] PASSED [ 46%] +tests/test_bsp.py::test_load_bsp[E:/Mod-QuakeIII-map_dirs67] PASSED [ 47%] +tests/test_bsp.py::test_load_bsp[E:/Mod-QuakeLive-map_dirs68] PASSED [ 48%] +tests/test_bsp.py::test_load_bsp[E:/Mod-CoD1-map_dirs69] PASSED [ 48%] +tests/test_bsp.py::test_load_bsp[E:/Mod-CoD2-map_dirs70] PASSED [ 49%] +tests/test_bsp.py::test_load_bsp[E:/Mod-CoD4-map_dirs71] PASSED [ 50%] +tests/test_bsp.py::test_load_bsp[E:/Mod-BlackMesa-map_dirs72] PASSED [ 51%] +tests/test_bsp.py::test_load_bsp[E:/Mod-CSMalvinas-map_dirs73] PASSED [ 51%] +tests/test_bsp.py::test_load_bsp[E:/Mod-CSO2-map_dirs74] FAILED [ 52%] +tests/test_bsp.py::test_load_bsp[E:/Mod-DarkMessiah/singleplayer-map_dirs75] FAILED [ 53%] +tests/test_bsp.py::test_load_bsp[E:/Mod-DarkMessiah/multiplayer-map_dirs76] FAILED [ 53%] +tests/test_bsp.py::test_load_bsp[E:/Mod-Nightfire-map_dirs77] PASSED [ 54%] +tests/test_bsp.py::test_load_bsp[E:/Mod-TacticalIntervention-map_dirs78] PASSED [ 55%] +tests/test_bsp.py::test_load_bsp[E:/Mod-TeamFortressQuake-map_dirs79] PASSED [ 55%] +tests/test_bsp.py::test_load_bsp[E:/Mod-Vindictus-map_dirs80] FAILED [ 56%] +tests/test_bsp.py::test_load_bsp[E:/Mod-Titanfall-map_dirs81] PASSED [ 57%] +tests/test_bsp.py::test_load_bsp[E:/Mod-TitanfallOnline-map_dirs82] PASSED [ 58%] +tests/test_bsp.py::test_load_bsp[E:/Mod-Titanfall2-map_dirs83] PASSED [ 58%] +tests/test_bsp.py::test_load_bsp[E:/Mod-ApexLegends-map_dirs84] PASSED [ 59%] +tests/test_bsp.py::test_load_bsp[E:/Mod-FAKK2-map_dirs85] PASSED [ 60%] +tests/test_bsp.py::test_load_bsp[E:/Mod-Alice-map_dirs86] PASSED [ 60%] +tests/test_bsp.py::test_load_bsp[E:/Mod-MoHAA-map_dirs87] PASSED [ 61%] +tests/test_bsp.py::test_load_bsp[E:/Mod-StarTrekEliteForceII-map_dirs88] PASSED [ 62%] +tests/test_bsp.py::test_load_bsp[E:/Mod-StarWarsJediKnight-map_dirs89] PASSED [ 62%] +tests/test_bsp.py::test_load_bsp[E:/Mod-StarWarsJediKnightII-map_dirs90] PASSED [ 63%] tests/test_bsplump.py::TestRawBspLump::test_its_raw PASSED [ 64%] tests/test_bsplump.py::TestRawBspLump::test_list_conversion PASSED [ 65%] -tests/test_bsplump.py::TestRawBspLump::test_indexing PASSED [ 66%] +tests/test_bsplump.py::TestRawBspLump::test_indexing PASSED [ 65%] tests/test_bsplump.py::TestBspLump::test_list_conversion PASSED [ 66%] tests/test_bsplump.py::TestBspLump::test_indexing PASSED [ 67%] -tests/test_bsplump.py::TestBspLump::test_del PASSED [ 68%] -tests/test_bsplump.py::TestBspLump::test_setitem FAILED [ 69%] +tests/test_bsplump.py::TestBspLump::test_del PASSED [ 67%] +tests/test_bsplump.py::TestBspLump::test_setitem FAILED [ 68%] tests/test_bsplump.py::TestBasicBspLump::test_its_basic PASSED [ 69%] -tests/test_bsplump.py::TestBasicBspLump::test_list_conversion PASSED [ 70%] -tests/test_bsplump.py::TestBasicBspLump::test_indexing PASSED [ 71%] -tests/test_idtech_bsp.py::test_no_errors PASSED [ 71%] -tests/test_idtech_bsp.py::test_entities_loaded PASSED [ 72%] -tests/test_idtech_bsp.py::test_face_struct PASSED [ 73%] -tests/test_valve_bsp.py::test_no_errors PASSED [ 74%] -tests/test_valve_bsp.py::test_entites_loaded PASSED [ 74%] -tests/branches/test_base.py::TestStruct::test_unpack PASSED [ 75%] +tests/test_bsplump.py::TestBasicBspLump::test_list_conversion PASSED [ 69%] +tests/test_bsplump.py::TestBasicBspLump::test_indexing PASSED [ 70%] +tests/test_d3d_bsp.py::test_no_errors[d3dbsp0] SKIPPED (got empty pa...) [ 71%] +tests/test_d3d_bsp.py::test_entites_loaded[d3dbsp0] SKIPPED (got emp...) [ 72%] +tests/test_idtech_bsp.py::test_no_errors[bsp0] SKIPPED (got empty pa...) [ 72%] +tests/test_idtech_bsp.py::test_entities_loaded[bsp0] SKIPPED (got em...) [ 73%] +tests/test_idtech_bsp.py::test_face_struct[bsp0] SKIPPED (got empty ...) [ 74%] +tests/test_valve_bsp.py::test_no_errors[bsp0] SKIPPED (got empty par...) [ 74%] +tests/test_valve_bsp.py::test_entities_loaded[bsp0] SKIPPED (got emp...) [ 75%] +tests/branches/test_base.py::TestStruct::test_unpack PASSED [ 76%] tests/branches/test_base.py::TestStruct::test_pack PASSED [ 76%] -tests/branches/test_base.py::TestMappedArray::test_init PASSED [ 76%] -tests/branches/test_branch_script.py::test_basic_branch_script[bsp_tool.branches.id_software.quake] PASSED [ 77%] -tests/branches/test_branch_script.py::test_basic_branch_script[bsp_tool.branches.id_software.quake2] PASSED [ 78%] +tests/branches/test_base.py::TestMappedArray::test_init PASSED [ 77%] +tests/branches/test_branch_script.py::test_basic_branch_script[bsp_tool.branches.id_software.quake] PASSED [ 78%] +tests/branches/test_branch_script.py::test_basic_branch_script[bsp_tool.branches.id_software.quake2] PASSED [ 79%] tests/branches/test_branch_script.py::test_basic_branch_script[bsp_tool.branches.id_software.quake3] PASSED [ 79%] -tests/branches/test_branch_script.py::test_basic_branch_script[bsp_tool.branches.infinity_ward.call_of_duty1] PASSED [ 79%] -tests/branches/test_branch_script.py::test_basic_branch_script[bsp_tool.branches.infinity_ward.call_of_duty2] PASSED [ 80%] +tests/branches/test_branch_script.py::test_basic_branch_script[bsp_tool.branches.infinity_ward.call_of_duty1] PASSED [ 80%] +tests/branches/test_branch_script.py::test_basic_branch_script[bsp_tool.branches.infinity_ward.call_of_duty2] PASSED [ 81%] tests/branches/test_branch_script.py::test_basic_branch_script[bsp_tool.branches.infinity_ward.call_of_duty4] PASSED [ 81%] tests/branches/test_branch_script.py::test_basic_branch_script[bsp_tool.branches.ion_storm.daikatana] PASSED [ 82%] -tests/branches/test_branch_script.py::test_basic_branch_script[bsp_tool.branches.gearbox.blue_shift] PASSED [ 82%] +tests/branches/test_branch_script.py::test_basic_branch_script[bsp_tool.branches.gearbox.blue_shift] PASSED [ 83%] tests/branches/test_branch_script.py::test_basic_branch_script[bsp_tool.branches.gearbox.nightfire] PASSED [ 83%] tests/branches/test_branch_script.py::test_basic_branch_script[bsp_tool.branches.raven.hexen2] PASSED [ 84%] -tests/branches/test_branch_script.py::test_basic_branch_script[bsp_tool.branches.raven.soldier_of_fortune] PASSED [ 84%] -tests/branches/test_branch_script.py::test_basic_branch_script[bsp_tool.branches.raven.soldier_of_fortune2] PASSED [ 85%] +tests/branches/test_branch_script.py::test_basic_branch_script[bsp_tool.branches.raven.soldier_of_fortune] PASSED [ 85%] +tests/branches/test_branch_script.py::test_basic_branch_script[bsp_tool.branches.raven.soldier_of_fortune2] PASSED [ 86%] tests/branches/test_branch_script.py::test_basic_branch_script[bsp_tool.branches.ritual.fakk2] PASSED [ 86%] tests/branches/test_branch_script.py::test_basic_branch_script[bsp_tool.branches.ritual.moh_allied_assault] PASSED [ 87%] -tests/branches/test_branch_script.py::test_basic_branch_script[bsp_tool.branches.ritual.sin] PASSED [ 87%] +tests/branches/test_branch_script.py::test_basic_branch_script[bsp_tool.branches.ritual.sin] PASSED [ 88%] tests/branches/test_branch_script.py::test_basic_branch_script[bsp_tool.branches.ritual.star_trek_elite_force2] PASSED [ 88%] tests/branches/test_branch_script.py::test_basic_branch_script[bsp_tool.branches.valve.goldsrc] PASSED [ 89%] -tests/branches/test_branch_script.py::test_branch_script[bsp_tool.branches.arkane.dark_messiah_multiplayer] PASSED [ 89%] +tests/branches/test_branch_script.py::test_branch_script[bsp_tool.branches.arkane.dark_messiah_multiplayer] PASSED [ 90%] tests/branches/test_branch_script.py::test_branch_script[bsp_tool.branches.arkane.dark_messiah_singleplayer] PASSED [ 90%] tests/branches/test_branch_script.py::test_branch_script[bsp_tool.branches.nexon.cso2] PASSED [ 91%] tests/branches/test_branch_script.py::test_branch_script[bsp_tool.branches.nexon.cso2_2018] PASSED [ 92%] -tests/branches/test_branch_script.py::test_branch_script[bsp_tool.branches.nexon.vindictus] PASSED [ 92%] +tests/branches/test_branch_script.py::test_branch_script[bsp_tool.branches.nexon.vindictus] PASSED [ 93%] tests/branches/test_branch_script.py::test_branch_script[bsp_tool.branches.respawn.apex_legends] PASSED [ 93%] tests/branches/test_branch_script.py::test_branch_script[bsp_tool.branches.respawn.titanfall] PASSED [ 94%] -tests/branches/test_branch_script.py::test_branch_script[bsp_tool.branches.respawn.titanfall2] PASSED [ 94%] +tests/branches/test_branch_script.py::test_branch_script[bsp_tool.branches.respawn.titanfall2] PASSED [ 95%] tests/branches/test_branch_script.py::test_branch_script[bsp_tool.branches.troika.vampire] PASSED [ 95%] tests/branches/test_branch_script.py::test_branch_script[bsp_tool.branches.valve.alien_swarm] PASSED [ 96%] tests/branches/test_branch_script.py::test_branch_script[bsp_tool.branches.valve.left4dead] PASSED [ 97%] @@ -146,7 +150,71 @@ tests/branches/test_branch_script.py::test_branch_script[bsp_tool.branches.valve tests/branches/test_branch_script.py::test_branch_script[bsp_tool.branches.valve.source] PASSED [100%] ================================== FAILURES =================================== -_ test_load_bsp[D:/SteamLibrary/steamapps/common-Team Fortress 2-map_dirs51] __ +_ test_load_bsp[C:/Program Files (x86)/Steam/steamapps/sourcemods-tunetwo-map_dirs11] _ + +group_path = 'C:/Program Files (x86)/Steam/steamapps/sourcemods' +game_name = 'tunetwo', map_dirs = ['maps'] + + @pytest.mark.parametrize("group_path,game_name,map_dirs", [(*gps, ms) for gps, ms in maplist.installed_games.items()]) + def test_load_bsp(group_path, game_name, map_dirs): + """MEGATEST: 69GB+ of .bsp files!""" + branch_script = game_scripts.get(game_name) + # NOTE: this is ugly and results in quite a few errors + # auto-detection really shouldn't have to rely on precise strings + errors = dict() + # ^ {"game": ["errors"]} + types = set() + # ^ {(BspClass, branch, version)} + total = 0 + for map_dir in map_dirs: + full_path = os.path.join(group_path, game_name, map_dir) + if os.path.exists(full_path): + files = os.listdir(full_path) + maps = fnmatch.filter(files, "*[Bb][Ss][Pp]") # .bsp, .BSP & CoD2 .d3dbsp + total += len(maps) + assert len(maps) != 0, f"couldn't find any maps for {game_name} in {map_dir}" + for m in maps: # load every .bsp + try: + bsp_filename = os.path.join(full_path, m) + if os.path.getsize(bsp_filename) == 0: + continue # hl2/maps/d2_coast_02 is 0 bytes, idk why it shipped + if game_name == "half-life 2/episodic" and m == "ep1_citadel_00_demo.bsp": + continue # broken HL2:EP1 map (game crashes on load) + elif game_name == "half-life 2/hl1" and m in ("c4a1y.bsp", "c4a1z.bsp"): + continue # broken HL:Source maps (y is v18 and won't run, z is v19 and has broken IO) + bsp = load_bsp(bsp_filename, branch_script) + # TODO: assert game_name, bsp_version and BspVariant match + loading_errors = {**bsp.loading_errors} + if hasattr(bsp, "GAME_LUMP"): + if not isinstance(bsp.GAME_LUMP, lumps.RawBspLump): # HACK: incomplete Vindictus GameLump + loading_errors.update(bsp.GAME_LUMP.loading_errors) + assert len(loading_errors) == 0, ", ".join(loading_errors.keys()) + except AssertionError as ae: + errors[f"{map_dir}/{m}"] = ae + types.add((bsp.__class__.__name__, bsp.branch.__name__, bsp.bsp_version)) + del bsp +> assert errors == dict(), "\n".join([f"{len(errors)} out of {total} .bsps failed", *map(str, types)]) +E AssertionError: 1 out of 12 .bsps failed +E ('ValveBsp', 'bsp_tool.branches.valve.orange_box', 20) +E assert {'maps/tt13_delusion.bsp': AssertionError('ENTITIES\nassert 1 == 0\n +1\n -0')} == {} +E Left contains 1 more item: +E {'maps/tt13_delusion.bsp': AssertionError('ENTITIES\nassert 1 == 0\n +1\n -0')} +E Full diff: +E - {} +E + {'maps/tt13_delusion.bsp': AssertionError('ENTITIES\nassert 1 == 0\n +1\n -0')} + +tests\test_bsp.py:71: AssertionError +---------------------------- Captured stdout call ----------------------------- +ERROR LOADING ENTITIES: Line 02788: "message" "Turquoise Hexagon Sun +ERROR LOADING ENTITIES: Line 02853: "message" "Everything is Out of Time +ERROR LOADING ENTITIES: Line 02854: by Leia." +ERROR LOADING ENTITIES: Line 02873: "message" "Inspired by ''Everything In Its Right Place'' from Radiohead +ERROR LOADING ENTITIES: Line 02874: and ''Out of Time'' from Blur." +ERROR LOADING ENTITIES: Line 02893: "message" "Assets: ''Residential Three Story Building 01'' +ERROR LOADING ENTITIES: Line 02894: by XBLAH, CC BY 4.0." +ERROR LOADING ENTITIES: Line 03717: "message" "%+moveleft%Don't match +ERROR LOADING ENTITIES: Line 03718: %+moveright%Match" +_ test_load_bsp[D:/SteamLibrary/steamapps/common-Team Fortress 2-map_dirs53] __ group_path = 'D:/SteamLibrary/steamapps/common', game_name = 'Team Fortress 2' map_dirs = ['tf/maps', 'tf/download/maps'] @@ -210,7 +278,7 @@ ERROR LOADING ENTITIES: Line 04307: "message" "Players can get rid of their jit ERROR LOADING ENTITIES: Line 04308: in return for a slight increase in move speed, by shooting the Anti-Jitter button." ERROR LOADING ENTITIES: Line 04326: "message" "Players in Anti-Jitter Mode will retain their increased jump height. ERROR LOADING ENTITIES: Line 04327: This option is per-player; your setting does not affect other players." -____________________ test_load_bsp[E:/Mod-CSO2-map_dirs72] ____________________ +____________________ test_load_bsp[E:/Mod-CSO2-map_dirs74] ____________________ group_path = 'E:/Mod', game_name = 'CSO2', map_dirs = ['maps'] @@ -457,7 +525,7 @@ E + 'maps/zz_prodigy.bsp': AssertionError('GAME_LUMP\nassert 1 == 0\n E } tests\test_bsp.py:71: AssertionError -__________ test_load_bsp[E:/Mod-DarkMessiah/singleplayer-map_dirs73] __________ +__________ test_load_bsp[E:/Mod-DarkMessiah/singleplayer-map_dirs75] __________ group_path = 'E:/Mod', game_name = 'DarkMessiah/singleplayer' map_dirs = ['maps'] @@ -581,7 +649,7 @@ E + 'maps/menu_3d_credits.bsp': AssertionError('GAME_LUMP\nassert 1 == E } tests\test_bsp.py:71: AssertionError -__________ test_load_bsp[E:/Mod-DarkMessiah/multiplayer-map_dirs74] ___________ +__________ test_load_bsp[E:/Mod-DarkMessiah/multiplayer-map_dirs76] ___________ group_path = 'E:/Mod', game_name = 'DarkMessiah/multiplayer' map_dirs = ['maps'] @@ -657,7 +725,7 @@ E + 'maps/l_mp5.bsp': AssertionError('sprp\nassert 1 == 0\n +1\n -0') E } tests\test_bsp.py:71: AssertionError -_________________ test_load_bsp[E:/Mod-Vindictus-map_dirs79] __________________ +_________________ test_load_bsp[E:/Mod-Vindictus-map_dirs80] __________________ group_path = 'E:/Mod', game_name = 'Vindictus', map_dirs = ['maps'] @@ -1662,7 +1730,7 @@ tests\test_bsp.py:71: AssertionError ERROR LOADING ENTITIES: Line 00000: VBSP\x14\x00\x00\x00p\t\x02"\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\nERROR LOADING ENTITIES: Line 00000: VBSP\x14\x00\x00\x00T"\x02_\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\nERROR LOADING ENTITIES: Line 00000: VBSP\x14\x00\x00\x00\x00a"\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\nERROR LOADING ENTITIES: Line 00000: VBSP\x14\x00\x00\x00\x18"\x00Y\x14\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\nERROR LOADING ENTITIES: Line 00001: \x04\x00\x00A\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00(]\x03\x00@\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\u033a\x01\x004\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00P\x02\x00`9\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00`\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00d\x01\x00\x02\x00\x00\x00\x00\x00\x00\x00\x1f\nERROR LOADING ENTITIES: Line 00000: VBSP\x14\x00\x00\x00"\x00]\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\nERROR LOADING ENTITIES: Line 00001: \x04\x00\x00p\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00L \x02\x00`\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x007\x01\x00\x18<\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"\x00\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00s\x01\x00 C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nERROR LOADING ENTITIES: Line 00000: VBSP\x14\x00\x00\x00 \x13\x00"m\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00 __________________________ TestBspLump.test_setitem ___________________________ -self = +self = def test_setitem(self): for map_name in bsps: @@ -1677,7 +1745,7 @@ bsp_tool\branches\base.py:37: in __eq__ return self.flat() == other.flat() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ -self = <[AttributeError('position') raised in repr()] Vertex object at 0x227676acf80> +self = <[AttributeError('position') raised in repr()] Vertex object at 0x1f695329780> def flat(self) -> list: """recreates the _tuple this instance was initialised from""" @@ -1695,24 +1763,24 @@ tests/branches/test_branch_script.py::test_basic_branch_script[bsp_tool.branches tests/branches/test_branch_script.py::test_basic_branch_script[bsp_tool.branches.infinity_ward.call_of_duty1] C:\Users\Jared\Documents\GitHub\bsp_tool\tests\branches\test_branch_script.py:41: UserWarning: Unused LumpClasses in branch script: - Cell - Node + CullGroup Occluder AxisAlignedBoundingBox PatchCollision + Node Model Light DrawVertex - Portal - CullGroup Brush + Cell + Portal warnings.warn(UserWarning(warning_text)) tests/branches/test_branch_script.py::test_basic_branch_script[bsp_tool.branches.infinity_ward.call_of_duty2] C:\Users\Jared\Documents\GitHub\bsp_tool\tests\branches\test_branch_script.py:41: UserWarning: Unused LumpClasses in branch script: - CollisionEdge Model CollisionTriangle + CollisionEdge warnings.warn(UserWarning(warning_text)) tests/branches/test_branch_script.py::test_branch_script[bsp_tool.branches.arkane.dark_messiah_singleplayer] @@ -1738,7 +1806,7 @@ bsp_tool\branches\__init__.py 28 0 100% bsp_tool\branches\arkane\__init__.py 3 0 100% bsp_tool\branches\arkane\dark_messiah_multiplayer.py 23 0 100% bsp_tool\branches\arkane\dark_messiah_singleplayer.py 55 0 100% -bsp_tool\branches\base.py 170 34 80% +bsp_tool\branches\base.py 170 46 73% bsp_tool\branches\gearbox\__init__.py 3 0 100% bsp_tool\branches\gearbox\blue_shift.py 27 0 100% bsp_tool\branches\gearbox\nightfire.py 72 0 100% @@ -1789,20 +1857,21 @@ bsp_tool\extensions\decrypt_xor.py 11 11 0% bsp_tool\extensions\diff.py 106 106 0% bsp_tool\extensions\lightmaps.py 133 133 0% bsp_tool\id_software.py 95 13 86% -bsp_tool\infinity_ward.py 123 19 85% +bsp_tool\infinity_ward.py 130 19 85% bsp_tool\lumps\__init__.py 272 49 82% bsp_tool\raven.py 3 0 100% bsp_tool\respawn.py 146 69 53% bsp_tool\ritual.py 44 3 93% bsp_tool\valve.py 58 10 83% --------------------------------------------------------------------------- -TOTAL 5601 1166 79% +TOTAL 5608 1178 79% =========================== short test summary info =========================== -FAILED tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Team Fortress 2-map_dirs51] -FAILED tests/test_bsp.py::test_load_bsp[E:/Mod-CSO2-map_dirs72] - AssertionEr... -FAILED tests/test_bsp.py::test_load_bsp[E:/Mod-DarkMessiah/singleplayer-map_dirs73] -FAILED tests/test_bsp.py::test_load_bsp[E:/Mod-DarkMessiah/multiplayer-map_dirs74] -FAILED tests/test_bsp.py::test_load_bsp[E:/Mod-Vindictus-map_dirs79] - Assert... +FAILED tests/test_bsp.py::test_load_bsp[C:/Program Files (x86)/Steam/steamapps/sourcemods-tunetwo-map_dirs11] +FAILED tests/test_bsp.py::test_load_bsp[D:/SteamLibrary/steamapps/common-Team Fortress 2-map_dirs53] +FAILED tests/test_bsp.py::test_load_bsp[E:/Mod-CSO2-map_dirs74] - AssertionEr... +FAILED tests/test_bsp.py::test_load_bsp[E:/Mod-DarkMessiah/singleplayer-map_dirs75] +FAILED tests/test_bsp.py::test_load_bsp[E:/Mod-DarkMessiah/multiplayer-map_dirs76] +FAILED tests/test_bsp.py::test_load_bsp[E:/Mod-Vindictus-map_dirs80] - Assert... FAILED tests/test_bsplump.py::TestBspLump::test_setitem - AttributeError: pos... -=========== 6 failed, 133 passed, 5 warnings in 2203.57s (0:36:43) ============ +====== 7 failed, 129 passed, 7 skipped, 5 warnings in 2067.00s (0:34:27) ====== diff --git a/tests/maplist.py b/tests/maplist.py index f65b0393..9aa57af6 100644 --- a/tests/maplist.py +++ b/tests/maplist.py @@ -4,21 +4,24 @@ DirList = Dict[str, List[str]] # ^ {"Game": ["maps_dir"]} + GameDirList = Dict[str, DirList] # ^ {"SteamFolder": {**DirList_1, **DirList_2}} +# ^ {"External/Backup": {**DirList_1, **DirList_2}} goldsrc_dirs: DirList # GoldSrc titles source_dirs: DirList # Source Engine titles -extracted_dirs: DirList # .bsps from archives (.ff, .pak, .pak3, .pkg, .vpk) & non-steam games +extracted_dirs: DirList # .bsps from archives (.007, .hfs, .iwd, .ff, .pak, .pk3, .pkg, .sin, .vpk) & non-steam games sourcemod_dirs: DirList # Source SDK games @ Steam/steamapps/sourcemods every_bsp_dir: DirList # all of the above in one dict (used with external HDD) -group_dirs: GameDirList +group_dirs: GameDirList # groups folders to install dirs (steam installs, external HDDs etc.) installed_games: Dict[Tuple[str], List[str]] # ^ {("SteamFolder", "Game"): ["maps_dir"]} # TODO: generate by searching for gameinfo.txt files goldsrc_dirs = { + "Cry of Fear": ["cryoffear/maps"], # 235 maps | 1.9 GB | Cry of Fear **{f"Half-Life/{mod}": ["maps"] for mod in [ "blue_shift", # 37 maps | 54 MB | Half-Life: Blue Shift "cstrike", # 25 maps | 81 MB | Counter-Strike @@ -37,6 +40,7 @@ "svencoop_event_april/maps"]} # 4 maps | 31 MB # ^ {"game_dir": ["map_dir"]} +# TODO: generate by searching for gameinfo.txt files source_dirs = { "Alien Swarm": ["swarm/maps"], # 9 maps | 299 MB "Alien Swarm Reactive Drop": ["reactivedrop/maps"], # 53 maps | 1.3 GB @@ -127,16 +131,20 @@ "QuakeIII": ["maps"], # 31 maps | 116 MB | .pk3 # TODO: Quake Champions .pak (Saber3D) "QuakeLive": ["pak00/maps"], # 149 maps | 764 MB | .pk3 - # CoDBsp + # InfinityWardBsp "CoD1": ["maps", # 33 maps | 488 MB | .pk3 "maps/MP"], # 16 maps | 229 MB | .pk3 "CoD2": ["maps", # 39 maps | 1.5 GB | .iwd | .d3dbsp "maps/mp"], # 15 maps | 395 MB | .iwd | .d3dbsp - # TODO: CoD4 # .ff + # D3DBsp + # TODO: Extract CoD4 maps from .ff archives + # https://wiki.zeroy.com/index.php?title=Call_of_Duty_4:_FastFile_Format + # https://github.com/Scobalula/Greyhound + # https://github.com/ZoneTool/zonetool + # https://github.com/promod/CoD4-Mod-Tools # "CoD4": ["devraw/maps", # 1 map | 17 MB | .d3dbsp (v17 InfinityWardBsp; not a CoD4 .d3dbsp?) "CoD4": ["maps", # 3 maps | 7 MB | .d3dbsp "maps/mp"], # 1 map | 4 MB | .d3dbsp - # NOTE: ^ from CoD4ModTools only, still haven't extracted any *.d3dbsp from *.ff (yet) # ValveBsp "BlackMesa": ["maps"], # 109 maps | 5.5 GB | .vpk "CSMalvinas": ["maps"], # 1 map | 13 MB | Counter-Strike: Malvinas @@ -151,11 +159,11 @@ "TeamFortressQuake": ["tf25rel/maps", # 1 map | 1.88 MB | v2.5 "tf28/FORTRESS/maps", # 1 map | 1.88 MB "tfbot080/MAPS"], # 1 map | 212 KB - "TitanfallOnline": ["maps"], # 18 maps | 2.2 GB | .pkg # https://github.com/yretenai/HFSExtract "Vindictus": ["maps"], # 474 maps | 8.8 GB | .hfs # RespawnBsp (NOTE: .bsp_lump & .ent sizes not counted) "Titanfall": ["maps"], # 26 maps | 3,5 GB | .vpk + "TitanfallOnline": ["maps"], # 18 maps | 2.2 GB | .pkg "Titanfall2": ["maps"], # 36 maps | 6.6 GB | .vpk # Thanks to https://apexlegends.fandom.com/wiki/Version_History # see also: https://github.com/Syampuuh/TitanfallApexLegends diff --git a/tests/test_d3d_bsp.py b/tests/test_d3d_bsp.py new file mode 100644 index 00000000..c86c22c0 --- /dev/null +++ b/tests/test_d3d_bsp.py @@ -0,0 +1,36 @@ +# TODO: more in-depth tests +import fnmatch +import os +import pytest + +from bsp_tool import D3DBsp +from bsp_tool.branches.infinity_ward import call_of_duty4 + + +d3dbsps = [] +# TODO: add more Call of Duty 4 dirs from maplist.installed_games & make it optional +for map_dir in ["./tests/maps/Call of Duty 4", "./tests/maps/Call of Duty 4/mp"]: + for map_name in fnmatch.filter(os.listdir(map_dir), ".d3dbsp"): + d3dbsps.append(D3DBsp(call_of_duty4, os.path.join(map_dir, map_name))) + + +@pytest.mark.parametrize("d3dbsp", d3dbsps) +def test_no_errors(d3dbsp): + assert len(d3dbsp.loading_errors) == 0 + + +@pytest.mark.parametrize("d3dbsp", d3dbsps) +def test_entites_loaded(d3dbsp): + assert d3dbsp.ENTITIES[0]["classname"] == "worldspawn" + + +# TODO: implement .save_as method and test that uneditted saves match EXACTLY +# @pytest.mark.parametrize("d3dbsp", d3dbsps) +# def test_save_as(d3dbsp): # NotImplemented +# with open(d3d_bsp.filename, "rb") as file: +# original = file.read() +# test2.save_as(f"{d3dbsp.filename}.copy") +# with open(f"{d3dbsp.filename}.copy", "rb") as file: +# saved = file.read() +# os.remove(f"{d3dbsp.filename}.copy") +# assert original == saved diff --git a/tests/test_idtech_bsp.py b/tests/test_idtech_bsp.py index 6a239549..94df2fd4 100644 --- a/tests/test_idtech_bsp.py +++ b/tests/test_idtech_bsp.py @@ -1,41 +1,53 @@ -# import os +# TODO: more in-depth tests +import fnmatch +import os +import pytest import struct from bsp_tool import IdTechBsp from bsp_tool.branches.id_software import quake3 +bsps = [] +map_dir = "./tests/maps/Quake 3 Arena" +# TODO: add more Quake 3 Arena dirs from maplist.installed_games & make it optional +for map_name in fnmatch.filter(os.listdir(map_dir), ".d3dbsp"): + bsps.append(IdTechBsp(quake3, os.path.join(map_dir, map_name))) -mp_lobby = IdTechBsp(quake3, "tests/maps/Quake 3 Arena/mp_lobby.bsp") +@pytest.mark.parametrize("bsp", bsps) +def test_no_errors(bsp: IdTechBsp): + assert len(bsp.loading_errors) == 0 -def test_no_errors(): - assert len(mp_lobby.loading_errors) == 0 +@pytest.mark.parametrize("bsp", bsps) +def test_entities_loaded(bsp: IdTechBsp): + assert bsp.ENTITIES[0]["classname"] == "worldspawn" -def test_entities_loaded(): - assert mp_lobby.ENTITIES[0]["classname"] == "worldspawn" - -# TODO: @pytest.mark.parametrize("LumpClass", ...) -def test_face_struct(): # most complex branches.base.MappedArray - # TODO: add some asserts, be thorough - header = mp_lobby.headers["FACES"] +# NOTE: WIP +@pytest.mark.parametrize("bsp", bsps) +def test_face_struct(bsp: IdTechBsp): # the most complex MappedArray + # TODO: add more asserts, be thorough + header = bsp.headers["FACES"] assert header.length % struct.calcsize(quake3.Face._format) == 0 - with open(mp_lobby.file.name, "rb") as file: + with open(bsp.file.name, "rb") as file: file.seek(header.offset) raw_faces = file.read(header.length) + # TODO: figure out what I was testing for here: faces = [*map(quake3.Face.from_tuple, struct.iter_unpack(quake3.Face._format, raw_faces))] print(*faces, sep="\n") # error in __repr__? return faces # ^ what? -# def test_save_as(): # NotImplemented -# with open("tests/maps/Quake 3 Arena/mp_lobby.bsp", "rb") as file: +# TODO: implement .save_as method and test that uneditted saves match EXACTLY +# @pytest.mark.parametrize("bsp", d3dbsps) +# def test_save_as(bsp): # NotImplemented +# with open(bsp.filename, "rb") as file: # original = file.read() -# bigbox.save_as("tests/maps/Quake 3 Arena/mp_lobby_save_test.bsp") -# with open("tests/maps/Quake 3 Arena/mp_lobby_save_test.bsp", "rb") as file: +# test2.save_as(f"{bsp.filename}.copy") +# with open(f"{bsp.filename}.copy", "rb") as file: # saved = file.read() -# os.remove("tests/maps/Quake 3 Arena/mp_lobby_save_test.bsp") +# os.remove(f"{bsp.filename}.copy") # assert original == saved diff --git a/tests/test_valve_bsp.py b/tests/test_valve_bsp.py index b6849300..4dbc62b8 100644 --- a/tests/test_valve_bsp.py +++ b/tests/test_valve_bsp.py @@ -1,31 +1,37 @@ +# TODO: more in-depth tests +import fnmatch +import os +import pytest + from bsp_tool import ValveBsp from bsp_tool.branches.valve import orange_box -# TODO: use maplist to test all Source & GoldSrc dirs (of those installed) -test2 = ValveBsp(orange_box, "tests/maps/Team Fortress 2/test2.bsp") -test_displacement_decompile = ValveBsp(orange_box, "tests/maps/Team Fortress 2/test_displacement_decompile.bsp") -test_physcollide = ValveBsp(orange_box, "tests/maps/Team Fortress 2/test_physcollide.bsp") +bsps = [] +map_dir = "./tests/maps/Team Fortress 2" +# TODO: add more Team Fortress 2 dirs from maplist.installed_games & make it optional +for map_name in fnmatch.filter(os.listdir(map_dir), ".d3dbsp"): + bsps.append(ValveBsp(orange_box, os.path.join(map_dir, map_name))) -# NOTE: this is incredibly limited -def test_no_errors(): - assert len(test2.loading_errors) == 0 - assert len(test_displacement_decompile.loading_errors) == 0 - assert len(test_physcollide.loading_errors) == 0 +@pytest.mark.parametrize("bsp", bsps) +def test_no_errors(bsp: ValveBsp): # NOTE: covered by test_bsp.py + assert len(bsp.loading_errors) == 0 + assert len(bsp.GAME_LUMP.loading_errors) == 0 -def test_entites_loaded(): - assert test2.ENTITIES[0]["classname"] == "worldspawn" - assert test_displacement_decompile.ENTITIES[0]["classname"] == "worldspawn" - assert test_physcollide.ENTITIES[0]["classname"] == "worldspawn" +@pytest.mark.parametrize("bsp", bsps) +def test_entities_loaded(bsp: ValveBsp): + assert bsp.ENTITIES[0]["classname"] == "worldspawn" -# def test_save_as(): # NotImplemented -# with open("tests/maps/Team Fortress 2/test2.bsp", "rb") as file: +# TODO: implement .save_as method and test that uneditted saves match EXACTLY +# @pytest.mark.parametrize("bsp", d3dbsps) +# def test_save_as(bsp): # NotImplemented +# with open(bsp.filename, "rb") as file: # original = file.read() -# test2.save_as("tests/maps/Team Fortress 2/test2_save_test.bsp") -# with open("tests/maps/Team Fortress 2/test2_save_test.bsp", "rb") as file: +# test2.save_as(f"{bsp.filename}.copy") +# with open(f"{bsp.filename}.copy", "rb") as file: # saved = file.read() -# os.remove("tests/maps/Team Fortress 2/test2_save_test.bsp") +# os.remove(f"{bsp.filename}.copy") # assert original == saved