File: st_all.ll

package info (click to toggle)
lifelines 3.0.50-2
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 11,140 kB
  • ctags: 6,517
  • sloc: ansic: 57,468; xml: 8,014; sh: 4,255; makefile: 848; yacc: 601; perl: 170; sed: 16
file content (94 lines) | stat: -rwxr-xr-x 1,933 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
 * @progname       st_all.ll
 * @version        1.14 (2005-02-01)
 * @author         Perry Rapp
 * @category       self-test
 * @output         mixed
 * @description

calls all self-test modules,
Validates report language functions,
and optionally dumps various data to a file
(to exercise db functions).

Perry is using this for a a regression test.

TODO: more conversion tests
TODO: logic
TODO: non-ASCII dates
TODO: Flag date tests for gedcom legal vs illegal

*/


char_encoding("ASCII")

require("lifelines-reports.version:1.3")
option("explicitvars") /* Disallow use of undefined variables */
include("st_string.li")
include("st_string_UTF-8.li")
include("st_collate.li")
include("st_date.li")
include("st_name.li")
include("st_number.li")
include("st_convert.li")
include("st_list.li")
include("st_table.li")
include("st_db.li")

global(true)
global(dbuse)

proc main()
{
	set(true,1)

	getint(alltests, "Run all tests ? (1=yes, 0=prompt)")
	getint(dbuse, "Exercise db functions ? (0=no)")
	getint(logout, "Output errors to file (0=no)")

	if (dostep(alltests, "Test collation ? (0=no)")) {
		call testCollate()
	}
	if (dostep(alltests, "Test strings ? (0=no)")) {
		call testStrings()
	}
	if (dostep(alltests, "Test lists ? (0=no)")) {
		call testLists()
	}
	if (dostep(alltests, "Test tables ? (0=no)")) {
		call testTables()
	}
	if (dostep(alltests, "Test UTF-8strings ? (0=no)")) {
		call testStrings_UTF_8()
	}
	if (dostep(alltests, "Test numbers ? (0=no)")) {
		call testNums()
	}
	if (dostep(alltests, "Test names ? (0=no)")) {
		call testNames()
	}
	if (dostep(alltests, "Test dates ? (0=no)")) {
		call testDates()
	}
	if (dostep(alltests, "Test codeset conversion ? (0=no)")) {
		call testConvert()
	}

	if (dbuse) 
	{
	  call exerciseDb()
	}
}

/* should we perform this step ? prompt if not doing all */
func dostep(alltests, prompt)
{
	if (alltests) { return(true) }
	getint(doit, prompt)
	return(doit)
}