Skip component script tests when the mods/public/ directory is unavailable (see #490).

Report errors ealier when test data directories are missing.

This was SVN commit r7506.
This commit is contained in:
Ykkrosh 2010-05-07 15:59:23 +00:00
parent e73a3cff78
commit 40f2cfd809
7 changed files with 16 additions and 10 deletions

View File

@ -59,7 +59,7 @@ class TestMeshManager : public CxxTest::TestSuite
g_VFS = CreateVfs(20*MiB);
TS_ASSERT_OK(g_VFS->Mount(L"", MOD_PATH));
TS_ASSERT_OK(g_VFS->Mount(L"collada/", DataDir()/L"tests/collada"));
TS_ASSERT_OK(g_VFS->Mount(L"collada/", DataDir()/L"tests/collada", VFS_MOUNT_MUST_EXIST));
// Mount _testcache onto virtual /cache - don't use the normal cache
// directory because that's full of loads of cached files from the

View File

@ -38,7 +38,7 @@ public:
{
PIVFS vfs = CreateVfs(20*MiB);
TS_ASSERT_OK(vfs->Mount(L"", DataDir()/L"mods/_test.xero"));
TS_ASSERT_OK(vfs->Mount(L"", DataDir()/L"mods/_test.xero", VFS_MOUNT_MUST_EXIST));
VfsPath xmbPath;

View File

@ -39,7 +39,7 @@ public:
CXeromyces::Startup();
g_VFS = CreateVfs(20 * MiB);
TS_ASSERT_OK(g_VFS->Mount(L"", DataDir()/L"mods/public"));
TS_ASSERT_OK(g_VFS->Mount(L"", DataDir()/L"mods/public", VFS_MOUNT_MUST_EXIST));
TS_ASSERT_OK(g_VFS->Mount(L"cache/", DataDir()/L"cache"));
// Set up loads of stuff that's needed in order to load a map

View File

@ -25,7 +25,7 @@ public:
void setUp()
{
g_VFS = CreateVfs(20 * MiB);
TS_ASSERT_OK(g_VFS->Mount(L"", DataDir()/L"mods/public"));
g_VFS->Mount(L"", DataDir()/L"mods/public", VFS_MOUNT_MUST_EXIST); // ignore directory-not-found errors
CXeromyces::Startup();
}
@ -53,6 +53,12 @@ public:
void test_scripts()
{
if (!FileExists(L"simulation/components/tests/"))
{
debug_printf(L"WARNING: Skipping component scripts tests (can't find binaries/data/mods/public/simulation/components/tests)\n");
return;
}
VfsPaths paths;
TS_ASSERT_OK(fs_util::GetPathnames(g_VFS, L"simulation/components/tests/", L"test_*.js", paths));
for (size_t i = 0; i < paths.size(); ++i)

View File

@ -48,7 +48,7 @@ public:
void test_LoadTemplate()
{
TS_ASSERT_OK(g_VFS->Mount(L"", DataDir()/L"mods/_test.sim"));
TS_ASSERT_OK(g_VFS->Mount(L"", DataDir()/L"mods/_test.sim", VFS_MOUNT_MUST_EXIST));
CSimContext context;
CComponentManager man(context);
@ -93,7 +93,7 @@ public:
void test_LoadTemplate_errors()
{
TS_ASSERT_OK(g_VFS->Mount(L"", DataDir()/L"mods/_test.sim"));
TS_ASSERT_OK(g_VFS->Mount(L"", DataDir()/L"mods/_test.sim", VFS_MOUNT_MUST_EXIST));
CSimContext context;
CComponentManager man(context);
@ -126,7 +126,7 @@ public:
void test_LoadTemplate_multiple()
{
TS_ASSERT_OK(g_VFS->Mount(L"", DataDir()/L"mods/_test.sim"));
TS_ASSERT_OK(g_VFS->Mount(L"", DataDir()/L"mods/_test.sim", VFS_MOUNT_MUST_EXIST));
CSimContext context;
CComponentManager man(context);
@ -166,7 +166,7 @@ public:
void test_load_all_DISABLED() // disabled since it's a bit slow
{
TS_ASSERT_OK(g_VFS->Mount(L"", DataDir()/L"mods/public"));
TS_ASSERT_OK(g_VFS->Mount(L"", DataDir()/L"mods/public", VFS_MOUNT_MUST_EXIST));
CTerrain dummy;
CSimulation2 sim(NULL, &dummy);

View File

@ -44,7 +44,7 @@ public:
void setUp()
{
g_VFS = CreateVfs(20 * MiB);
TS_ASSERT_OK(g_VFS->Mount(L"", DataDir()/L"mods/_test.sim"));
TS_ASSERT_OK(g_VFS->Mount(L"", DataDir()/L"mods/_test.sim", VFS_MOUNT_MUST_EXIST));
CXeromyces::Startup();
}

View File

@ -42,7 +42,7 @@ public:
void setUp()
{
g_VFS = CreateVfs(20 * MiB);
TS_ASSERT_OK(g_VFS->Mount(L"", DataDir()/L"mods/_test.sim"));
TS_ASSERT_OK(g_VFS->Mount(L"", DataDir()/L"mods/_test.sim", VFS_MOUNT_MUST_EXIST));
CXeromyces::Startup();
}