Created a crate model in glb and obj format to use in the tests, then finished the model test.
This commit is contained in:
parent
c6a7c42a4e
commit
2431cf8c97
9 changed files with 125 additions and 51 deletions
|
|
@ -2,20 +2,38 @@
|
|||
#include <string>
|
||||
#include <fuc2/testing.hpp>
|
||||
#include "model.hpp"
|
||||
#include "shader.hpp"
|
||||
|
||||
using namespace fuc2;
|
||||
|
||||
namespace model_tests {
|
||||
void test_load_textures() {
|
||||
Model model{"assets/popcorn_model_a.glb"};
|
||||
Shader shader{"shaders/14-vert.glsl", "shaders/14-frag.glsl"};
|
||||
|
||||
Model popcorn{"assets", "popcorn_model_a.glb"};
|
||||
popcorn.draw(shader);
|
||||
|
||||
Model crate_glb{"assets", "crate.glb"};
|
||||
crate_glb.draw(shader);
|
||||
|
||||
Model crate_obj{"assets", "crate.obj"};
|
||||
crate_obj.draw(shader);
|
||||
}
|
||||
|
||||
void test_failures() {
|
||||
auto runner = [&]() {
|
||||
Model bad_obj{"assets", "does_not_exist.obj"};
|
||||
};
|
||||
|
||||
BLOWS_UP(runner, "should fail on missing file.");
|
||||
}
|
||||
|
||||
fuc2::Set TESTS{
|
||||
.name="models",
|
||||
.options={ .fail_fast=false },
|
||||
.tests={
|
||||
TEST(test_load_textures),
|
||||
TEST(test_failures),
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue