Componentize golden files for c64 and c16 forth tests

This commit is contained in:
Philip Zembrod 2020-07-26 15:34:00 +02:00
parent bf4dcca1b4
commit 36321c9c91
10 changed files with 283 additions and 323 deletions

View File

@ -20,7 +20,8 @@ vf_blk_fth: $(vf_blk_fth_files)
clean: clean:
rm -f cbmfiles/*.fr cbmfiles/*.fth cbmfiles/*.log *.log *.result rm -f cbmfiles/*.fr cbmfiles/*.fth cbmfiles/*.log
rm -f *.log *.result *.golden
rm -f cbmfiles/c??-testbase rm -f cbmfiles/c??-testbase
rm -f disks/scratch.d64 rm -f disks/scratch.d64
@ -69,7 +70,7 @@ cbmfiles/c16-vf-32k: emulator/tcbase.T64 emulator/build-vf.sh \
# Core test targets # Core test targets
test-c64.result: emulator/c64-vf-latest.T64 $(test_files_petscii) \ test-c64.result: emulator/c64-vf-latest.T64 $(test_files_petscii) \
emulator/run-in-vice.sh tests/evaluate-test.sh tests/test-c64.golden emulator/run-in-vice.sh tests/evaluate-test.sh test-c64.golden
rm -f test-c64.log test-c64.result rm -f test-c64.log test-c64.result
cp disks/empty.d64 disks/scratch.d64 cp disks/empty.d64 disks/scratch.d64
DISK9=scratch emulator/run-in-vice.sh c64-vf-latest \ DISK9=scratch emulator/run-in-vice.sh c64-vf-latest \
@ -78,13 +79,24 @@ test-c64.result: emulator/c64-vf-latest.T64 $(test_files_petscii) \
tests/evaluate-test.sh test-c64 tests/evaluate-test.sh test-c64
test-c16.result: emulator/c16-vf-latest.T64 $(test_files_petscii) \ test-c16.result: emulator/c16-vf-latest.T64 $(test_files_petscii) \
emulator/run-in-vice.sh tests/evaluate-test.sh tests/test-c16.golden emulator/run-in-vice.sh tests/evaluate-test.sh test-c16.golden
rm -f test-c16.log test-c16.result rm -f test-c16.log test-c16.result
VICE=xplus4 emulator/run-in-vice.sh c16-vf-latest \ VICE=xplus4 emulator/run-in-vice.sh c16-vf-latest \
"include run-vf-tests.fth\n1234567890\n" "include run-vf-tests.fth\n1234567890\n"
petscii2ascii cbmfiles/test.log test-c16.log petscii2ascii cbmfiles/test.log test-c16.log
tests/evaluate-test.sh test-c16 tests/evaluate-test.sh test-c16
c64_golden_parts = prelim core coreext double block report-blk
c64_golden_files = $(patsubst %, tests/golden/%.golden, \
$(c64_golden_parts))
test-c64.golden: $(c64_golden_files)
cat $? > $@
c16_golden_parts = prelim core
c16_golden_files = $(patsubst %, tests/golden/%.golden, \
$(c16_golden_parts))
test-c16.golden: $(c16_golden_files)
cat $? > $@
# Rules for building Forth binaries on top of the plain vanilla # Rules for building Forth binaries on top of the plain vanilla
# c64-volksforth83. # c64-volksforth83.

View File

@ -5,7 +5,8 @@ basedir="$(realpath --relative-to="$PWD" "${testsdir}/..")"
testname="$1" testname="$1"
diff "${testsdir}/${testname}.golden" "${basedir}/${testname}.log" > tmp.result diff --ignore-trailing-space "${basedir}/${testname}.golden" \
"${basedir}/${testname}.log" > tmp.result
exitcode=$? exitcode=$?
test $exitcode -eq 0 \ test $exitcode -eq 0 \
&& echo "PASS: ${testname}" >> tmp.result \ && echo "PASS: ${testname}" >> tmp.result \

View File

@ -0,0 +1,134 @@
blocktest.fth**=== NOT TESTED === *******Scr 21 Dr 1
0 Should show a (mostly) blank screen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Scr 20 Dr 1
0 List of the First test block
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Scr 29 Dr 1
0 List of the Last test block
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Scr 25 Dr 1
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 End of Screen
Scr 21 Dr 1
0 Should show another (mostly) blank scree
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
*** | exists Given Characters per Line: 41
*
End of Block word tests

View File

@ -0,0 +1,32 @@
tester.fth ERROR exists
core.fr
*********************YOU SHOULD SEE THE STANDARD GRAPHIC CHARACTERS:
!"#$%&'()*+,-./0123456789:;<=>?@
abcdefghijklmnopqrstuvwxyz[\]^_`
ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~
YOU SHOULD SEE 0-9 SEPARATED BY A SPACE:
0 1 2 3 4 5 6 7 8 9
YOU SHOULD SEE 0-9 (WITH NO SPACES):
0123456789
YOU SHOULD SEE A-G SEPARATED BY A SPACE:
A B C D E F G
YOU SHOULD SEE 0-5 SEPARATED BY TWO SPACES:
0 1 2 3 4 5
YOU SHOULD SEE TWO SEPARATE LINES:
LINE 1
LINE 2
YOU SHOULD SEE THE NUMBER RANGES OF SIGNED AND UNSIGNED NUMBERS:
SIGNED: -8000 7FFF
UNSIGNED: 0 FFFF
*
PLEASE TYPE UP TO 80 CHARACTERS:
1234567890
RECEIVED: "1234567890"
* GDX exists
End of Core word set tests
coreplustest.fth********
You should see 2345: 2345
*****
End of additional Core tests

View File

@ -0,0 +1,52 @@
utilities.fth ?DEFTEST1 exists
Test utilities loaded
errorreport.fth
coreexttest.fth**************
Output from .(
You should see -9876: -9876
and again: -9876
On the next 2 lines you should see First then Second messages:
First message via .(
Second message via ."
*
Output from .R and U.R
You should see lines duplicated:
indented by 0 spaces
30278
30278
-31871
-31871
30278
30278
33665
33665
indented by 0 spaces
30278
30278
-31871
-31871
30278
30278
33665
33665
indented by 5 spaces
30278
30278
-31871
-31871
30278
30278
33665
33665
***
End of Core Extension word tests

View File

@ -0,0 +1,3 @@
doubletest.fth*****************
End of Double-Number word tests

View File

@ -1,5 +1,5 @@
ans-shim.fth CHAR exists 0> exists ans-shim.fth CHAR exists 0> exists
prelimtest.fth prelimtest.fth
@ -31,7 +31,7 @@ Pass #21: testing ?~
Pass #22: testing EMIT Pass #22: testing EMIT
Pass #23: testing S" Pass #23: testing S"
Results: Results:
Pass messages #1 to #23 should be displayed above Pass messages #1 to #23 should be displayed above
and no error messages and no error messages
@ -39,36 +39,4 @@ and no error messages
0 tests failed out of 57 additional tests 0 tests failed out of 57 additional tests
--- End of Preliminary Tests --- --- End of Preliminary Tests ---
tester.fth ERROR exists
core.fr
*********************YOU SHOULD SEE THE STANDARD GRAPHIC CHARACTERS:
!"#$%&'()*+,-./0123456789:;<=>?@
abcdefghijklmnopqrstuvwxyz[\]^_`
ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~
YOU SHOULD SEE 0-9 SEPARATED BY A SPACE:
0 1 2 3 4 5 6 7 8 9
YOU SHOULD SEE 0-9 (WITH NO SPACES):
0123456789
YOU SHOULD SEE A-G SEPARATED BY A SPACE:
A B C D E F G
YOU SHOULD SEE 0-5 SEPARATED BY TWO SPACES:
0 1 2 3 4 5
YOU SHOULD SEE TWO SEPARATE LINES:
LINE 1
LINE 2
YOU SHOULD SEE THE NUMBER RANGES OF SIGNED AND UNSIGNED NUMBERS:
SIGNED: -8000 7FFF
UNSIGNED: 0 FFFF
*
PLEASE TYPE UP TO 80 CHARACTERS:
1234567890
RECEIVED: "1234567890"
* GDX exists
End of Core word set tests
coreplustest.fth********
You should see 2345: 2345
*****
End of additional Core tests

View File

@ -0,0 +1,21 @@
---------------------------
Error Report
Word Set Errors
---------------------------
Core 0
Core extension 0
Block 0
Double number 0
Exception -
Facility -
File-access -
Locals -
Memory-allocation -
Programming-tools -
Search-order -
String -
---------------------------
Total 0
---------------------------

View File

@ -0,0 +1,21 @@
---------------------------
Error Report
Word Set Errors
---------------------------
Core 0
Core extension 0
Block -
Double number 0
Exception -
Facility -
File-access -
Locals -
Memory-allocation -
Programming-tools -
Search-order -
String -
---------------------------
Total 0
---------------------------

View File

@ -1,284 +0,0 @@
ans-shim.fth CHAR exists 0> exists
prelimtest.fth
CR CR SOURCE TYPE ( Preliminary test ) CR
SOURCE ( These lines test SOURCE, TYPE, CR and parenthetic comments ) TYPE CR
( The next line of output should be blank to test CR ) SOURCE TYPE CR CR
( Pass #1: testing 0 >IN +! ) 0 >IN +! SOURCE TYPE CR
( Pass #2: testing 1 >IN +! ) 1 >IN +! xSOURCE TYPE CR
( Pass #3: testing 1+ ) 1 1+ >IN +! xxSOURCE TYPE CR
( Pass #4: testing @ ! BASE ) 0 1+ 1+ BASE ! BASE @ >IN +! xxSOURCE TYPE CR
( Pass #5: testing decimal BASE ) BASE @ >IN +! xxxxxxxxxxSOURCE TYPE CR
( Pass #6: testing : ; ) : .SRC SOURCE TYPE CR ; 6 >IN +! xxxxxx.SRC
( Pass #7: testing number input ) 19 >IN +! xxxxxxxxxxxxxxxxxxx.SRC
( Pass #8: testing VARIABLE ) VARIABLE Y 2 Y ! Y @ >IN +! xx.SRC
( Pass #9: testing WORD COUNT ) 5 MSG abcdef) Y ! Y ! >IN +! xxxxx.SRC
( Pass #10: testing WORD COUNT ) MSG ab) >IN +! xxY ! .SRC
Pass #11: testing WORD COUNT .MSG
Pass #12: testing = returns all 1's for true
Pass #13: testing = returns 0 for false
Pass #14: testing -1 interpreted correctly
Pass #15: testing 2*
Pass #16: testing 2*
Pass #17: testing AND
Pass #18: testing AND
Pass #19: testing AND
Pass #20: testing ?F~ ?~~ Pass Error
Pass #21: testing ?~
Pass #22: testing EMIT
Pass #23: testing S"
Results:
Pass messages #1 to #23 should be displayed above
and no error messages
0 tests failed out of 57 additional tests
--- End of Preliminary Tests ---
tester.fth ERROR exists
core.fr
*********************YOU SHOULD SEE THE STANDARD GRAPHIC CHARACTERS:
!"#$%&'()*+,-./0123456789:;<=>?@
abcdefghijklmnopqrstuvwxyz[\]^_`
ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~
YOU SHOULD SEE 0-9 SEPARATED BY A SPACE:
0 1 2 3 4 5 6 7 8 9
YOU SHOULD SEE 0-9 (WITH NO SPACES):
0123456789
YOU SHOULD SEE A-G SEPARATED BY A SPACE:
A B C D E F G
YOU SHOULD SEE 0-5 SEPARATED BY TWO SPACES:
0 1 2 3 4 5
YOU SHOULD SEE TWO SEPARATE LINES:
LINE 1
LINE 2
YOU SHOULD SEE THE NUMBER RANGES OF SIGNED AND UNSIGNED NUMBERS:
SIGNED: -8000 7FFF
UNSIGNED: 0 FFFF
*
PLEASE TYPE UP TO 80 CHARACTERS:
1234567890
RECEIVED: "1234567890"
* GDX exists
End of Core word set tests
coreplustest.fth********
You should see 2345: 2345
*****
End of additional Core tests
utilities.fth ?DEFTEST1 exists
Test utilities loaded
errorreport.fth
coreexttest.fth**************
Output from .(
You should see -9876: -9876
and again: -9876
On the next 2 lines you should see First then Second messages:
First message via .(
Second message via ."
*
Output from .R and U.R
You should see lines duplicated:
indented by 0 spaces
30278
30278
-31871
-31871
30278
30278
33665
33665
indented by 0 spaces
30278
30278
-31871
-31871
30278
30278
33665
33665
indented by 5 spaces
30278
30278
-31871
-31871
30278
30278
33665
33665
***
End of Core Extension word tests
doubletest.fth*****************
End of Double-Number word tests
blocktest.fth**=== NOT TESTED === *******Scr 21 Dr 1
0 Should show a (mostly) blank screen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Scr 20 Dr 1
0 List of the First test block
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Scr 29 Dr 1
0 List of the Last test block
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Scr 25 Dr 1
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 End of Screen
Scr 21 Dr 1
0 Should show another (mostly) blank scree
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
*** | exists Given Characters per Line: 41
*
End of Block word tests
---------------------------
Error Report
Word Set Errors
---------------------------
Core 0
Core extension 0
Block 0
Double number 0
Exception -
Facility -
File-access -
Locals -
Memory-allocation -
Programming-tools -
Search-order -
String -
---------------------------
Total 0
---------------------------