diff options
Diffstat (limited to 'unit_tests/lane_tests.cpp')
| -rw-r--r-- | unit_tests/lane_tests.cpp | 25 |
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) \ |
| 416 | TEST_CASE("scripted_tests." #DIR "." #FILE) \ | 416 | TEST_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 | |||
| 422 | MAKE_TEST_CASE(lane, body_is_a_c_function, AssertNoLuaError) | 428 | MAKE_TEST_CASE(lane, body_is_a_c_function, AssertNoLuaError) |
| 423 | MAKE_TEST_CASE(lane, cooperative_shutdown, AssertNoLuaError) | 429 | MAKE_TEST_CASE(lane, cooperative_shutdown, AssertNoLuaError) |
| 424 | #if LUA_VERSION_NUM >= 504 // warnings are a Lua 5.4 feature | 430 | MAKE_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 | ||
| 426 | MAKE_TEST_CASE(lane, uncooperative_shutdown, AssertWarns) | ||
| 427 | #endif // LUA_VERSION_NUM | ||
| 428 | MAKE_TEST_CASE(lane, tasking_basic, AssertNoLuaError) | 431 | MAKE_TEST_CASE(lane, tasking_basic, AssertNoLuaError) |
| 429 | MAKE_TEST_CASE(lane, tasking_cancelling_with_hook, AssertNoLuaError) | 432 | MAKE_TEST_CASE(lane, tasking_cancelling_with_hook, AssertNoLuaError) |
| 430 | MAKE_TEST_CASE(lane, tasking_cancelling, AssertNoLuaError) | 433 | MAKE_TEST_CASE(lane, tasking_cancelling, AssertNoLuaError) |
| @@ -434,16 +437,18 @@ MAKE_TEST_CASE(lane, tasking_error, AssertNoLuaError) | |||
| 434 | MAKE_TEST_CASE(lane, tasking_join_test, AssertNoLuaError) | 437 | MAKE_TEST_CASE(lane, tasking_join_test, AssertNoLuaError) |
| 435 | MAKE_TEST_CASE(lane, tasking_send_receive_code, AssertNoLuaError) | 438 | MAKE_TEST_CASE(lane, tasking_send_receive_code, AssertNoLuaError) |
| 436 | MAKE_TEST_CASE(lane, stdlib_naming, AssertNoLuaError) | 439 | MAKE_TEST_CASE(lane, stdlib_naming, AssertNoLuaError) |
| 437 | 440 | MAKE_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 | 441 | MAKE_TEST_CASE_54(coro, collect_yielded_lane, AssertNoLuaError) |
| 439 | MAKE_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 |
| 443 | MAKE_TEST_CASE(coro, error_handling, AssertNoLuaError) | 444 | MAKE_TEST_CASE(coro, error_handling, AssertNoLuaError) |
| 444 | #endif // LUAJIT_FLAVOR() | 445 | #endif // LUAJIT_FLAVOR() |
| 446 | MAKE_TEST_CASE(coro, index_suspended, AssertNoLuaError) | ||
| 447 | MAKE_TEST_CASE(coro, join_suspended, AssertNoLuaError) | ||
| 448 | MAKE_TEST_CASE_54(coro, linda_in_close_handler, AssertNoLuaError) | ||
| 445 | MAKE_TEST_CASE(coro, regular_function, AssertNoLuaError) | 449 | MAKE_TEST_CASE(coro, regular_function, AssertNoLuaError) |
| 446 | MAKE_TEST_CASE(coro, yielding_function, AssertNoLuaError) | 450 | MAKE_TEST_CASE(coro, resume_basics, AssertNoLuaError) |
| 451 | MAKE_TEST_CASE(coro, yielding_in_non_coro_errors, AssertNoLuaError) | ||
| 447 | 452 | ||
| 448 | /* | 453 | /* |
| 449 | TEST_CASE("lanes.scripted_tests") | 454 | TEST_CASE("lanes.scripted_tests") |
