aboutsummaryrefslogtreecommitdiff
path: root/unit_tests/lane_tests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unit_tests/lane_tests.cpp')
-rw-r--r--unit_tests/lane_tests.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/unit_tests/lane_tests.cpp b/unit_tests/lane_tests.cpp
index c4d3c95..05c517c 100644
--- a/unit_tests/lane_tests.cpp
+++ b/unit_tests/lane_tests.cpp
@@ -412,19 +412,22 @@ TEST_CASE("lane.cancel")
412// unfortunately, VS Test adapter does not list individual sections, 412// unfortunately, VS Test adapter does not list individual sections,
413// so let's create a separate test case for each file with an ugly macro... 413// so let's create a separate test case for each file with an ugly macro...
414 414
415#define MAKE_TEST_CASE(DIR, FILE, CONDITION)\ 415#define MAKE_TEST_CASE(DIR, FILE, CONDITION) \
416TEST_CASE("scripted_tests." #DIR "." #FILE) \ 416TEST_CASE("scripted_tests." #DIR "." #FILE) \
417{ \ 417{ \
418 FileRunner _runner(R"(.\unit_tests\scripts)"); \ 418 FileRunner _runner(R"(.\unit_tests\scripts)"); \
419 _runner.performTest(FileRunnerParam{ #DIR "/" #FILE, TestType::CONDITION }); \ 419 _runner.performTest(FileRunnerParam{ #DIR "/" #FILE, TestType::CONDITION }); \
420} 420}
421 421
422#if LUA_VERSION_NUM >= 504 // this makes use of to-be-closed variables, a Lua 5.4 feature
423#define MAKE_TEST_CASE_54(DIR, FILE, CONDITION) MAKE_TEST_CASE(DIR, FILE, CONDITION)
424#else // LUA_VERSION_NUM
425#define MAKE_TEST_CASE_54(DIR, FILE, CONDITION)
426#endif // LUA_VERSION_NUM
427
422MAKE_TEST_CASE(lane, body_is_a_c_function, AssertNoLuaError) 428MAKE_TEST_CASE(lane, body_is_a_c_function, AssertNoLuaError)
423MAKE_TEST_CASE(lane, cooperative_shutdown, AssertNoLuaError) 429MAKE_TEST_CASE(lane, cooperative_shutdown, AssertNoLuaError)
424#if LUA_VERSION_NUM >= 504 // warnings are a Lua 5.4 feature 430MAKE_TEST_CASE_54(lane, uncooperative_shutdown, AssertWarns) // NOTE: when this test ends, there are resource leaks and a dangling thread
425// NOTE: when this test ends, there are resource leaks and a dangling thread
426MAKE_TEST_CASE(lane, uncooperative_shutdown, AssertWarns)
427#endif // LUA_VERSION_NUM
428MAKE_TEST_CASE(lane, tasking_basic, AssertNoLuaError) 431MAKE_TEST_CASE(lane, tasking_basic, AssertNoLuaError)
429MAKE_TEST_CASE(lane, tasking_cancelling_with_hook, AssertNoLuaError) 432MAKE_TEST_CASE(lane, tasking_cancelling_with_hook, AssertNoLuaError)
430MAKE_TEST_CASE(lane, tasking_cancelling, AssertNoLuaError) 433MAKE_TEST_CASE(lane, tasking_cancelling, AssertNoLuaError)
@@ -434,16 +437,18 @@ MAKE_TEST_CASE(lane, tasking_error, AssertNoLuaError)
434MAKE_TEST_CASE(lane, tasking_join_test, AssertNoLuaError) 437MAKE_TEST_CASE(lane, tasking_join_test, AssertNoLuaError)
435MAKE_TEST_CASE(lane, tasking_send_receive_code, AssertNoLuaError) 438MAKE_TEST_CASE(lane, tasking_send_receive_code, AssertNoLuaError)
436MAKE_TEST_CASE(lane, stdlib_naming, AssertNoLuaError) 439MAKE_TEST_CASE(lane, stdlib_naming, AssertNoLuaError)
437 440MAKE_TEST_CASE(coro, cancelling_suspended, AssertNoLuaError)
438#if LUA_VERSION_NUM >= 504 // this makes use of to-be-closed variables, a Lua 5.4 feature 441MAKE_TEST_CASE_54(coro, collect_yielded_lane, AssertNoLuaError)
439MAKE_TEST_CASE(coro, collect_yielded_lane, AssertNoLuaError)
440#endif // LUA_VERSION_NUM
441#if LUAJIT_FLAVOR() == 0 442#if LUAJIT_FLAVOR() == 0
442// TODO: for some reason, the test fails with LuaJIT. To be investigated 443// TODO: for some reason, the test fails with LuaJIT. To be investigated
443MAKE_TEST_CASE(coro, error_handling, AssertNoLuaError) 444MAKE_TEST_CASE(coro, error_handling, AssertNoLuaError)
444#endif // LUAJIT_FLAVOR() 445#endif // LUAJIT_FLAVOR()
446MAKE_TEST_CASE(coro, index_suspended, AssertNoLuaError)
447MAKE_TEST_CASE(coro, join_suspended, AssertNoLuaError)
448MAKE_TEST_CASE_54(coro, linda_in_close_handler, AssertNoLuaError)
445MAKE_TEST_CASE(coro, regular_function, AssertNoLuaError) 449MAKE_TEST_CASE(coro, regular_function, AssertNoLuaError)
446MAKE_TEST_CASE(coro, yielding_function, AssertNoLuaError) 450MAKE_TEST_CASE(coro, resume_basics, AssertNoLuaError)
451MAKE_TEST_CASE(coro, yielding_in_non_coro_errors, AssertNoLuaError)
447 452
448/* 453/*
449TEST_CASE("lanes.scripted_tests") 454TEST_CASE("lanes.scripted_tests")