diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-03-23 08:10:49 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-03-23 08:10:49 +0100 |
| commit | 754012dd458985a6a4953c99204c6651318892b2 (patch) | |
| tree | 3c654198ae6704137d6da8f9396f3e8970630ea0 /libs/kstd/tests/os_mock.cpp | |
| parent | c9ce8625dd80f701e280f90cb30c30f8663473e9 (diff) | |
| download | teachos-754012dd458985a6a4953c99204c6651318892b2.tar.xz teachos-754012dd458985a6a4953c99204c6651318892b2.zip | |
testing: enable build-host testing
Diffstat (limited to 'libs/kstd/tests/os_mock.cpp')
| -rw-r--r-- | libs/kstd/tests/os_mock.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libs/kstd/tests/os_mock.cpp b/libs/kstd/tests/os_mock.cpp new file mode 100644 index 0000000..39b7f0d --- /dev/null +++ b/libs/kstd/tests/os_mock.cpp @@ -0,0 +1,15 @@ +#include <exception> +#include <format> +#include <source_location> +#include <stdexcept> +#include <string_view> + +namespace kstd::os +{ + auto panic(std::string_view message, std::source_location location) + { + auto full_message = + std::format("OS Panic Handler called '{}' at {}:{}", message, location.file_name(), location.line()); + throw std::runtime_error{full_message}; + } +} // namespace kstd::os
\ No newline at end of file |
