/
shadersTest.cpp
40 lines (30 loc) · 928 Bytes
/
shadersTest.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#define BOOST_TEST_MODULE shadersTest
#include <boost/test/included/unit_test.hpp>
#include "VFSFixture.h"
#include "radiant/shaders/ShaderFileLoader.h"
#include "radiant/shaders/textures/GLTextureManager.h"
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<MockShaderLibrary> loader("materials", library);
loader.parseFiles();
}