diff --git a/ueforth/Makefile b/ueforth/Makefile index f6dadcd..49a18bd 100644 --- a/ueforth/Makefile +++ b/ueforth/Makefile @@ -87,11 +87,14 @@ LINK64 = "$(shell $(LSQ) ${MSVS}/*/*/VC/Tools/MSVC/*/bin/Hostx86/x64/link.exe | RC32 = "$(shell $(LSQ) ${MSKITS}/*/bin/*/x86/rc.exe | head -n 1)" RC64 = "$(shell $(LSQ) ${MSKITS}/*/bin/*/x64/rc.exe | head -n 1)" +UNIT_TESTS = unit_tests_posix + # Selectively enable windows if tools available DEPLOYABLE := 1 ifneq ("", $(CL32)) ifneq ("", $(RC32)) TARGETS += $(WINDOWS)/uEf32.exe + UNIT_TESTS += unit_tests_win32 else $(warning "Missing Visual Studio rc.exe skipping 32-bit Windows.") DEPLOYABLE := 0 @@ -103,6 +106,7 @@ endif ifneq ("", $(CL64)) ifneq ("", $(RC64)) TARGETS += $(WINDOWS)/uEf64.exe + UNIT_TESTS += unit_tests_win64 else $(warning "Missing Visual Studio rc.exe skipping 64-bit Windows.") DEPLOYABLE := 0 @@ -129,9 +133,17 @@ clean: tests: unit_tests see_all_test -unit_tests: $(POSIX)/ueforth common/all_tests.fs +unit_tests: $(UNIT_TESTS) + +unit_tests_posix: $(POSIX)/ueforth common/all_tests.fs $^ +unit_tests_win32: $(WINDOWS)/uEf32.exe common/all_tests.fs + wine $^ + +unit_tests_win64: $(WINDOWS)/uEf64.exe common/all_tests.fs + wine $^ + see_all_test: $(POSIX)/ueforth echo \ also internals \ diff --git a/ueforth/common/desktop.fs b/ueforth/common/desktop.fs index 132a2eb..14009e1 100644 --- a/ueforth/common/desktop.fs +++ b/ueforth/common/desktop.fs @@ -1,4 +1,4 @@ -\ Copyright 2021 Bradley D. Nelson +\ Copyright 2022 Bradley D. Nelson \ \ Licensed under the Apache License, Version 2.0 (the "License"); \ you may not use this file except in compliance with the License. diff --git a/ueforth/common/float_tests.fs b/ueforth/common/float_tests.fs index 12b68d5..8bf38ef 100644 --- a/ueforth/common/float_tests.fs +++ b/ueforth/common/float_tests.fs @@ -71,10 +71,10 @@ e: test-fconstant e: test-fvariable fvariable foo - 100e foo sf! + 10e foo sf! foo sf@ fdup f* foo sf! foo sf@ f. cr - out: 10000.000000 + out: 100.000000 ;e e: test-fcompare diff --git a/ueforth/common/testing.fs b/ueforth/common/testing.fs index 781bc8f..8a65511 100644 --- a/ueforth/common/testing.fs +++ b/ueforth/common/testing.fs @@ -12,7 +12,14 @@ \ See the License for the specific language governing permissions and \ limitations under the License. -also ansi also posix +also ansi + +DEFINED? windows [IF] + also windows + : sysexit ( n -- ) ExitProcess ; +[ELSE] + also posix +[THEN] ( Support for eval tests ) 1000 constant expect-limit