1# testsuite for BASIC256 2 3# This program will test most of the basic256 language compiler and interperter 4 5# Modification History 6# date programmer description 7# 20121103 j.m.reneau added strings, file io, '' strings 8# 20121122 j.m.reneau added freefile, freedb, freedbset, multiple db connections, 9# and multiple db sets open on a single connection 10# 20121125 j.m.reneau added dbnull and logic to test dbstring, 11# dbint, dbfloat, and dbnull with column names and numbers 12# 20130102 j.m.reneau added color with pen and fill and penwidth 13# 20130126 j.m.reneau added alert/confirm, sprites, imgsave, and imgload 14# 20130205 j.m.reneau added radix conversion test 15# 20130208 j.m.reneau removed DECIMAL statement and added SCI notation 16# 20130403 j.m.reneau added mouse test 17# 20130610 j.m.reneau added jump around subroutines - program will not run before 0.9.9.60 18# 20130610 j.m.reneau changed error trap test to trap 9999 (number less than 0 now untrappable) 19# 20130903 j.m.reneau added tests for exit (do|if|for|while) and continue (do|for|while) 20# 20130906 j.m.reneau arranged tests so that interactive tests were first for speed 21# added tests for floating point to integer compare (epsilon) 22# 20130918 j.m.reneau moved functions to seperate file and included them 23# 20131125 j.m.reneau added try/catch error trapping 24# 20140103 j.m.reneau moved to own folder and split file and database 25# out to own include so that they can be run independently 26# 20140203 j.m.reneau added testsuite_if_include to test new if/then/else 27# and begin case/case/end case 28# 20140204 j.m.reneau updated to 1.1.0.2 29# 20140416 j.m.reneau updated to 1.1.1.3 and added WAV statements 30# 20140529 j.m.reneau added testsuite_complete_include to report on missing statements 31# added dir include 32# added printer include 33# added time include 34# 20140530 j.m.reneau added network include 35# 20141025 j.m.reneau added serial include 36# 20151114 j.m.reneau added types include 37# 20151127 j.m.reneau moved requirement to 1.99.99.2 38# 20151204 j.m.reneau added neq preverence for VNA errors 1.99.99.6 39# 20160203 j.m.reneau added reverse for loop testing and requirement for 40# system to be enabled 41# 20160327 j.m.reneau added binaryop include 42# 20160510 j.m.reneau moved input and key to external include 43# 20160805 j.m.reneau move requirement to 1.99.99.53 44# 21060807 j.m.reneau split out arrays and rewrite - updated to 1.99.99.55 45# 20160908 j.m.reneau change sprite for new slice logic 46# added serialize and unserialize test to arrays 47# 20161117 j.m.reneau adjusted function calling for ref defined at call 48# 20170506 j.m.reneau added image... test 49# 20170513 j.m.reneau changed allow/system test to not 0 50# 20200403 j.m.reneau added slice suite 51# 20200421 j.m.reneau added print suite 52# 20200421 j.m.reneau added arraybase suite 53# 20200423 j.m.reneau added map suite 54 55include "testsuite_common_include.kbs" 56 57################################################### 58call section("Runtime Version") 59################################################### 60call versiontest(2000011) 61function versiontestgood(needed) 62 return version >= needed 63end function 64subroutine versiontest(needed) 65 if not versiontestgood(needed) then 66 print "this program requires version " + (needed\1000000) + "." + (needed\10000%100) + "." + (needed\100%100) + "." + (needed%100) + " or better" 67 end 68 end if 69end subroutine 70 71################################################### 72call section("Runtime Preferences") 73################################################### 74print "It is required for this suite to run that a few preferences be set in advance" 75print "On the 'User' tab" 76print " 'Runtime Handling of bad type conversion' must set to Warn" 77print " 'Runtime Handling of variable not assigned' must set to Warn" 78print " 'Always show decimal point on floting point numbers' must be checked" 79print "On the 'Printing' tab" 80print " 'Printer' must set to PDF File Output" 81print " 'PDF FileName' must be set to a name of a temporary file with the pdf extension" 82print "On the 'Advanced' tab" 83print " 'Allow SYSTEM statement' must be ask or allow" 84print 85call same("Float Tail", getSetting("SYSTEM","Runtime/FloatTail"),"true") 86call same("Type Conversion Setting", getSetting("SYSTEM","Runtime/TypeConv"),"1") 87call same("Variable Not Assigned", getSetting("SYSTEM","Runtime/VNA"),"1") 88# make sure printer setting are correct 89call different("Allow SYSTEM Statement", getSetting("SYSTEM","Allow/System"),0) 90call same("Printer - PDF setting", getsetting("SYSTEM","Printer/Printer"), "-1") 91call different("Printer - PDF setting", getsetting("SYSTEM","Printer/PDFFile"), "") 92 93##goto section_unattended 94 95################################################### 96################################################### 97################################################### 98## Iteractive tests follow 99################################################### 100################################################### 101################################################### 102 103editvisible 1 104graphvisible 1 105outputvisible 1 106 107################################################### 108call section("TestSuite Completeness Check") 109################################################### 110include "testsuite_complete_include.kbs" 111 112################################################### 113call section("TestSuite Arrays") 114################################################### 115include "testsuite_array_include.kbs" 116 117section_input: 118################################################### 119call section("Input, Key, and Prompt") 120################################################### 121include "testsuite_inputkey_include.kbs" 122 123section_graphics: 124################################################### 125call section("Basic Graphics") 126################################################### 127include "testsuite_graphics_include.kbs" 128 129section_slice: 130################################################### 131call section("screen slicing") 132################################################### 133include "testsuite_slice_include.kbs" 134 135section_image: 136################################################### 137call section("Image... Statements") 138################################################### 139include "testsuite_image_include.kbs" 140 141section_sound: 142################################################### 143call section("TTS and Sound") 144################################################### 145if yn("Do TTS and Sound Testing?") then 146 include "testsuite_sound_include.kbs" 147endif 148 149section_wav: 150################################################### 151call section("WAVPLAY...") 152################################################### 153if yn("Do WAVPLAY Testing?") then 154 include "testsuite_wav_include.kbs" 155endif 156 157################################################### 158call section("IMGSave, IMGLoad, Kill and Exists") 159################################################### 160include "testsuite_imagesave_include.kbs" 161 162################################################### 163call section("Poly and Stamp") 164################################################### 165include "testsuite_polystamp_include.kbs" 166 167section_mouse: 168################################################### 169call section("Mouse Functionality") 170################################################### 171include "testsuite_mouse_include.kbs" 172 173section_time: 174################################################### 175call section("Date, Time, Pause, and Durations") 176################################################### 177include "testsuite_time_include.kbs" 178 179section_printer: 180################################################### 181call section("Printing - To PDF") 182################################################### 183include "testsuite_printer_include.kbs" 184 185section_network: 186################################################### 187call section("Networking") 188################################################### 189if yn("Do Networking Testing?") then 190 include "testsuite_network_include.kbs" 191endif 192 193section_serial: 194################################################### 195call section("Serial Port") 196################################################### 197if yn("Do Serial Port Test?") then 198 include "testsuite_serialio_include.kbs" 199endif 200 201section_print: 202################################################### 203call section("Console Printing") 204################################################### 205include "testsuite_print_include.kbs" 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220section_unattended: 221################################################### 222################################################### 223################################################### 224## Unattended tests follow 225################################################### 226################################################### 227################################################### 228 229section_string: 230################################################### 231call section("String Assignment/Operations/Functions") 232################################################### 233include "testsuite_string_include.kbs" 234 235section_radix: 236################################################### 237call section("RADIX Conversion") 238################################################### 239include "testsuite_radix_include.kbs" 240 241################################################### 242call section("Functions and Subroutines") 243################################################### 244include "testsuite_function_include.kbs" 245 246section_error: 247################################################### 248call section("Error Trapping - OnError and Try/Catch") 249################################################### 250include "testsuite_error_include.kbs" 251 252section_math: 253################################################### 254call section("Integer/Float/Math") 255################################################### 256include "testsuite_math_include.kbs" 257 258section_fileio: 259################################################### 260call section("File I/O") 261################################################### 262include "testsuite_fileio_include.kbs" 263 264section_database: 265################################################### 266call section("Database") 267################################################### 268include "testsuite_database_include.kbs" 269 270section_if: 271################################################### 272call section("If") 273################################################### 274include "testsuite_if_include.kbs" 275 276section_remark: 277################################################### 278call section("remark") 279################################################### 280include "testsuite_remark_include.kbs" 281 282################################################### 283call section("Test Random and fastgraphics") 284################################################### 285include "testsuite_random_include.kbs" 286 287section_loop: 288################################################### 289call section("Loops with Exit and Continue") 290################################################### 291include "testsuite_loop_include.kbs" 292 293################################################### 294call section("TestSuite FOR/NEXT") 295################################################### 296include "testsuite_fornext_include.kbs" 297 298section_sprites: 299################################################### 300call section("Sprites") 301################################################### 302include "testsuite_sprite_include.kbs" 303 304section_dir: 305################################################### 306call section("Directory and File-System Checks") 307################################################### 308include "testsuite_dir_include.kbs" 309 310section_binaryop: 311################################################### 312call section("Binary Operations and Type Conversions") 313################################################### 314include "testsuite_binaryop_include.kbs" 315 316section_types: 317################################################### 318call section("Variable and Stack Types Tests") 319################################################### 320include "testsuite_types_include.kbs" 321 322array_base: 323################################################### 324call section("Array index base (arraybase 0/1)") 325################################################### 326include "testsuite_arraybase_include.kbs" 327 328map_base: 329################################################### 330call section("Map") 331################################################### 332include "testsuite_map_include.kbs" 333 334 335 336################################################### 337################################################### 338################################################### 339print "PASSED ALL TESTS." 340alert "All tests passed" 341################################################### 342################################################### 343################################################### 344end 345 346 347 348