Skip to content

Commit

Permalink
[meta] fix entry points for all tests and demos
Browse files Browse the repository at this point in the history
  • Loading branch information
harrand committed Oct 31, 2024
1 parent 767aa7f commit e9dc5df
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 13 deletions.
3 changes: 2 additions & 1 deletion demo/tz/tz_triangle_demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
#include ImportedShaderHeader(triangle, vertex)
#include ImportedShaderHeader(triangle, fragment)

int main()
#include "tz/main.hpp"
int tz_main()
{
tz::initialise();
tz::os::open_window({.title = "tz_triangle_demo"});
Expand Down
3 changes: 2 additions & 1 deletion test/tz/bundle_test.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#include "tz/topaz.hpp"
#include "tz/os/file.hpp"

int main()
#include "tz/main.hpp"
int tz_main()
{
std::string ret = tz_must(tz::os::read_file("./files/secret.txt"));
tz_assert(ret == "42", "");
Expand Down
3 changes: 2 additions & 1 deletion test/tz/gpu_compute_renderer_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
#include "tz/gpu/graph.hpp"
#include ImportedShaderHeader(noop, compute)

int main()
#include "tz/main.hpp"
int tz_main()
{
tz::initialise();

Expand Down
3 changes: 2 additions & 1 deletion test/tz/gpu_graphics_renderer_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
#include ImportedShaderHeader(triangle, vertex)
#include ImportedShaderHeader(triangle, fragment)

int main()
#include "tz/main.hpp"
int tz_main()
{
tz::initialise();
tz::os::open_window({.title = "Graphics Render Test", .flags = tz::os::window_flags::invisible});
Expand Down
3 changes: 2 additions & 1 deletion test/tz/gpu_initialise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ void go()
tz::terminate();
}

int main()
#include "tz/main.hpp"
int tz_main()
{
// go twice, to test that terminate -> initialise again works.
go();
Expand Down
3 changes: 2 additions & 1 deletion test/tz/gpu_resource_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#include "tz/gpu/hardware.hpp"
#include "tz/gpu/resource.hpp"

int main()
#include "tz/main.hpp"
int tz_main()
{
tz::initialise();

Expand Down
3 changes: 2 additions & 1 deletion test/tz/gpu_shader_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
#include ImportedShaderHeader(triangle, fragment)
#include ImportedShaderHeader(noop, compute)

int main()
#include "tz/main.hpp"
int tz_main()
{
tz::initialise();

Expand Down
3 changes: 2 additions & 1 deletion test/tz/initialise.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "tz/topaz.hpp"

int main()
#include "tz/main.hpp"
int tz_main()
{
tz::initialise();
tz::terminate();
Expand Down
3 changes: 2 additions & 1 deletion test/tz/io_image_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#include "tz/os/file.hpp"
#include "tz/io/image.hpp"

int main()
#include "tz/main.hpp"
int tz_main()
{
std::string imgdata = tz_must(tz::os::read_file("./files/img.png"));
std::span<const std::byte> span{reinterpret_cast<std::byte*>(imgdata.data()), imgdata.size()};
Expand Down
3 changes: 2 additions & 1 deletion test/tz/lua_execute_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ void do_work()
tz_assert(myvar == "hello there", "string get failed");
}

int main()
#include "tz/main.hpp"
int tz_main()
{
tz::initialise();
// initialise topaz
Expand Down
3 changes: 2 additions & 1 deletion test/tz/matrix_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ void test_matrix_transpose()
tz_assert(transposed == expected, "transpose() failed. Expected transposed matrix");
}

int main()
#include "tz/main.hpp"
int tz_main()
{
test_matrix_constructor<int, 2>();
test_matrix_constructor<int, 3>();
Expand Down
3 changes: 2 additions & 1 deletion test/tz/ren_quad_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
#include "tz/os/window.hpp"
#include "tz/gpu/hardware.hpp"

int main()
#include "tz/main.hpp"
int tz_main()
{
tz::initialise();
tz::os::open_window({.flags = tz::os::window_flags::invisible});
Expand Down
3 changes: 2 additions & 1 deletion test/tz/vector_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ void test_basic_operations()
"Division failed. Expected: {{10.0f, 2.0f, 3.0f}}, got: {{{}, {}, {}}}", div_vec[0], div_vec[1], div_vec[2]);
}

int main()
#include "tz/main.hpp"
int tz_main()
{
test_constructor<int, 2>();
test_constructor<int, 3>();
Expand Down

0 comments on commit e9dc5df

Please sign in to comment.