aboutsummaryrefslogtreecommitdiff
path: root/core/testing
diff options
context:
space:
mode:
authorFeoramund <161657516+Feoramund@users.noreply.github.com>2025-05-21 07:49:08 -0400
committerFeoramund <161657516+Feoramund@users.noreply.github.com>2025-05-21 07:49:08 -0400
commite659df1a3f1b57ee67600cdacf75e672d8cd3d9b (patch)
tree3cc22b75458daae5f73632cf62c254a3e5c70e60 /core/testing
parentb6f1821bbabbb711724d309e4c62d4c866d44c67 (diff)
Restructure `core:terminal` for better Windows support
Diffstat (limited to 'core/testing')
-rw-r--r--core/testing/runner.odin8
-rw-r--r--core/testing/runner_windows.odin36
2 files changed, 0 insertions, 44 deletions
diff --git a/core/testing/runner.odin b/core/testing/runner.odin
index a184eb28c..56d561d3d 100644
--- a/core/testing/runner.odin
+++ b/core/testing/runner.odin
@@ -214,10 +214,6 @@ runner :: proc(internal_tests: []Internal_Test) -> bool {
}
}
- when ODIN_OS == .Windows {
- console_ansi_init()
- }
-
stdout := io.to_writer(os.stream_from_handle(os.stdout))
stderr := io.to_writer(os.stream_from_handle(os.stderr))
@@ -981,9 +977,5 @@ To partly mitigate this, redirect STDERR to a file or use the -define:ODIN_TEST_
fmt.assertf(err == nil, "Error writing JSON report: %v", err)
}
- when ODIN_OS == .Windows {
- console_ansi_fini()
- }
-
return total_success_count == total_test_count
}
diff --git a/core/testing/runner_windows.odin b/core/testing/runner_windows.odin
deleted file mode 100644
index b35914c72..000000000
--- a/core/testing/runner_windows.odin
+++ /dev/null
@@ -1,36 +0,0 @@
-#+private
-package testing
-
-import win32 "core:sys/windows"
-
-old_stdout_mode: u32
-old_stderr_mode: u32
-
-console_ansi_init :: proc() {
- stdout := win32.GetStdHandle(win32.STD_OUTPUT_HANDLE)
- if stdout != win32.INVALID_HANDLE && stdout != nil {
- if win32.GetConsoleMode(stdout, &old_stdout_mode) {
- win32.SetConsoleMode(stdout, old_stdout_mode | win32.ENABLE_VIRTUAL_TERMINAL_PROCESSING)
- }
- }
-
- stderr := win32.GetStdHandle(win32.STD_ERROR_HANDLE)
- if stderr != win32.INVALID_HANDLE && stderr != nil {
- if win32.GetConsoleMode(stderr, &old_stderr_mode) {
- win32.SetConsoleMode(stderr, old_stderr_mode | win32.ENABLE_VIRTUAL_TERMINAL_PROCESSING)
- }
- }
-}
-
-// Restore the cursor on exit
-console_ansi_fini :: proc() {
- stdout := win32.GetStdHandle(win32.STD_OUTPUT_HANDLE)
- if stdout != win32.INVALID_HANDLE && stdout != nil {
- win32.SetConsoleMode(stdout, old_stdout_mode)
- }
-
- stderr := win32.GetStdHandle(win32.STD_ERROR_HANDLE)
- if stderr != win32.INVALID_HANDLE && stderr != nil {
- win32.SetConsoleMode(stderr, old_stderr_mode)
- }
-} \ No newline at end of file