BAS: Misc changes to test files

This commit is contained in:
Gregory Nutt 2014-11-09 08:20:19 -06:00
parent 58878c6ec9
commit 4f1d02e5cf
5 changed files with 379 additions and 340 deletions

View File

@ -9,7 +9,11 @@ config EXAMPLES_BASTEST
depends on INTERPRETERS_BAS
select FS_ROMFS
---help---
Mount the ROMFS file system containing the BAS test files at /mnt/romfs.
Mount the ROMFS file system containing the BAS test files at
/mnt/romfs.
The logic in certain tests (test33.bas and test36.bas will also fail
if there is no writable file system mount at /tmp.
if EXAMPLES_BASTEST
@ -17,16 +21,18 @@ config EXAMPLES_BASTEST_DEVMINOR
int "ROMFS Minor Device Number"
default 0
---help---
The minor device number of the ROMFS block. For example, the N in /dev/ramN.
Used for registering the RAM block driver that will hold the ROMFS file system
containing the BASIC files to be tested. Default: 0
The minor device number of the ROMFS block. For example, the N in
/dev/ramN. Used for registering the RAM block driver that will hold
the ROMFS file system containing the BASIC files to be tested.
Default: 0
config EXAMPLES_BASTEST_DEVPATH
string "ROMFS Device Path"
default "/dev/ram0"
---help---
The path to the ROMFS block driver device. This must match EXAMPLES_BASTEST_DEVMINOR.
Used for registering the RAM block driver that will hold the ROMFS file system
containing the BASIC files to be tested. Default: "/dev/ram0"
The path to the ROMFS block driver device. This must match
EXAMPLES_BASTEST_DEVMINOR. Used for registering the RAM block driver
that will hold the ROMFS file system containing the BASIC files to
be tested. Default: "/dev/ram0"
endif

View File

@ -72,8 +72,14 @@ Expected Result
1
hello
0.0002
2e-06
2e-07
0.000
0.0000020
0.0000002
Notes
-----
Output would differ on other platforms NttX does not use scientific
notation in floating point output.
test02.bas
==========
@ -1089,10 +1095,10 @@ Test File
Expected Result
---------------
1.333333e-08 1e-08
1.333333e-07 1e-07
1.333333e-06 1e-06
1.333333e-05 1e-05
0.0000000 0.0000000
0.0000001 0.0000001
0.0000013 0.0000010
0.0000133 0.0000100
0.000133 0.0001
0.001333 0.001
0.013333 0.01
@ -1104,8 +1110,13 @@ Expected Result
13333.33 10000
133333.3 100000
1333333 1000000
1.333333e+07 1e+07
1.333333e+08 1e+08
13333333.3333333 10000000.0000000
133333333.3333333 100000000.0000000
Notes
-----
Output would differ on other platforms NttX does not use scientific
notation in floating point output.
test032.bas
==========
@ -1131,13 +1142,13 @@ OPEN FOR BINARY
Test File
---------
open "test.out" for binary as 1
open "/tmp/test.out" for binary as 1
put 1,1,"xy"
put 1,3,"z!"
put 1,10,1/3
put 1,20,9999
close 1
open "test.out" for binary as 1
open "/tmp/test.out" for binary as 1
s$=" "
get 1,1,s$
get 1,10,x
@ -1146,7 +1157,7 @@ close
print s$
print x
print n%
kill "test.out"
kill "/tmp/test.out"
Expected Result
---------------
@ -1154,6 +1165,12 @@ xyz!
0.333333
9999
Notes
-----
The logic in this test will fail if there is no writable file system
mount at /tmp.
test34.bas
==========
OPTION BASE
@ -1217,7 +1234,7 @@ Test File
---------
on error goto 10
print "opening file"
open "test.out" for output lock write as #1
open "/tmp/test.out" for output lock write as #1
print "open succeeded"
if command$<>"enough" then shell "sh ./test/runbas test.bas enough"
end
@ -1230,21 +1247,31 @@ open succeeded
opening file
open failed
Notes
-----
The logic in this test will fail if there is no writable file system
mount at /tmp.
test37.bas
==========
LINE INPUT reaching EOF
Test File
---------
10 open "i",1,"test.ref"
10 open "i",1,"/mnt/romfs/test37.dat"
20 while not eof(1)
30 line input #1,a$
40 if a$="abc" then print a$; else print "def"
50 wend
Data file (/mnt/romfs/test37.dat)
-------------------------------
abc
Result
------
Output should match test.ref
abc
test38.bas
==========
@ -1561,6 +1588,12 @@ Expected Result
9.650995e+07
1
Notes
-----
Output will differ because NuttX does not use scientific notation in
output. Some minor rounding differences may also be expected.
test50.bas
==========
Min and max function
@ -1597,8 +1630,7 @@ PRINT "Line 1";TAB(78);1.23456789
Expected Result
---------------
Line 1
1.234568
Line 1 1.234568
test52.bas
==========

View File

@ -1,10 +1,10 @@
open "test.out" for binary as 1
open "/tmp/test.out" for binary as 1
put 1,1,"xy"
put 1,3,"z!"
put 1,10,1/3
put 1,20,9999
close 1
open "test.out" for binary as 1
open "/tmp/test.out" for binary as 1
s$=" "
get 1,1,s$
get 1,10,x
@ -13,5 +13,5 @@ close
print s$
print x
print n%
kill "test.out"
kill "/tmp/test.out"

View File

@ -1,6 +1,6 @@
on error goto 10
print "opening file"
open "test.out" for output lock write as #1
open "/tmp/test.out" for output lock write as #1
print "open succeeded"
if command$<>"enough" then shell "sh ./test/runbas test.bas enough"
end

View File

@ -0,0 +1 @@
abc