33 lines
680 B
C++
33 lines
680 B
C++
#include <deque>
|
|
#include <string>
|
|
#include <fuc2/testing.hpp>
|
|
#include "shader.hpp"
|
|
|
|
using namespace fuc2;
|
|
|
|
namespace shader_tests {
|
|
void test_load_shaders() {
|
|
Shader shader("shaders/3.3.shader.vs", "shaders/3.3.shader.fs");
|
|
|
|
shader.use();
|
|
|
|
CHECK(shader.ID != UINT_MAX, "Shader not initialized");
|
|
}
|
|
|
|
void test_compile_fail() {
|
|
auto runner = [&]() {
|
|
Shader shader("tests/bad_shader.vs", "shaders/3.3.shader.fs");
|
|
};
|
|
|
|
BLOWS_UP(runner, "compile fail should blow up");
|
|
}
|
|
|
|
fuc2::Set TESTS{
|
|
.name="shaders",
|
|
.options={ .fail_fast=false },
|
|
.tests={
|
|
TEST(test_load_shaders),
|
|
TEST(test_compile_fail),
|
|
}
|
|
};
|
|
}
|