mirror of
https://git.triforceproject.com/triforce/source
synced 2026-11-19 16:20:01 -04:00
Triforce v0.5.0
In-game mods (GameBanana browser, search and installs, with the Mask Salesman), code-patch and cheat mods, the devs' test18 to test45 work (full performance overlay, frame pacing on, steady frame rate, save export and import, bug capture, new options rows, Setup's Mods page and Add to Steam), occlusion queries and new defaults, Auto resolution that scales, replay helper threads and robust buffers off by default, the options in sections.
This commit is contained in:
39
tests/test_setup_test_root.py
Normal file
39
tests/test_setup_test_root.py
Normal file
@@ -0,0 +1,39 @@
|
||||
"""A test run of Triforce Setup (TRIFORCE_TEST_ROOT) builds inside its own folder, work folder and all (setup/Setup.cs
|
||||
Runner and Install.Allowed; no Setup and no make_game.py is started).
|
||||
|
||||
TRIFORCE_TEST_ROOT keeps a look at Setup away from the PC's real install: a build or an update into a folder outside it
|
||||
is refused. Its build was still started without --work, so make_game.py worked in the PC's real build folder
|
||||
(%LOCALAPPDATA%\\Triforce\\build), where its first act is to stop whatever build is running there: a player's, or a
|
||||
developer's own.
|
||||
|
||||
Compiles the Runner class and Install.Allowed, cut out of Setup.cs, with tests/setup_test_root_test.cs, whose program
|
||||
stands in for the tools' Python and writes down what it was started with: a test run's build and update get the test
|
||||
folder's own build folder (once, and not over one that was named), one into a folder outside is refused before anything
|
||||
starts, and a player's build is given no --work at all. Reads the source for the uninstall's side: the folder a test
|
||||
run's uninstall removes is the same one.
|
||||
|
||||
python -I -B tests/test_setup_test_root.py
|
||||
"""
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
RUN_ALL_SKIP = {"linux": "Triforce Setup is a Windows program (.NET Framework 4.8)"}
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
||||
import setup_cs # noqa: E402
|
||||
|
||||
USING = ("System", "System.Collections.Generic", "System.Diagnostics", "System.IO", "System.Linq", "System.Text", "System.Threading.Tasks")
|
||||
|
||||
|
||||
def main():
|
||||
setup = setup_cs.source("setup/Setup.cs")
|
||||
setup_cs.need(setup, 'var work = TestRoot != null ? Path.Combine(TestRoot, "build") :',
|
||||
"setup/Setup.cs Uninstall: a test run's uninstall no longer removes the build folder its builds work in")
|
||||
allowed = setup[setup.index(" /// May this run write there?"):setup.index(" static string LocalData =>")]
|
||||
runner = setup[setup.index("/// nx2/make_game.py as a child process"):setup.index("/// Folder picker")]
|
||||
extra = "".join("using %s;\n" % u for u in USING) + "namespace TriforceSetup;\nstatic partial class Install\n{\n" + allowed + "}\n\n" + runner
|
||||
setup_cs.run_fixture("setup_test_root_test.cs", extra=extra)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user