diff --git a/radiant/Makefile.am b/radiant/Makefile.am index 705ec3f015..e060463b06 100644 --- a/radiant/Makefile.am +++ b/radiant/Makefile.am @@ -455,5 +455,8 @@ facePlaneTest_SOURCES = test/facePlaneTest.cpp \ brush/FacePlane.cpp facePlaneTest_LDADD = $(top_builddir)/libs/math/libmath.la -vfsTest_SOURCES = test/vfsTest.cpp $(VFS_SOURCES) +vfsTest_SOURCES = test/vfsTest.cpp $(VFS_SOURCES) \ + shaders/Doom3ShaderLayer.cpp \ + shaders/TableDefinition.cpp \ + shaders/textures/GLTextureManager.cpp vfsTest_LDFLAGS = $(FILESYSTEM_LIBS) $(Z_LIBS) diff --git a/radiant/test/vfsTest.cpp b/radiant/test/vfsTest.cpp index 90358e1ebd..697aef310c 100644 --- a/radiant/test/vfsTest.cpp +++ b/radiant/test/vfsTest.cpp @@ -3,6 +3,7 @@ #include "radiant/vfs/Doom3FileSystem.h" #include "radiant/shaders/ShaderFileLoader.h" +#include "radiant/shaders/textures/GLTextureManager.h" struct VFSFixture { @@ -100,14 +101,35 @@ BOOST_FIXTURE_TEST_CASE(handleAssetsLst, VFSFixture) BOOST_TEST(fileVis.count("assets.lst") == 0); } +namespace shaders +{ + +// Provide a local implementation of GetTextureManager since the application +// version calls the module registry. +GLTextureManager& GetTextureManager() +{ + static GLTextureManager manager; + return manager; +} + +} + using namespace shaders; +// Replacement for ShaderLibrary used in tests struct MockShaderLibrary { + bool addTableDefinition(const TableDefinitionPtr& def) + { return true; } + + bool addDefinition(const std::string& name, const ShaderDefinition& def) + { return true; } }; BOOST_FIXTURE_TEST_CASE(loaderShaderFiles, VFSFixture) { MockShaderLibrary library; shaders::ShaderFileLoader loader("materials", library); + + loader.parseFiles(); }