In the middle of porting core:testing

This commit is contained in:
Jeroen van Rijn
2025-10-28 19:01:25 +01:00
parent 39eba452bf
commit 46489a1cd5
25 changed files with 288 additions and 75 deletions

View File

@@ -20,7 +20,7 @@ import "core:io"
@require import "core:log"
import "core:math/rand"
import "core:mem"
import "core:os"
import os "core:os/os2"
import "core:slice"
@require import "core:strings"
import "core:sync/chan"
@@ -216,8 +216,8 @@ runner :: proc(internal_tests: []Internal_Test) -> bool {
}
}
stdout := io.to_writer(os.stream_from_handle(os.stdout))
stderr := io.to_writer(os.stream_from_handle(os.stderr))
stdout := os.stdout.stream
stderr := os.stderr.stream
// The animations are only ever shown through STDOUT;
// STDERR is used exclusively for logging regardless of error level.
@@ -314,7 +314,7 @@ runner :: proc(internal_tests: []Internal_Test) -> bool {
// -- Set thread count.
when TEST_THREADS == 0 {
thread_count := os.processor_core_count()
thread_count := os.get_processor_core_count()
} else {
thread_count := max(1, TEST_THREADS)
}

View File

@@ -10,11 +10,11 @@ package testing
Feoramund: Total rewrite.
*/
import "base:intrinsics"
import "core:c/libc"
import "core:os"
import "core:sync"
import "core:terminal/ansi"
import "base:intrinsics"
import "core:c/libc"
import os "core:os/os2"
import "core:sync"
import "core:terminal/ansi"
@(private="file") stop_runner_flag: libc.sig_atomic_t