Skip to content

Commit 57ccc1a

Browse files
author
Stefan Reinauer
committed
update testsuite to 1.0.2
git-svn-id: svn://coreboot.org/openbios/fcode-utils@107 f158a5a8-5612-0410-a976-696ce0be7e32
1 parent 1773b2e commit 57ccc1a

32 files changed

Lines changed: 710 additions & 333 deletions

testsuite/TokBrack/TestArgs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
# Lines that have no label, no switches, and no script
1111
# do not need any commas.
1212

13-
# Updated Wed, 08 Mar 2006 at 19:11 PST by David L. Paktor
13+
# Updated Wed, 11 Oct 2006 at 24:44 PDT by David L. Paktor
1414

1515
# Might as well get the date-and-time one out of the way first...
1616
TokBrkTst_02 , , -i -l
1717
TokBrkTst_01 , , -i
1818
TokBrkTst_01 , alwyshdr , -i -f ALWays-heADers
1919
TokBrkTst_03
2020
TokBrkErrTst_01 , , -i
21+
TokBrkTst_04 , , -i -T pele_yoetz_ne-ema-an_anochi_hu_ha-omer_v-oseh_v-ain_c-moni_bchol_ha_aretz -T whatsis
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
\ Test of long names and duplication of names and maybe Tracing
2+
\ Updated Wed, 18 Oct 2006 at 13:34 PDT by David L. Paktor
3+
4+
fcode-version2
5+
6+
global-definitions
7+
8+
true constant flunky?
9+
10+
alias whoosis whatsis
11+
alias whatsis whoosis
12+
13+
external
14+
decimal
15+
16+
100 constant pele_yoetz_ne-ema-an_anochi_hu_ha-omer_v-oseh_v-ain_c-moni_bchol_ha_aretz
17+
18+
device-definitions
19+
20+
headers
21+
22+
h# 3760 constant whatsis
23+
24+
#message" Sync Up Diffs w/ prev. release."n"
25+
alias whoosis pele_yoetz_ne-ema-an_anochi_hu_ha-omer_v-oseh_v-ain_c-moni_bchol_ha_aretz
26+
#message"
27+
Sync Up again."n"
28+
headerless
29+
: pele_yoetz_ne-ema-an_anochi_hu_ha-omer_v-oseh_v-ain_c-moni_bchol_ha_aretz
30+
100
31+
;
32+
pele_yoetz_ne-ema-an_anochi_hu_ha-omer_v-oseh_v-ain_c-moni_bchol_ha_aretz 2 * constant clone
33+
34+
\ Make sure the matching goes all the way...
35+
instance
36+
: pele_yoetz_ne-ema-an_anochi_hu_ha-omer_v-oseh_v-ain_c-moni_bchol_ha_oilum
37+
clone
38+
['] whoosis execute
39+
;
40+
41+
new-device
42+
80 constant this_name_has_a_whole_lot_of_syllables_and_so_would_not_be_a_good_ingredient_in_ice_cream_but_at_least_you_know_what_it_means
43+
44+
headers
45+
f[ 1cec6ea3 constant a_name_with_too_many_letters_should_not_matter_in_tokenizer_escape_mode
46+
]f
47+
48+
: brand-x-ice-cream \ Because it uses ingredients with too many syllables
49+
pele_yoetz_ne-ema-an_anochi_hu_ha-omer_v-oseh_v-ain_c-moni_bchol_ha_aretz dup 20 - do i . loop cr
50+
." Nameless one..." this_name_has_a_whole_lot_of_syllables_and_so_would_not_be_a_good_ingredient_in_ice_cream_but_at_least_you_know_what_it_means ." equals " . cr
51+
." But everyone likes an "
52+
f[ a_name_with_too_many_letters_should_not_matter_in_tokenizer_escape_mode
53+
f] fliteral .
54+
clone . cr
55+
;
56+
57+
flunky? if
58+
d# 3760 constant whatsis
59+
else
60+
d# 374 constant whatsis
61+
then
62+
63+
64+
finish-device
65+
66+
overload : clone
67+
pele_yoetz_ne-ema-an_anochi_hu_ha-omer_v-oseh_v-ain_c-moni_bchol_ha_aretz
68+
pele_yoetz_ne-ema-an_anochi_hu_ha-omer_v-oseh_v-ain_c-moni_bchol_ha_oilum
69+
whatsis
70+
whoosis
71+
;
72+
73+
end0
74+
75+
76+

testsuite/TokCondl/CondMacAlias_01.fth

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
f[ ." Let's try some spurious [else] action, whaddya say?" ]f
7777
: [else] ." Don't do it" ; [message] Fake [else] got through
7878
create [else] [message] Fake [else] got through
79-
h# defeca8e constant [else] [message] Fake [else] got through
79+
h# DeFeCA8e constant [else] [message] Fake [else] got through
8080
h# -41100132 value [else] [message] Fake [else] got through
8181
d# 64 buffer: [else] [message] Fake [else] got through
8282
struct

testsuite/TokCondl/TestArgs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# Lines that have no label, no switches, and no script
1111
# do not need any commas.
1212

13-
# Updated Thu, 27 Jul 2006 at 15:20 PDT by David L. Paktor
13+
# Updated Fri, 13 Oct 2006 at 16:19 PDT by David L. Paktor
1414

1515
TokExstCondTstY , , -l
1616
TokExstCondTstN , , -l

testsuite/TokMisc/AllBiFCTypes.fth

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
\ Test all the known Built-In FCode tokens
22
\ that have specific definition Types
33

4-
\ Updated Wed, 16 Aug 2006 at 14:30 PDT by David L. Paktor
4+
\ Updated Tue, 10 Oct 2006 at 11:00 PDT by David L. Paktor
55

66
\ Applying "TO" to them ought to generate errors
77
\ except for the ones that legitimately take "TO",
88
\ namely the DEFER and VALUE definitions
99

1010
fcode-version2
1111

12-
1312
[message] Constants. Should generate errors
1413
d# 10 to -1 ( CONST )
1514
d# 10 to -1 ( CONST )
@@ -61,4 +60,12 @@ h# 12 to mask ( VRBLE )
6160
h# 12 to span ( VRBLE )
6261
h# 12 to state ( VRBLE )
6362

63+
multi-line #message" Using ['] on words that are both FWords and FCodes "\
64+
should generate no errors"
65+
['] new-device drop
66+
['] finish-device drop
67+
['] offset16 drop
68+
['] instance drop
69+
['] end0 drop
70+
6471
fcode-end

testsuite/TokMisc/ContErr3.fth

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ repeat
132132
then
133133
loop
134134

135-
#message" Same line as a loop" ." ...Same line as a loop"
136-
135+
#message"
136+
Same line as a loop" ." ...Same line as a loop"
137137
4 0 do i test_something if to targ : runny_stuff begin
138138
1 0 do targ u. #message" Error here, too..." j
139139
#message" But not here either" 1 0 do j . loop

testsuite/TokMisc/DtkVSFcTst.scr

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#! /bin/csh -f
2+
#
3+
# Script to run detokenizer with Vendor-Specific FCodes.
4+
# This worked just fine on the TestArgs command line, in the "script" field
5+
# on CygWin and GNU_Linux, but gets jammed-up on AI
6+
# So we have to pump it into a separate script. Fooey!
7+
#
8+
# Well, in for a penny and all that...X
9+
# Let's make it a bit more general.
10+
# First param is the base-name of both the input .fc file
11+
# and the output .DeTok file
12+
# Second param is the name of the Vendor-Specific FCodes file
13+
14+
# If it's already a script, might as well error-check
15+
alias onecr 'echo "" ; alias onecr true'
16+
if ( $#argv < 1 ) then
17+
onecr
18+
echo $0 Missing First arg, Base-name of input .fc and output .DeTok files
19+
set ERROR
20+
endif
21+
if ( $#argv < 2 ) then
22+
onecr
23+
echo $0 Missing Second arg, Name of the Vendor-Specific FCodes file
24+
set ERROR
25+
endif
26+
if ( $?ERROR ) exit 1
27+
28+
if ( ! -r $1.fc ) then
29+
onecr
30+
echo $0 Cannot read input file $1.fc
31+
set ERROR
32+
endif
33+
if ( ! -r $2 ) then
34+
onecr
35+
echo $0 Cannot read Vendor-Specific FCodes file $2
36+
set ERROR
37+
endif
38+
if ( $?ERROR ) exit 2
39+
40+
41+
../detok -v -o -f $2 $1.fc > $1.DeTok

testsuite/TokMisc/MiscFeatures.DOS.fth

Lines changed: 80 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
\ Obvious pun intended...
2-
\ Updated Tue, 31 May 2005 at 12:07 by David L. Paktor
3-
2+
\ Updated Tue, 17 Oct 2006 at 12:57 PDT by David L. Paktor
43

54
alias // \
65
fcode-version2
@@ -12,21 +11,41 @@ headers
1211
char G emit
1312
control G emit
1413
control [ emit
14+
global-definitions
15+
\ Each dev-node will create its own debug-flag and alias it to debug-me?
16+
\ Each dev-node will create a macro called my-dev-name giving its device-name
17+
[macro] .fname&dev [function-name] type ." in " my-dev-name type
18+
[macro] name-my-dev my-dev-name device-name
19+
[macro] .dbg-enter debug-me? @ if ." Entering " .fname&dev cr then
20+
[macro] .dbg-leave debug-me? @ if ." Leaving " .fname&dev cr then
21+
device-definitions
22+
23+
\ Top-most device, named billy
24+
[macro] my-dev-name " billy"
25+
name-my-dev
26+
27+
variable debug-bell? debug-bell? off alias debug-me? debug-bell?
1528
: bell
29+
.dbg-enter
1630
[char] G dup
1731
control G 3drop
32+
.dbg-leave
1833
;
1934

2035
: factl recursive ( n -- n! )
36+
." Entering First vers. of " [function-name] type cr
2137
?dup 0= if 1
22-
else dup 1- * factl
38+
else dup 1- factl *
2339
then
40+
." Leaving First vers. of " [function-name] type cr
2441
;
2542

2643
: factl ( n -- n! )
44+
." Entering Second vers. of " [function-name] type cr
2745
?dup 0= if 1 factl
2846
else dup 1- recurse *
2947
then
48+
." Leaving Second vers. of " [function-name] type cr
3049
;
3150

3251
variable naught
@@ -41,31 +60,88 @@ struct
4160
constant /four
4261

4362
: peril
63+
.dbg-enter
4464
['] noop is do-nothing
4565
100 is thirty
4666
5 is naught
4767
thirty dup - abort" Never Happen"
68+
.dbg-leave
4869
;
4970

5071
: thirty ( new-val -- )
72+
.dbg-enter
5173
dup to thirty
5274
alias .dec .d \ Should this be allowed?
5375
." Dirty" .dec
76+
.dbg-leave
5477
;
5578
tokenizer[
5679
alias fliteral1 fliteral // This should be a harmless remark.
5780
h# deadc0de ]tokenizer fliteral1
5881

82+
\ First subsidiary device, "child" of billy
83+
new-device
84+
instance variable cheryl
85+
[macro] my-dev-name " cheryl"
86+
name-my-dev
87+
88+
instance
89+
\ Third-level device, "grandchild" of billy
90+
new-device
91+
[macro] my-dev-name " meryl"
92+
name-my-dev
93+
94+
variable beryl
95+
96+
variable debug-meryl? debug-meryl? off
97+
alias debug-me? debug-meryl?
98+
: meryl
99+
.dbg-enter
100+
cheryl
101+
alias .deck .dec
102+
alias feral cheryl
103+
alias .heck .h
104+
.dbg-leave
105+
;
106+
finish-device
107+
108+
\ Now we're back to "cheryl"
109+
110+
variable debug-cheryl? debug-cheryl? off
111+
alias debug-me? debug-cheryl?
112+
: queryl
113+
.dbg-enter
114+
over rot dup nip drop swap \ Not the most useful code... ;-}
115+
.dbg-leave
116+
;
117+
finish-device
118+
119+
\ Some interpretation-time after the fact markers...
120+
alias colon :
121+
overload [macro] : ." Cleared " [input-file-name] type ." line " [line-number] .d cr colon
122+
123+
alias semicolon ;
124+
overload [macro] ; semicolon ." Finished defining " [function-name] type cr
125+
126+
\ And we're back to billy.
59127
: droop ( -- )
128+
.dbg-enter \ This will display Entering droop in billy
60129
twenty
61130
tokenizer[
62131
alias .x .h \ Should this generate a warning?
132+
[function-name]
63133
]tokenizer
64134
0 ?do i .x loop
65-
;
135+
.dbg-leave
136+
; f[ [function-name] ]f
137+
headerless
66138
: ploop ( -- )
139+
.dbg-enter
67140
fifty 0 do i drop 2 +loop
141+
.dbg-leave
68142
;
143+
overload alias : colon
144+
overload alias ; semicolon
69145

70146
fcode-end
71147

testsuite/TokMisc/MiscFeatures.fth

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
\ Obvious pun intended...
2-
\ Updated Fri, 10 Feb 2006 at 15:53 PST by David L. Paktor
2+
\ Updated Tue, 17 Oct 2006 at 12:57 PDT by David L. Paktor
33

44
alias // \
55
fcode-version2
@@ -116,22 +116,32 @@ new-device
116116
;
117117
finish-device
118118

119+
\ Some interpretation-time after the fact markers...
120+
alias colon :
121+
overload [macro] : ." Cleared " [input-file-name] type ." line " [line-number] .d cr colon
122+
123+
alias semicolon ;
124+
overload [macro] ; semicolon ." Finished defining " [function-name] type cr
125+
119126
\ And we're back to billy.
120127
: droop ( -- )
121128
.dbg-enter \ This will display Entering droop in billy
122129
twenty
123130
tokenizer[
124131
alias .x .h \ Should this generate a warning?
132+
[function-name]
125133
]tokenizer
126134
0 ?do i .x loop
127135
.dbg-leave
128-
;
136+
; f[ [function-name] ]f
129137
headerless
130138
: ploop ( -- )
131139
.dbg-enter
132140
fifty 0 do i drop 2 +loop
133141
.dbg-leave
134142
;
143+
overload alias : colon
144+
overload alias ; semicolon
135145

136146
fcode-end
137147

0 commit comments

Comments
 (0)