-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.js
70 lines (63 loc) · 1.89 KB
/
tests.js
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
import * as std from 'cm_std';
import * as tfs from './bin/libs/test_fs';
import * as tshell from './bin/libs/test_shell';
import * as tstring from './bin/libs/test_string';
import * as tutilsDateAdd from './bin/utils/test_date-add';
import * as tutilsGetESM from './bin/utils/test_getesm';
import * as tzosdataset from './bin/libs/test_zos-dataset';
import * as tzosfs from './bin/libs/test_zos-fs';
import * as tzoslib from './bin/libs/test_zos';
import * as tester from './tester'
const TEST = {
fs: [
tfs.test_resolvePath,
tfs.test_convertToAbsolutePath
],
shell: [
tshell.test_execOutSync,
tshell.test_execErrSync,
tshell.test_execOutErrSync
],
string: [
tstring.test_escapeDollar,
tstring.test_escapeRegExp,
tstring.test_stripZweParms
],
utils: [
tutilsDateAdd.test_dateAdd,
tutilsGetESM.test_getesm
],
zosdataset: [
tzosdataset.test_validDataSetName,
tzosdataset.test_validDataSetMemberName,
tzosdataset.test_isDatasetExists,
tzosdataset.test_tsoIsDatasetExists
],
zosfs: [
tzosfs.test_getFileEncoding
],
zoslib: [
tzoslib.test_tsoCommand
]
}
let infos = [];
let errors = [];
let result;
let proceed = {};
for (let lib in TEST) {
let libArg = std.getenv(`QUICK_JS_TESTS_${lib.toUpperCase()}`) == undefined ? false : true;
if (std.getenv(`QUICK_JS_TESTS_TYPE`) == 'N')
libArg = !libArg;
proceed[`${lib}`] = libArg;
}
for (let lib in TEST) {
if (proceed[lib]) {
for (let testFunction in TEST[lib]) {
result = TEST[lib][testFunction]();
infos = infos.concat(result.infos);
errors = errors.concat(result.errors);
}
}
}
tester.overview(infos, ` Infos(${infos.length}) `, tester.CYAN);
tester.overview(errors, ` Errors(${errors.length}) `, tester.RED);