From b8f4a7b3c440bb2dd440dff0ffde59d92e46a3f5 Mon Sep 17 00:00:00 2001 From: Brad Nelson Date: Sun, 31 Dec 2023 23:00:11 -0800 Subject: [PATCH] Refine. --- common/testing.fs | 16 ++++++++++++++-- posix/posix.fs | 1 + windows/BUILD | 4 ++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/common/testing.fs b/common/testing.fs index 279074c..bf75531 100644 --- a/common/testing.fs +++ b/common/testing.fs @@ -87,8 +87,20 @@ variable tests-found variable tests-run variable tests-passed : check-fresh depth if }confirm ." DEPTH LEAK! " depth . 1 throw then fdepth if }confirm ." FDEPTH LEAK! " fdepth . 1 throw then ; : wrap-test ( xt -- ) expect-reset >r check-fresh r> execute check-fresh expect-finish ; -: red 1 fg ; : green 2 fg ; : hr 40 for [char] - emit next cr ; -: replace-line 13 emit clear-to-eol ; +: red ; : green ; : replace-line cr ; : old-normal normal ; : normal ; +DEFINED? posix [IF] + also posix stdout isatty previous [IF] + : red 1 fg ; : green 2 fg ; + : replace-line 13 emit clear-to-eol ; + : normal old-normal ; + [THEN] +[THEN] +DEFINED? windows [IF] + : red 1 fg ; : green 2 fg ; + : replace-line 13 emit clear-to-eol ; + : normal old-normal ; +[THEN] +: hr 40 for [char] - emit next cr ; : label-test ( xt -- ) replace-line >name type ; : run-test ( xt -- ) dup label-test only forth confirm{ ['] wrap-test catch }confirm if drop ( cause xt restored on throw ) red ." FAILED" normal cr diff --git a/posix/posix.fs b/posix/posix.fs index 411a3c5..6de4cb4 100644 --- a/posix/posix.fs +++ b/posix/posix.fs @@ -53,6 +53,7 @@ z" free" 1 sysfunc sysfree z" realloc" 2 sysfunc realloc z" usleep" 1 sysfunc usleep z" signal" 2 sysfunc signal +z" isatty" 1 sysfunc isatty ( Processes ) z" fork" 0 sysfunc fork diff --git a/windows/BUILD b/windows/BUILD index e9ef4c1..6100738 100644 --- a/windows/BUILD +++ b/windows/BUILD @@ -23,7 +23,7 @@ Importation('gen/windows_boot_extra.h', '$src/windows/windows_boot_extra.fs', # Compile Win32. Alias('win32', ' '.join([ ForthTest('tests/win32_all_tests.out', 'windows/uEf32.exe', '$src/common/all_tests.fs', - interp='wine', pool='console'), + interp='wine'), ])) CompileW32('windows/uEf32.obj', '$src/windows/main.c', implicit=['gen/windows_boot.h', 'gen/windows_boot_extra.h']) @@ -33,7 +33,7 @@ LinkW32('windows/uEf32.exe', # Compile Win64. Alias('win64', ' '.join([ ForthTest('tests/win64_all_tests.out', 'windows/uEf64.exe', '$src/common/all_tests.fs', - interp='wine', pool='console'), + interp='wine'), ])) CompileW64('windows/uEf64.obj', '$src/windows/main.c', implicit=['gen/windows_boot.h', 'gen/windows_boot_extra.h'])