HomeWildfire Games

Support random map script tests, fixes #4827.

Description

Support random map script tests, fixes #4827.

Differential Revision: https://code.wildfiregames.com/D2085
Comments By: wraitii

Event Timeline

Stan raised a concern with this commit.EditedFeb 27 2020, 9:55 AM
Stan added a subscriber: Stan.

With the patch:

Running cxxtest tests (336 tests).....
In TestMapGenerator::test_mapgen_scripts:
/build/0ad-0.0.24~r23514/source/graphics/tests/test_MapGenerator.h:42: Error: Expected ((vfs::GetPathnames(g_VFS, L"maps/random/tests/", L"test_*.js", paths)) == INFO::OK), found (-110100 != 0)
....................................................................................................................................................................................................................................
In TestComponentScripts::test_global_scripts:
/build/0ad-0.0.24~r23514/source/simulation2/components/tests/test_scripts.h:62: Error: Expected ((vfs::GetPathnames(g_VFS, L"globalscripts/tests/", L"test_*.js", paths)) == INFO::OK), found (-110100 != 0)
WARNING: Skipping component scripts tests (can't find binaries/data/mods/public/simulation/components/tests/setup.js)
.....................................................................................................
Failed 2 and Skipped 0 of 336 tests

Without the patch (A23B):

08:45 < ricotz> Running cxxtest tests (312 tests).................................................................................................................................................................................................................................WARNING: Skipping component scripts tests (can't find binaries/data/mods/public/simulation/components/tests/setup.js)
08:45 < ricotz> .......................................................................................OK!

As reported by @ricotz on IRC it breaks the tests when running without the public mod, which was still possible in A23B.

/ps/trunk/source/graphics/tests/test_MapGenerator.h
41

Missing:

if (!VfsFileExists(L"simulation/components/tests/setup.js"))
{
	debug_printf("WARNING: Skipping component scripts tests (can't find binaries/data/mods/public/simulation/components/tests/setup.js)\n");
	return;
}

From: https://code.wildfiregames.com/source/0ad/browse/ps/trunk/source/simulation2/components/tests/test_scripts.h

This commit now has outstanding concerns.Feb 27 2020, 9:55 AM
elexis requested verification of this commit.Apr 23 2020, 2:08 PM
This commit now requires verification by auditors.Apr 23 2020, 2:08 PM
Stan resigned from this commit.EditedApr 23 2020, 4:55 PM
This commit no longer requires audit.Apr 23 2020, 4:55 PM
Stan removed an auditor: Stan.Apr 23 2020, 4:55 PM