| 1 |
/* |
| 2 |
* @progname st_all.ll |
| 3 |
* @version 1.14 (2005-02-01) |
| 4 |
* @author Perry Rapp |
| 5 |
* @category self-test |
| 6 |
* @output mixed |
| 7 |
* @description |
| 8 |
|
| 9 |
calls all self-test modules, |
| 10 |
Validates report language functions, |
| 11 |
and optionally dumps various data to a file |
| 12 |
(to exercise db functions). |
| 13 |
|
| 14 |
Perry is using this for a a regression test. |
| 15 |
|
| 16 |
TODO: more conversion tests |
| 17 |
TODO: logic |
| 18 |
TODO: non-ASCII dates |
| 19 |
TODO: Flag date tests for gedcom legal vs illegal |
| 20 |
|
| 21 |
*/ |
| 22 |
|
| 23 |
|
| 24 |
char_encoding("ASCII") |
| 25 |
|
| 26 |
require("lifelines-reports.version:1.3") |
| 27 |
option("explicitvars") /* Disallow use of undefined variables */ |
| 28 |
include("st_string.li") |
| 29 |
include("st_string_UTF-8.li") |
| 30 |
include("st_collate.li") |
| 31 |
include("st_date.li") |
| 32 |
include("st_name.li") |
| 33 |
include("st_number.li") |
| 34 |
include("st_convert.li") |
| 35 |
include("st_list.li") |
| 36 |
include("st_table.li") |
| 37 |
include("st_db.li") |
| 38 |
|
| 39 |
global(true) |
| 40 |
global(dbuse) |
| 41 |
|
| 42 |
proc main() |
| 43 |
{ |
| 44 |
set(true,1) |
| 45 |
|
| 46 |
getint(alltests, "Run all tests ? (1=yes, 0=prompt)") |
| 47 |
getint(dbuse, "Exercise db functions ? (0=no)") |
| 48 |
getint(logout, "Output errors to file (0=no)") |
| 49 |
|
| 50 |
if (dostep(alltests, "Test collation ? (0=no)")) { |
| 51 |
call testCollate() |
| 52 |
} |
| 53 |
if (dostep(alltests, "Test strings ? (0=no)")) { |
| 54 |
call testStrings() |
| 55 |
} |
| 56 |
if (dostep(alltests, "Test lists ? (0=no)")) { |
| 57 |
call testLists() |
| 58 |
} |
| 59 |
if (dostep(alltests, "Test tables ? (0=no)")) { |
| 60 |
call testTables() |
| 61 |
} |
| 62 |
if (dostep(alltests, "Test UTF-8strings ? (0=no)")) { |
| 63 |
call testStrings_UTF_8() |
| 64 |
} |
| 65 |
if (dostep(alltests, "Test numbers ? (0=no)")) { |
| 66 |
call testNums() |
| 67 |
} |
| 68 |
if (dostep(alltests, "Test names ? (0=no)")) { |
| 69 |
call testNames() |
| 70 |
} |
| 71 |
if (dostep(alltests, "Test dates ? (0=no)")) { |
| 72 |
call testDates() |
| 73 |
} |
| 74 |
if (dostep(alltests, "Test codeset conversion ? (0=no)")) { |
| 75 |
call testConvert() |
| 76 |
} |
| 77 |
|
| 78 |
if (dbuse) |
| 79 |
{ |
| 80 |
call exerciseDb() |
| 81 |
} |
| 82 |
} |
| 83 |
|
| 84 |
/* should we perform this step ? prompt if not doing all */ |
| 85 |
func dostep(alltests, prompt) |
| 86 |
{ |
| 87 |
if (alltests) { return(true) } |
| 88 |
getint(doit, prompt) |
| 89 |
return(doit) |
| 90 |
} |
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|