aboutsummaryrefslogtreecommitdiff
path: root/unit_tests/init_and_shutdown.cpp
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2025-03-10 12:02:43 +0100
committerBenoit Germain <benoit.germain@ubisoft.com>2025-03-10 12:02:43 +0100
commitb35f8f264d806b0a614588e75f9b7c2712c860a4 (patch)
tree3a3e0eff3ded57c42a1b74f7365ebd724e1bd88b /unit_tests/init_and_shutdown.cpp
parent6aca0e436306b176ab7e2e866927442280055b52 (diff)
downloadlanes-b35f8f264d806b0a614588e75f9b7c2712c860a4.tar.gz
lanes-b35f8f264d806b0a614588e75f9b7c2712c860a4.tar.bz2
lanes-b35f8f264d806b0a614588e75f9b7c2712c860a4.zip
Some fixes for unit tests with LuaJIT
* vcproj settings * always load "jit" module so that lanes does not detect it in running under PUC-Lua * add fixture support so that test "cooperative_shutdown.lua" works * fix test "lanes.configure() allocator setting not failing like it should
Diffstat (limited to 'unit_tests/init_and_shutdown.cpp')
-rw-r--r--unit_tests/init_and_shutdown.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/unit_tests/init_and_shutdown.cpp b/unit_tests/init_and_shutdown.cpp
index 147a742..7450a80 100644
--- a/unit_tests/init_and_shutdown.cpp
+++ b/unit_tests/init_and_shutdown.cpp
@@ -150,7 +150,9 @@ TEST_CASE("lanes.configure")
150 }; 150 };
151 lua_pushcfunction(L, _provideAllocator); 151 lua_pushcfunction(L, _provideAllocator);
152 lua_setglobal(L, "ProvideAllocator"); 152 lua_setglobal(L, "ProvideAllocator");
153 L.requireFailure("require 'lanes'.configure{allocator = ProvideAllocator}"); 153 // force value of internal_allocator so that the LuaJIT-default 'libc' is not selected
154 // which would prevent us from calling _provideAllocator
155 L.requireFailure("require 'lanes'.configure{allocator = ProvideAllocator, internal_allocator = 'allocator'}");
154 } 156 }
155 157
156 // ----------------------------------------------------------------------------------------- 158 // -----------------------------------------------------------------------------------------
@@ -166,7 +168,9 @@ TEST_CASE("lanes.configure")
166 }; 168 };
167 lua_pushcfunction(L, _provideAllocator); 169 lua_pushcfunction(L, _provideAllocator);
168 lua_setglobal(L, "ProvideAllocator"); 170 lua_setglobal(L, "ProvideAllocator");
169 L.requireFailure("require 'lanes'.configure{allocator = ProvideAllocator}"); 171 // force value of internal_allocator so that the LuaJIT-default 'libc' is not selected
172 // which would prevent us from calling _provideAllocator
173 L.requireFailure("require 'lanes'.configure{allocator = ProvideAllocator, internal_allocator = 'allocator'}");
170 } 174 }
171 175
172 // ----------------------------------------------------------------------------------------- 176 // -----------------------------------------------------------------------------------------
@@ -183,7 +187,9 @@ TEST_CASE("lanes.configure")
183 }; 187 };
184 lua_pushcfunction(L, _provideAllocator); 188 lua_pushcfunction(L, _provideAllocator);
185 lua_setglobal(L, "ProvideAllocator"); 189 lua_setglobal(L, "ProvideAllocator");
186 L.requireFailure("require 'lanes'.configure{allocator = ProvideAllocator}"); 190 // force value of internal_allocator so that the LuaJIT-default 'libc' is not selected
191 // which would prevent us from calling _provideAllocator
192 L.requireFailure("require 'lanes'.configure{allocator = ProvideAllocator, internal_allocator = 'allocator'}");
187 } 193 }
188 } 194 }
189 195