Add arg parsing an use in tests.

This commit is contained in:
Brad Nelson
2021-02-01 23:12:59 -08:00
parent 5e6cd74b11
commit 57fb2d49a4
4 changed files with 6 additions and 14 deletions

View File

@ -103,15 +103,10 @@ clean:
# ---- TESTS ----
tests: core_test unit_tests
core_test: $(POSIX)/ueforth common/core_test.fs \
common/core_test.fs.golden
echo "include common/core_test.fs" | $< | \
diff - common/core_test.fs.golden
tests: unit_tests
unit_tests: $(POSIX)/ueforth common/all_tests.fs
echo "include common/all_tests.fs" | $<
$^
# ---- GENERATED ----
@ -121,7 +116,7 @@ $(GEN):
POSIX_BOOT = common/boot.fs common/ansi.fs \
posix/posix.fs posix/posix_highlevel.fs \
common/highlevel.fs common/filetools.fs posix/posix_desktop.fs \
common/tasks.fs common/streams.fs common/blocks.fs
common/tasks.fs common/streams.fs common/blocks.fs posix/args.fs
$(GEN)/posix_boot.h: common/source_to_string.js $(POSIX_BOOT) | $(GEN)
echo "ok" | cat $(POSIX_BOOT) - | $< boot >$@

View File

@ -1,3 +0,0 @@
: test 100 0 do i . loop cr ;
test
bye

View File

@ -1,3 +0,0 @@
uEForth
ok
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99

3
ueforth/posix/args.fs Normal file
View File

@ -0,0 +1,3 @@
( Include first argument if any )
: optional-args argc 2 < if exit then 1 argv included ;
optional-args