diff --git a/include/sol/call.hpp b/include/sol/call.hpp index 2066bd82..9df2482e 100644 --- a/include/sol/call.hpp +++ b/include/sol/call.hpp @@ -125,14 +125,20 @@ namespace sol { template struct constructor_match { T* obj_; + stack::stack_detail::undefined_metatable* p_umf_; - constructor_match(T* o) : obj_(o) { + constructor_match(T* obj_ptr, stack::stack_detail::undefined_metatable& umf) : obj_(obj_ptr), p_umf_(&umf) { } template int operator()(types, meta::index_value, types r, types a, lua_State* L, int, int start) const { detail::default_construct func {}; - return stack::call_into_lua(r, a, L, start, func, obj_); + int result = stack::call_into_lua(r, a, L, start, func, this->obj_); + // construct userdata table + // SPECIFICALLY, after we've created it successfully. + // If the constructor exits for any reason we have to break things down... + (*this->p_umf_)(); + return result; } }; @@ -317,11 +323,10 @@ namespace sol { T* obj = detail::usertype_allocate(L); reference userdataref(L, -1); stack::stack_detail::undefined_metatable umf(L, &meta[0], &stack::stack_detail::set_undefined_methods_on); - umf(); // put userdata at the first index lua_insert(L, 1); - construct_match(constructor_match(obj), L, argcount, 1 + static_cast(syntax)); + construct_match(constructor_match(obj, umf), L, argcount, 1 + static_cast(syntax)); userdataref.push(); return 1; @@ -649,13 +654,16 @@ namespace sol { argcount -= static_cast(syntax); T* obj = detail::usertype_allocate(L); - reference userdataref(L, -1); + stack_reference userdataref(L, -1); stack::stack_detail::undefined_metatable umf(L, &meta[0], &stack::stack_detail::set_undefined_methods_on); - umf(); // put userdata at the first index lua_insert(L, 1); - construct_match(constructor_match(obj), L, argcount, boost + 1 + 1 + static_cast(syntax)); + // Because of the way constructors work, + // we have to kill the data, but only if the cosntructor is successfulyl invoked... + // if it's not successfully invoked and we panic, + // we cannot actually deallcoate/delete the data. + construct_match(constructor_match(obj, umf), L, argcount, boost + 1 + 1 + static_cast(syntax)); userdataref.push(); return 1; diff --git a/tests/config_tests/function_pointers/CMakeLists.txt b/tests/config_tests/function_pointers/CMakeLists.txt index 1101933c..c0cf4fb0 100644 --- a/tests/config_tests/function_pointers/CMakeLists.txt +++ b/tests/config_tests/function_pointers/CMakeLists.txt @@ -22,7 +22,10 @@ # # # # sol2 tests - simple regression tests -file(GLOB test_sources source/*.cpp) +file(GLOB test_sources + LIST_DIRECTORIES FALSE + CONFIGURE_DEPENDS + source/*.cpp) source_group(sources FILES ${test_sources}) function(CREATE_TEST test_target_name test_name target_sol) diff --git a/tests/inclusion/CMakeLists.txt b/tests/inclusion/CMakeLists.txt index 530a2556..d3d7af53 100644 --- a/tests/inclusion/CMakeLists.txt +++ b/tests/inclusion/CMakeLists.txt @@ -22,12 +22,15 @@ # # # # sol2 tests - header compilation tests -file(GLOB_RECURSE SOL2_COMPILE_TEST_SOURCES source/*.cpp) +file(GLOB_RECURSE SOL2_COMPILE_TEST_SOURCES + LIST_DIRECTORIES FALSE + CONFIGURE_DEPENDS + source/*.cpp) source_group(compile_test_sources FILES "${SOL2_COMPILE_TEST_SOURCES}") function(CREATE_TEST test_target_name test_name target_sol) if (test_name MATCHES ".single") - add_executable(${test_target_name} "source/main.cpp" "source/forward.cpp" "source/sol.cpp") + add_executable(${test_target_name} "source/main.cpp" "source/forward.cpp" "source/sol.cpp" "source/config.cpp") else() add_executable(${test_target_name} "${SOL2_COMPILE_TEST_SOURCES}") endif() @@ -37,7 +40,10 @@ function(CREATE_TEST test_target_name test_name target_sol) EXPORT_NAME sol2::${test_name}) target_link_libraries(${test_target_name} PUBLIC Threads::Threads ${LUA_LIBRARIES} ${target_sol} ${CMAKE_DL_LIBS}) - + target_compile_options(${test_target_name} + PRIVATE + SOL_ENABLE_INTEROP=1 + SOL_ALL_SAFETIES_ON=1) if (MSVC) target_compile_options(${test_target_name} PRIVATE /std:c++latest /EHsc "$<$:/MDd>" diff --git a/tests/inclusion/source/as_args.cpp b/tests/inclusion/source/as_args.cpp index 44785aca..e09c923a 100644 --- a/tests/inclusion/source/as_args.cpp +++ b/tests/inclusion/source/as_args.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/as_returns.cpp b/tests/inclusion/source/as_returns.cpp index 42d9b19d..cb68dd95 100644 --- a/tests/inclusion/source/as_returns.cpp +++ b/tests/inclusion/source/as_returns.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/base_traits.cpp b/tests/inclusion/source/base_traits.cpp index a0615ae4..13eef577 100644 --- a/tests/inclusion/source/base_traits.cpp +++ b/tests/inclusion/source/base_traits.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/bind_traits.cpp b/tests/inclusion/source/bind_traits.cpp index 8547787d..f3a72d83 100644 --- a/tests/inclusion/source/bind_traits.cpp +++ b/tests/inclusion/source/bind_traits.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/bytecode.cpp b/tests/inclusion/source/bytecode.cpp index dee4c382..845921f5 100644 --- a/tests/inclusion/source/bytecode.cpp +++ b/tests/inclusion/source/bytecode.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/call.cpp b/tests/inclusion/source/call.cpp index 03348532..30b15d43 100644 --- a/tests/inclusion/source/call.cpp +++ b/tests/inclusion/source/call.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/compatibility.cpp b/tests/inclusion/source/compatibility.cpp index 23a1335f..e127e7ee 100644 --- a/tests/inclusion/source/compatibility.cpp +++ b/tests/inclusion/source/compatibility.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/config.cpp b/tests/inclusion/source/config.cpp index 354a813e..e8c43aa2 100644 --- a/tests/inclusion/source/config.cpp +++ b/tests/inclusion/source/config.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/coroutine.cpp b/tests/inclusion/source/coroutine.cpp index cf88c06a..189ab29a 100644 --- a/tests/inclusion/source/coroutine.cpp +++ b/tests/inclusion/source/coroutine.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/debug.cpp b/tests/inclusion/source/debug.cpp index 42dc365f..5e32a961 100644 --- a/tests/inclusion/source/debug.cpp +++ b/tests/inclusion/source/debug.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/demangle.cpp b/tests/inclusion/source/demangle.cpp index 29fcda6d..dbd41d96 100644 --- a/tests/inclusion/source/demangle.cpp +++ b/tests/inclusion/source/demangle.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/deprecate.cpp b/tests/inclusion/source/deprecate.cpp index b1c10927..6c6f24fb 100644 --- a/tests/inclusion/source/deprecate.cpp +++ b/tests/inclusion/source/deprecate.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/ebco.cpp b/tests/inclusion/source/ebco.cpp index b7b246ea..968f4d9e 100644 --- a/tests/inclusion/source/ebco.cpp +++ b/tests/inclusion/source/ebco.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/environment.cpp b/tests/inclusion/source/environment.cpp index 99b93509..2d078f30 100644 --- a/tests/inclusion/source/environment.cpp +++ b/tests/inclusion/source/environment.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/error_handler.cpp b/tests/inclusion/source/error_handler.cpp index 32e56f20..c86fb5ee 100644 --- a/tests/inclusion/source/error_handler.cpp +++ b/tests/inclusion/source/error_handler.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/forward.cpp b/tests/inclusion/source/forward.cpp index d0ba841e..ae8bc722 100644 --- a/tests/inclusion/source/forward.cpp +++ b/tests/inclusion/source/forward.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/forward_detail.cpp b/tests/inclusion/source/forward_detail.cpp index 6063e263..55e361e4 100644 --- a/tests/inclusion/source/forward_detail.cpp +++ b/tests/inclusion/source/forward_detail.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/function.cpp b/tests/inclusion/source/function.cpp index 3f612635..555dc8b1 100644 --- a/tests/inclusion/source/function.cpp +++ b/tests/inclusion/source/function.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/function_result.cpp b/tests/inclusion/source/function_result.cpp index d9b13df5..d566c691 100644 --- a/tests/inclusion/source/function_result.cpp +++ b/tests/inclusion/source/function_result.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/function_types.cpp b/tests/inclusion/source/function_types.cpp index c314b564..cc81c3ae 100644 --- a/tests/inclusion/source/function_types.cpp +++ b/tests/inclusion/source/function_types.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/function_types_core.cpp b/tests/inclusion/source/function_types_core.cpp index 629569c5..1129eb48 100644 --- a/tests/inclusion/source/function_types_core.cpp +++ b/tests/inclusion/source/function_types_core.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/function_types_overloaded.cpp b/tests/inclusion/source/function_types_overloaded.cpp index 40bec012..297f03b7 100644 --- a/tests/inclusion/source/function_types_overloaded.cpp +++ b/tests/inclusion/source/function_types_overloaded.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/function_types_stateful.cpp b/tests/inclusion/source/function_types_stateful.cpp index c2ae930a..27c4b168 100644 --- a/tests/inclusion/source/function_types_stateful.cpp +++ b/tests/inclusion/source/function_types_stateful.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/function_types_stateless.cpp b/tests/inclusion/source/function_types_stateless.cpp index 26b393f2..9c9d7ee0 100644 --- a/tests/inclusion/source/function_types_stateless.cpp +++ b/tests/inclusion/source/function_types_stateless.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/function_types_templated.cpp b/tests/inclusion/source/function_types_templated.cpp index 921d2e82..9ed26da3 100644 --- a/tests/inclusion/source/function_types_templated.cpp +++ b/tests/inclusion/source/function_types_templated.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/in_place.cpp b/tests/inclusion/source/in_place.cpp index 7deae440..09c0d8ba 100644 --- a/tests/inclusion/source/in_place.cpp +++ b/tests/inclusion/source/in_place.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/inheritance.cpp b/tests/inclusion/source/inheritance.cpp index 2ac13945..35839b54 100644 --- a/tests/inclusion/source/inheritance.cpp +++ b/tests/inclusion/source/inheritance.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/load_result.cpp b/tests/inclusion/source/load_result.cpp index a6992702..c9621afa 100644 --- a/tests/inclusion/source/load_result.cpp +++ b/tests/inclusion/source/load_result.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/lua_table.cpp b/tests/inclusion/source/lua_table.cpp index 5033a903..87d4d517 100644 --- a/tests/inclusion/source/lua_table.cpp +++ b/tests/inclusion/source/lua_table.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/lua_value.cpp b/tests/inclusion/source/lua_value.cpp index 0b4b0c6f..b82ebe0c 100644 --- a/tests/inclusion/source/lua_value.cpp +++ b/tests/inclusion/source/lua_value.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/main.cpp b/tests/inclusion/source/main.cpp index c8a6d5d2..fe92f04b 100644 --- a/tests/inclusion/source/main.cpp +++ b/tests/inclusion/source/main.cpp @@ -21,8 +21,6 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include int main() { diff --git a/tests/inclusion/source/make_reference.cpp b/tests/inclusion/source/make_reference.cpp index 53fc0f99..d0264f4b 100644 --- a/tests/inclusion/source/make_reference.cpp +++ b/tests/inclusion/source/make_reference.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/metatable.cpp b/tests/inclusion/source/metatable.cpp index ea392c10..f437a371 100644 --- a/tests/inclusion/source/metatable.cpp +++ b/tests/inclusion/source/metatable.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/object.cpp b/tests/inclusion/source/object.cpp index d73459ca..eeb56c1e 100644 --- a/tests/inclusion/source/object.cpp +++ b/tests/inclusion/source/object.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/object_base.cpp b/tests/inclusion/source/object_base.cpp index 860e1750..3b83de99 100644 --- a/tests/inclusion/source/object_base.cpp +++ b/tests/inclusion/source/object_base.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/optional.cpp b/tests/inclusion/source/optional.cpp index 377d6cf2..51fdda82 100644 --- a/tests/inclusion/source/optional.cpp +++ b/tests/inclusion/source/optional.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/optional_implementation.cpp b/tests/inclusion/source/optional_implementation.cpp index 36d8fd06..223eac32 100644 --- a/tests/inclusion/source/optional_implementation.cpp +++ b/tests/inclusion/source/optional_implementation.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/overload.cpp b/tests/inclusion/source/overload.cpp index a3950afb..e36bfe7c 100644 --- a/tests/inclusion/source/overload.cpp +++ b/tests/inclusion/source/overload.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/packaged_coroutine.cpp b/tests/inclusion/source/packaged_coroutine.cpp index f33cfad5..a78c2348 100644 --- a/tests/inclusion/source/packaged_coroutine.cpp +++ b/tests/inclusion/source/packaged_coroutine.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/pairs_iterator.cpp b/tests/inclusion/source/pairs_iterator.cpp index afcc9dcd..75af975f 100644 --- a/tests/inclusion/source/pairs_iterator.cpp +++ b/tests/inclusion/source/pairs_iterator.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/pointer_like.cpp b/tests/inclusion/source/pointer_like.cpp index d6584694..ad6d12e3 100644 --- a/tests/inclusion/source/pointer_like.cpp +++ b/tests/inclusion/source/pointer_like.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/policies.cpp b/tests/inclusion/source/policies.cpp index 6c38f312..1d8168ad 100644 --- a/tests/inclusion/source/policies.cpp +++ b/tests/inclusion/source/policies.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/property.cpp b/tests/inclusion/source/property.cpp index 65f4d618..6675821a 100644 --- a/tests/inclusion/source/property.cpp +++ b/tests/inclusion/source/property.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/protect.cpp b/tests/inclusion/source/protect.cpp index 9b39f276..89cfd892 100644 --- a/tests/inclusion/source/protect.cpp +++ b/tests/inclusion/source/protect.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/protected_function.cpp b/tests/inclusion/source/protected_function.cpp index 7f42cc39..73e489c7 100644 --- a/tests/inclusion/source/protected_function.cpp +++ b/tests/inclusion/source/protected_function.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/protected_function_result.cpp b/tests/inclusion/source/protected_function_result.cpp index 39c0febb..c3446d26 100644 --- a/tests/inclusion/source/protected_function_result.cpp +++ b/tests/inclusion/source/protected_function_result.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/protected_handler.cpp b/tests/inclusion/source/protected_handler.cpp index d1f55408..9baa5e36 100644 --- a/tests/inclusion/source/protected_handler.cpp +++ b/tests/inclusion/source/protected_handler.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/proxy.cpp b/tests/inclusion/source/proxy.cpp index e69b9fdf..162761e8 100644 --- a/tests/inclusion/source/proxy.cpp +++ b/tests/inclusion/source/proxy.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/proxy_base.cpp b/tests/inclusion/source/proxy_base.cpp index 05f753d8..3438358b 100644 --- a/tests/inclusion/source/proxy_base.cpp +++ b/tests/inclusion/source/proxy_base.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/raii.cpp b/tests/inclusion/source/raii.cpp index e4962ae5..e9319972 100644 --- a/tests/inclusion/source/raii.cpp +++ b/tests/inclusion/source/raii.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/reference.cpp b/tests/inclusion/source/reference.cpp index b68a3d3d..8521eba5 100644 --- a/tests/inclusion/source/reference.cpp +++ b/tests/inclusion/source/reference.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/resolve.cpp b/tests/inclusion/source/resolve.cpp index 135f75c3..e215e9b5 100644 --- a/tests/inclusion/source/resolve.cpp +++ b/tests/inclusion/source/resolve.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/sol.cpp b/tests/inclusion/source/sol.cpp index 0a0451d4..00325fd7 100644 --- a/tests/inclusion/source/sol.cpp +++ b/tests/inclusion/source/sol.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/sol_defines.hpp b/tests/inclusion/source/sol_defines.hpp deleted file mode 100644 index 7488ef30..00000000 --- a/tests/inclusion/source/sol_defines.hpp +++ /dev/null @@ -1,34 +0,0 @@ -// sol2 - -// The MIT License (MIT) - -// Copyright (c) 2013-2021 Rapptz, ThePhD and contributors - -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -// the Software, and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -#ifndef SOL_TESTS_SOL_DEFINES_HPP -#define SOL_TESTS_SOL_DEFINES_HPP - -#if !defined(SOL_ALL_SAFETIES_ON) -#define SOL_ALL_SAFETIES_ON 1 -#endif // SOL_ALL_SAFETIES_ON -#if !defined(SOL_ENABLE_INTEROP) -#define SOL_ENABLE_INTEROP 1 -#endif // SOL_ENABLE_INTEROP - -#endif // SOL_TESTS_SOL_DEFINES_HPP diff --git a/tests/inclusion/source/stack.cpp b/tests/inclusion/source/stack.cpp index a16379e1..b21a099b 100644 --- a/tests/inclusion/source/stack.cpp +++ b/tests/inclusion/source/stack.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/stack_check.cpp b/tests/inclusion/source/stack_check.cpp index a3dbcd5e..3ae2ca68 100644 --- a/tests/inclusion/source/stack_check.cpp +++ b/tests/inclusion/source/stack_check.cpp @@ -21,7 +21,5 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - //#include #include diff --git a/tests/inclusion/source/stack_check_get.cpp b/tests/inclusion/source/stack_check_get.cpp index b984a54b..6aca04e2 100644 --- a/tests/inclusion/source/stack_check_get.cpp +++ b/tests/inclusion/source/stack_check_get.cpp @@ -21,7 +21,5 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - //#include #include diff --git a/tests/inclusion/source/stack_check_get_qualified.cpp b/tests/inclusion/source/stack_check_get_qualified.cpp index 302a4ac6..fd6861fa 100644 --- a/tests/inclusion/source/stack_check_get_qualified.cpp +++ b/tests/inclusion/source/stack_check_get_qualified.cpp @@ -21,7 +21,5 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - //#include #include diff --git a/tests/inclusion/source/stack_check_get_unqualified.cpp b/tests/inclusion/source/stack_check_get_unqualified.cpp index a39e49cc..a1c558d6 100644 --- a/tests/inclusion/source/stack_check_get_unqualified.cpp +++ b/tests/inclusion/source/stack_check_get_unqualified.cpp @@ -21,7 +21,5 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - //#include #include diff --git a/tests/inclusion/source/stack_check_qualified.cpp b/tests/inclusion/source/stack_check_qualified.cpp index 71a54cc4..759414c0 100644 --- a/tests/inclusion/source/stack_check_qualified.cpp +++ b/tests/inclusion/source/stack_check_qualified.cpp @@ -21,7 +21,5 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - //#include #include diff --git a/tests/inclusion/source/stack_check_unqualified.cpp b/tests/inclusion/source/stack_check_unqualified.cpp index b117090f..7557d10c 100644 --- a/tests/inclusion/source/stack_check_unqualified.cpp +++ b/tests/inclusion/source/stack_check_unqualified.cpp @@ -21,7 +21,5 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - //#include #include diff --git a/tests/inclusion/source/stack_core.cpp b/tests/inclusion/source/stack_core.cpp index 4f974ed8..79d44945 100644 --- a/tests/inclusion/source/stack_core.cpp +++ b/tests/inclusion/source/stack_core.cpp @@ -21,7 +21,5 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - //#include #include diff --git a/tests/inclusion/source/stack_field.cpp b/tests/inclusion/source/stack_field.cpp index 21f43fef..40b81d2d 100644 --- a/tests/inclusion/source/stack_field.cpp +++ b/tests/inclusion/source/stack_field.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/stack_get.cpp b/tests/inclusion/source/stack_get.cpp index 7076361a..85305b06 100644 --- a/tests/inclusion/source/stack_get.cpp +++ b/tests/inclusion/source/stack_get.cpp @@ -21,7 +21,5 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - //#include #include diff --git a/tests/inclusion/source/stack_get_qualified.cpp b/tests/inclusion/source/stack_get_qualified.cpp index 385a0bd5..96ad0d40 100644 --- a/tests/inclusion/source/stack_get_qualified.cpp +++ b/tests/inclusion/source/stack_get_qualified.cpp @@ -21,7 +21,5 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - //#include #include diff --git a/tests/inclusion/source/stack_get_unqualified.cpp b/tests/inclusion/source/stack_get_unqualified.cpp index 7011c53c..92d065f3 100644 --- a/tests/inclusion/source/stack_get_unqualified.cpp +++ b/tests/inclusion/source/stack_get_unqualified.cpp @@ -21,7 +21,5 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - //#include #include diff --git a/tests/inclusion/source/stack_guard.cpp b/tests/inclusion/source/stack_guard.cpp index 974b94e6..0d0a3fbd 100644 --- a/tests/inclusion/source/stack_guard.cpp +++ b/tests/inclusion/source/stack_guard.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/stack_iterator.cpp b/tests/inclusion/source/stack_iterator.cpp index 9b53b8d3..23a7724a 100644 --- a/tests/inclusion/source/stack_iterator.cpp +++ b/tests/inclusion/source/stack_iterator.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/stack_pop.cpp b/tests/inclusion/source/stack_pop.cpp index b0b5e19c..83bacb85 100644 --- a/tests/inclusion/source/stack_pop.cpp +++ b/tests/inclusion/source/stack_pop.cpp @@ -21,7 +21,5 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - //#include #include diff --git a/tests/inclusion/source/stack_probe.cpp b/tests/inclusion/source/stack_probe.cpp index 89ceae48..3c78e248 100644 --- a/tests/inclusion/source/stack_probe.cpp +++ b/tests/inclusion/source/stack_probe.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/stack_proxy.cpp b/tests/inclusion/source/stack_proxy.cpp index 80bcbf6e..77e1b743 100644 --- a/tests/inclusion/source/stack_proxy.cpp +++ b/tests/inclusion/source/stack_proxy.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/stack_proxy_base.cpp b/tests/inclusion/source/stack_proxy_base.cpp index 4de7fef7..d8a5f214 100644 --- a/tests/inclusion/source/stack_proxy_base.cpp +++ b/tests/inclusion/source/stack_proxy_base.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/stack_push.cpp b/tests/inclusion/source/stack_push.cpp index 1fc513a8..55708c06 100644 --- a/tests/inclusion/source/stack_push.cpp +++ b/tests/inclusion/source/stack_push.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/stack_reference.cpp b/tests/inclusion/source/stack_reference.cpp index 4065b7bf..28d9cb0f 100644 --- a/tests/inclusion/source/stack_reference.cpp +++ b/tests/inclusion/source/stack_reference.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/state_handling.cpp b/tests/inclusion/source/state_handling.cpp index f5cafae8..636f4057 100644 --- a/tests/inclusion/source/state_handling.cpp +++ b/tests/inclusion/source/state_handling.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/string_view.cpp b/tests/inclusion/source/string_view.cpp index ac0ab532..944932a1 100644 --- a/tests/inclusion/source/string_view.cpp +++ b/tests/inclusion/source/string_view.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/table.cpp b/tests/inclusion/source/table.cpp index 1a741141..05d16ace 100644 --- a/tests/inclusion/source/table.cpp +++ b/tests/inclusion/source/table.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/table_core.cpp b/tests/inclusion/source/table_core.cpp index 599cfcd0..84fb73a6 100644 --- a/tests/inclusion/source/table_core.cpp +++ b/tests/inclusion/source/table_core.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/table_iterator.cpp b/tests/inclusion/source/table_iterator.cpp index 2dc991c1..98160185 100644 --- a/tests/inclusion/source/table_iterator.cpp +++ b/tests/inclusion/source/table_iterator.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/thread.cpp b/tests/inclusion/source/thread.cpp index 98a58d41..2df7e086 100644 --- a/tests/inclusion/source/thread.cpp +++ b/tests/inclusion/source/thread.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/tie.cpp b/tests/inclusion/source/tie.cpp index ee873f0b..58c907dd 100644 --- a/tests/inclusion/source/tie.cpp +++ b/tests/inclusion/source/tie.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/traits.cpp b/tests/inclusion/source/traits.cpp index 57802bd6..2dffd39d 100644 --- a/tests/inclusion/source/traits.cpp +++ b/tests/inclusion/source/traits.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/trampoline.cpp b/tests/inclusion/source/trampoline.cpp index aacc216d..e0904694 100644 --- a/tests/inclusion/source/trampoline.cpp +++ b/tests/inclusion/source/trampoline.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/tuple.cpp b/tests/inclusion/source/tuple.cpp index eaabdc2c..d0c8cd07 100644 --- a/tests/inclusion/source/tuple.cpp +++ b/tests/inclusion/source/tuple.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/types.cpp b/tests/inclusion/source/types.cpp index 87537866..ec22f225 100644 --- a/tests/inclusion/source/types.cpp +++ b/tests/inclusion/source/types.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/unicode.cpp b/tests/inclusion/source/unicode.cpp index ce5941fe..2515581d 100644 --- a/tests/inclusion/source/unicode.cpp +++ b/tests/inclusion/source/unicode.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/unique_usertype_traits.cpp b/tests/inclusion/source/unique_usertype_traits.cpp index e59ab57a..cc68ac86 100644 --- a/tests/inclusion/source/unique_usertype_traits.cpp +++ b/tests/inclusion/source/unique_usertype_traits.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/unsafe_function.cpp b/tests/inclusion/source/unsafe_function.cpp index d9a5f32e..6acb604c 100644 --- a/tests/inclusion/source/unsafe_function.cpp +++ b/tests/inclusion/source/unsafe_function.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/unsafe_function_result.cpp b/tests/inclusion/source/unsafe_function_result.cpp index c7acdf20..ae9a687c 100644 --- a/tests/inclusion/source/unsafe_function_result.cpp +++ b/tests/inclusion/source/unsafe_function_result.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/userdata.cpp b/tests/inclusion/source/userdata.cpp index 0329a04f..584ec35e 100644 --- a/tests/inclusion/source/userdata.cpp +++ b/tests/inclusion/source/userdata.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/usertype.cpp b/tests/inclusion/source/usertype.cpp index 69a181ab..745c882f 100644 --- a/tests/inclusion/source/usertype.cpp +++ b/tests/inclusion/source/usertype.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/usertype_container.cpp b/tests/inclusion/source/usertype_container.cpp index 29237ad2..28632a5c 100644 --- a/tests/inclusion/source/usertype_container.cpp +++ b/tests/inclusion/source/usertype_container.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/usertype_container_launch.cpp b/tests/inclusion/source/usertype_container_launch.cpp index cb5c4ee6..1cf46409 100644 --- a/tests/inclusion/source/usertype_container_launch.cpp +++ b/tests/inclusion/source/usertype_container_launch.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/usertype_core.cpp b/tests/inclusion/source/usertype_core.cpp index d5f4046c..542a9a39 100644 --- a/tests/inclusion/source/usertype_core.cpp +++ b/tests/inclusion/source/usertype_core.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/usertype_proxy.cpp b/tests/inclusion/source/usertype_proxy.cpp index 8692fdf2..664c23b8 100644 --- a/tests/inclusion/source/usertype_proxy.cpp +++ b/tests/inclusion/source/usertype_proxy.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/usertype_storage.cpp b/tests/inclusion/source/usertype_storage.cpp index 08cc70cb..64581674 100644 --- a/tests/inclusion/source/usertype_storage.cpp +++ b/tests/inclusion/source/usertype_storage.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/usertype_traits.cpp b/tests/inclusion/source/usertype_traits.cpp index 73067dd7..3a65bc49 100644 --- a/tests/inclusion/source/usertype_traits.cpp +++ b/tests/inclusion/source/usertype_traits.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/variadic_args.cpp b/tests/inclusion/source/variadic_args.cpp index 9588f41b..18259655 100644 --- a/tests/inclusion/source/variadic_args.cpp +++ b/tests/inclusion/source/variadic_args.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/variadic_results.cpp b/tests/inclusion/source/variadic_results.cpp index 37907a95..44d2fcb1 100644 --- a/tests/inclusion/source/variadic_results.cpp +++ b/tests/inclusion/source/variadic_results.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/version.cpp b/tests/inclusion/source/version.cpp index ee87cdeb..7ebc530a 100644 --- a/tests/inclusion/source/version.cpp +++ b/tests/inclusion/source/version.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/inclusion/source/wrapper.cpp b/tests/inclusion/source/wrapper.cpp index 0507b6ee..58807853 100644 --- a/tests/inclusion/source/wrapper.cpp +++ b/tests/inclusion/source/wrapper.cpp @@ -21,6 +21,4 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "sol_defines.hpp" - #include diff --git a/tests/regression_tests/simple/CMakeLists.txt b/tests/regression_tests/simple/CMakeLists.txt index 2ad6ecc4..a8c9786a 100644 --- a/tests/regression_tests/simple/CMakeLists.txt +++ b/tests/regression_tests/simple/CMakeLists.txt @@ -22,7 +22,11 @@ # # # # sol2 tests - simple regression tests -file(GLOB simple_test_sources source/*.cpp) +file(GLOB_RECURSE simple_test_sources + LIST_DIRECTORIES FALSE + CONFIGURE_DEPENDS + source/*.cpp) + source_group(test_sources FILES ${simple_test_sources}) function(CREATE_TEST test_target_name test_name target_sol) diff --git a/tests/regression_tests/simple/source/1144 - type destructed from non-destructed memory.cpp b/tests/regression_tests/simple/source/1144 - type destructed from non-destructed memory.cpp new file mode 100644 index 00000000..6c09f73f --- /dev/null +++ b/tests/regression_tests/simple/source/1144 - type destructed from non-destructed memory.cpp @@ -0,0 +1,28 @@ +#include + +inline namespace sol2_regression_test_1144 { + class MyClass { + private: + std::string m_name; + + public: + MyClass(const std::string& name) : m_name(name) {}; + }; + + void bind_class(sol::state_view state) { + sol::usertype bind_my_class = state.new_usertype("MyClass", sol::call_constructor, sol::constructors()); + } +} // namespace sol2_regression_test_1144 + +unsigned int regression_1144() { + sol::state state; + bind_class(state); + sol::protected_function_result pr = state.do_string("local a = MyClass();"); + if (!pr.valid()) { + sol::error err = pr; + std::cout << "An error occurred, as expected:\n" << err.what() << std::endl; + return 0; + } + + return 1; +} diff --git a/tests/runtime_tests/CMakeLists.txt b/tests/runtime_tests/CMakeLists.txt index 5b5bab04..abb8bb37 100644 --- a/tests/runtime_tests/CMakeLists.txt +++ b/tests/runtime_tests/CMakeLists.txt @@ -22,7 +22,10 @@ # # # # sol2 tests - runtime tests -file(GLOB SOL2_RUNTIME_TEST_SOURCES source/*.cpp) +file(GLOB SOL2_RUNTIME_TEST_SOURCES + LIST_DIRECTORIES FALSE + CONFIGURE_DEPENDS + source/*.cpp) source_group(test_sources FILES ${SOL2_RUNTIME_TEST_SOURCES}) function(CREATE_TEST test_target_name test_name target_sol)