Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ASWLog is a thread-safe, dependency-free C++20 logging library for Windows and L
- `ASWLog/` contains the framework implementation.
- `tests/` contains the unit tests: test modules (`Test_ASWLog_<Unit>`, the tests of `ASWLog_<Unit>`) and shared test helpers (`UT_Helper_<Topic>`, e.g. `UT_Helper_DateTime`) in `tests/tests/`, their CMake project in `tests/cmake/`, their RAD Studio console project in `tests/rad370/`, and their RAD Studio VCL GUI runner project in `tests/vcl/gui/rad370/` (built from the submodule's `vcl/gui/src`). `tests/compile_checks/` holds "must not compile" checks, which `tests/cmake/CMakeLists.txt` runs with `try_compile` when configuring (a failed check stops the configure). `tests/package/` is a project that builds against an installed ASWLog with `find_package` (CI installs the library and runs it).
- `CMakeLists.txt` (the root) defines the `ASWLog::ASWLog` library target and its install rules; `cmake/ASWLogConfig.cmake.in` is the template of the installed package file. The project version is read from `ASWLog/ASWLog_Version.h`.
- `third_party/asw-unit-tests/` is the ASWUnitTests framework, a git submodule pinned to a release tag. Never edit files in it; test modules self-register with `ASW_REGISTER_TEST_GROUP`, so adding a test only touches `tests/` and its build files. Each test group derives from `TAutoTestGroup<itself>`, so a new test is defined with `ASW_TEST(ClassName, TestName)` in the group's `.cpp` and declared as a public `Test_TestName()` method in its header, with no `RegisterTest()` call.
- `third_party/asw-unit-tests/` is the ASWUnitTests framework, a git submodule pinned to a release tag. Never edit files in it; test modules self-register with `ASW_REGISTER_TEST_GROUP`, so adding a test only touches `tests/` and its build files. Each test group derives from `TAutoTestGroup<itself>`, so a new test is defined with `ASW_TEST(ClassName, TestName)` in the group's `.cpp` and declared as a public `Test_TestName()` method in its header, with no `RegisterTest()` call. The test groups of loggers that write entries somewhere (the sinks, e.g. `TASWFileLog`, `TASWConsoleLog`, `TASWNullLog`) register with `ASW_REGISTER_TEST_GROUP_IN_SUITE(ClassName, "Sinks")`, so `--filter "Sinks.*"` runs them all; loggers that pass entries on to others (`TASWMultiLog`, `TASWCategoryLog`) and the other test groups aren't in a suite.
- `.github/workflows/ci.yml` builds and runs the unit tests on Windows (MSVC, MinGW) and Linux (GCC, Clang), plus Linux Clang builds with ThreadSanitizer and with AddressSanitizer + UBSan (`ASWLOG_SANITIZE`); the non-sanitizer jobs also check the installed CMake package (`tests/package/`). A Linux GCC coverage job (informational, it never fails the run) shows the library's line coverage on its summary page and uploads an HTML report.
- `example/` contains example app that uses the logger.
- `example/rad370/` contains the RAD Studio 13.1 project and Windows build scripts.
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/Test_ASWLog_ConsoleLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -830,4 +830,4 @@ ASW_TEST(TTest_ASWLog_ConsoleLog, WarnAndAboveWriteToStdErr)
} // namespace ASWUnitTests

//---------------------------------------------------------------------------
ASW_REGISTER_TEST_GROUP(ASWUnitTests::TTest_ASWLog_ConsoleLog)
ASW_REGISTER_TEST_GROUP_IN_SUITE(ASWUnitTests::TTest_ASWLog_ConsoleLog, "Sinks")
2 changes: 1 addition & 1 deletion tests/tests/Test_ASWLog_DebuggerLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,4 +333,4 @@ ASW_TEST(TTest_ASWLog_DebuggerLog, Windows_WritesTheCrashLineDirectly)
} // namespace ASWUnitTests

//---------------------------------------------------------------------------
ASW_REGISTER_TEST_GROUP(ASWUnitTests::TTest_ASWLog_DebuggerLog)
ASW_REGISTER_TEST_GROUP_IN_SUITE(ASWUnitTests::TTest_ASWLog_DebuggerLog, "Sinks")
2 changes: 1 addition & 1 deletion tests/tests/Test_ASWLog_FileLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3587,4 +3587,4 @@ ASW_TEST(TTest_ASWLog_FileLog, Write_EarlierRecordDoesNotRollLogBack)
} // namespace ASWUnitTests

//---------------------------------------------------------------------------
ASW_REGISTER_TEST_GROUP(ASWUnitTests::TTest_ASWLog_FileLog)
ASW_REGISTER_TEST_GROUP_IN_SUITE(ASWUnitTests::TTest_ASWLog_FileLog, "Sinks")
2 changes: 1 addition & 1 deletion tests/tests/Test_ASWLog_MemoryLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,4 +360,4 @@ ASW_TEST(TTest_ASWLog_MemoryLog, Threads_ReaderGetsEveryLineOnce)
} // namespace ASWUnitTests

//---------------------------------------------------------------------------
ASW_REGISTER_TEST_GROUP(ASWUnitTests::TTest_ASWLog_MemoryLog)
ASW_REGISTER_TEST_GROUP_IN_SUITE(ASWUnitTests::TTest_ASWLog_MemoryLog, "Sinks")
2 changes: 1 addition & 1 deletion tests/tests/Test_ASWLog_NullLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,4 +256,4 @@ ASW_TEST(TTest_ASWLog_NullLog, Wrapped_WritesNothing)
} // namespace ASWUnitTests

//---------------------------------------------------------------------------
ASW_REGISTER_TEST_GROUP(ASWUnitTests::TTest_ASWLog_NullLog)
ASW_REGISTER_TEST_GROUP_IN_SUITE(ASWUnitTests::TTest_ASWLog_NullLog, "Sinks")
2 changes: 1 addition & 1 deletion tests/tests/Test_ASWLog_SyslogLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,4 +437,4 @@ ASW_TEST(TTest_ASWLog_SyslogLog, ShouldLog_FollowsThePlatform)
} // namespace ASWUnitTests

//---------------------------------------------------------------------------
ASW_REGISTER_TEST_GROUP(ASWUnitTests::TTest_ASWLog_SyslogLog)
ASW_REGISTER_TEST_GROUP_IN_SUITE(ASWUnitTests::TTest_ASWLog_SyslogLog, "Sinks")
2 changes: 1 addition & 1 deletion tests/tests/Test_ASWLog_WindowsEventLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -626,4 +626,4 @@ ASW_TEST(TTest_ASWLog_WindowsEventLog, Windows_ReportsARefusedEvent)
} // namespace ASWUnitTests

//---------------------------------------------------------------------------
ASW_REGISTER_TEST_GROUP(ASWUnitTests::TTest_ASWLog_WindowsEventLog)
ASW_REGISTER_TEST_GROUP_IN_SUITE(ASWUnitTests::TTest_ASWLog_WindowsEventLog, "Sinks")
6 changes: 6 additions & 0 deletions tests/vcl/gui/rad370/ASWLogTests_VCL_GUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ int WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, int)

// The form outlives Run(); Application frees it later, during shutdown.
exitCode = FormASWUnitTestsGUIMain->ExitCode();

// After a timeout, the abandoned test's thread may still be running, using one of the form's test groups,
// and after a crash their state may be corrupted, so the process ends here, as the console runner's does,
// without destroying them. The layout and selection were saved as the window closed.
if (FormASWUnitTestsGUIMain->WasRunAborted())
ExitProcess(static_cast<UINT>(exitCode));
}
catch (Exception& exception)
{
Expand Down
2 changes: 1 addition & 1 deletion third_party/asw-unit-tests
Submodule asw-unit-tests updated 50 files
+1 −1 AGENTS.md
+133 −1 CHANGELOG.md
+4 −0 Deploy.bat
+105 −18 README.md
+1 −0 cmake/CMakeLists.txt
+4 −0 rad370/ASWUnitTests.cbproj
+22 −18 src/ASWUnitTests_CLI.cpp
+34 −0 src/ASWUnitTests_Console.cpp
+5 −0 src/ASWUnitTests_Console.h
+19 −0 src/ASWUnitTests_CrashGuard.cpp
+25 −0 src/ASWUnitTests_Exception.cpp
+29 −0 src/ASWUnitTests_Exception.h
+380 −59 src/ASWUnitTests_Handler.cpp
+46 −1 src/ASWUnitTests_Handler.h
+2 −1 src/ASWUnitTests_JUnitReport.cpp
+2 −2 src/ASWUnitTests_JUnitReport.h
+3 −2 src/ASWUnitTests_Registry.cpp
+40 −10 src/ASWUnitTests_Registry.h
+780 −28 src/ASWUnitTests_TestBase.cpp
+229 −7 src/ASWUnitTests_TestBase.h
+2 −2 src/ASWUnitTests_Version.h
+16 −9 src/main.cpp
+4 −2 tests/Test_ASWTools_Random.cpp
+1 −1 tests/Test_ASWTools_String.cpp
+15 −2 tests/Test_ASWUnitTests_CLI.cpp
+43 −0 tests/Test_ASWUnitTests_Console.cpp
+2 −0 tests/Test_ASWUnitTests_Console.h
+74 −8 tests/Test_ASWUnitTests_CrashGuard.cpp
+1 −0 tests/Test_ASWUnitTests_CrashGuard.h
+508 −0 tests/Test_ASWUnitTests_Handler.cpp
+8 −0 tests/Test_ASWUnitTests_Handler.h
+48 −0 tests/Test_ASWUnitTests_JUnitReport.cpp
+1 −0 tests/Test_ASWUnitTests_JUnitReport.h
+623 −0 tests/Test_ASWUnitTests_Suite.cpp
+75 −0 tests/Test_ASWUnitTests_Suite.h
+628 −28 tests/Test_ASWUnitTests_TestBase.cpp
+5 −0 tests/Test_ASWUnitTests_TestBase.h
+4 −0 vcl/console/rad370/ASWUnitTests_VCL_Console.cbproj
+4 −0 vcl/gui/rad370/ASWUnitTests_VCL_GUI.cbproj
+6 −0 vcl/gui/rad370/ASWUnitTests_VCL_GUI.cpp
+213 −86 vcl/gui/src/ASWUnitTests_GUI_MainForm.cpp
+19 −0 vcl/gui/src/ASWUnitTests_GUI_MainForm.dfm
+24 −11 vcl/gui/src/ASWUnitTests_GUI_MainForm.h
+166 −60 vcl/gui/src/ASWUnitTests_GUI_TestList.cpp
+40 −3 vcl/gui/src/ASWUnitTests_GUI_TestList.h
+1 −1 vcl/tests/Test_ASWUnitTests_GUI_Shuffle.cpp
+173 −0 vcl/tests/Test_ASWUnitTests_GUI_TestList.cpp
+8 −0 vcl/tests/Test_ASWUnitTests_GUI_TestList.h
+100 −8 vcl/tests/Test_ASWUnitTests_RTLExceptions.cpp
+1 −0 vcl/tests/Test_ASWUnitTests_RTLExceptions.h
Loading