mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-28 19:21:04 +00:00
Use landracer addon from example suite by the integration tests
This commit is contained in:
parent
fa1e574097
commit
9006a8fad0
@ -17,11 +17,14 @@ parser.add_argument("--verbose", action='store_true', help="print all openmw out
|
|||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
example_suite_dir = Path(args.example_suite).resolve()
|
example_suite_dir = Path(args.example_suite).resolve()
|
||||||
example_suite_content = example_suite_dir / "game_template" / "data" / "template.omwgame"
|
|
||||||
if not example_suite_content.is_file():
|
content_paths = (
|
||||||
sys.exit(
|
example_suite_dir / "game_template" / "data" / "template.omwgame",
|
||||||
f"{example_suite_content} not found, use 'git clone https://gitlab.com/OpenMW/example-suite/' to get it"
|
example_suite_dir / "example_animated_creature" / "data" / "landracer.omwaddon",
|
||||||
)
|
)
|
||||||
|
for path in content_paths:
|
||||||
|
if not path.is_file():
|
||||||
|
sys.exit(f"{path} is not found, use 'git clone https://gitlab.com/OpenMW/example-suite/' to get it")
|
||||||
|
|
||||||
openmw_binary = Path(args.omw).resolve()
|
openmw_binary = Path(args.omw).resolve()
|
||||||
if not openmw_binary.is_file():
|
if not openmw_binary.is_file():
|
||||||
@ -43,15 +46,17 @@ def runTest(name):
|
|||||||
shutil.copyfile(example_suite_dir / "settings.cfg", config_dir / "settings.cfg")
|
shutil.copyfile(example_suite_dir / "settings.cfg", config_dir / "settings.cfg")
|
||||||
test_dir = tests_dir / name
|
test_dir = tests_dir / name
|
||||||
with open(config_dir / "openmw.cfg", "w", encoding="utf-8") as omw_cfg:
|
with open(config_dir / "openmw.cfg", "w", encoding="utf-8") as omw_cfg:
|
||||||
|
for path in content_paths:
|
||||||
|
omw_cfg.write(f'data="{path.parent}"\n')
|
||||||
omw_cfg.writelines(
|
omw_cfg.writelines(
|
||||||
(
|
(
|
||||||
f'data="{example_suite_content.parent}"\n',
|
|
||||||
f'data="{testing_util_dir}"\n',
|
f'data="{testing_util_dir}"\n',
|
||||||
f'data-local="{test_dir}"\n',
|
f'data-local="{test_dir}"\n',
|
||||||
f'user-data="{userdata_dir}"\n',
|
f'user-data="{userdata_dir}"\n',
|
||||||
f'content={example_suite_content.name}\n',
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
for path in content_paths:
|
||||||
|
omw_cfg.write(f'content={path.name}\n')
|
||||||
if (test_dir / "openmw.cfg").exists():
|
if (test_dir / "openmw.cfg").exists():
|
||||||
omw_cfg.write(open(test_dir / "openmw.cfg").read())
|
omw_cfg.write(open(test_dir / "openmw.cfg").read())
|
||||||
elif (test_dir / "test.omwscripts").exists():
|
elif (test_dir / "test.omwscripts").exists():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user