-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
index.html
147 lines (125 loc) · 5.13 KB
/
index.html
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<html lang="en">
<head>
<meta charset="utf-8">
<title>wasm-vips testsuite</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mocha/9.1.0/mocha.min.css" crossorigin="anonymous"/>
<style>
html,
body {
width: 100%;
height: 100%;
margin: 0;
}
#mocha {
font: 13px "Segoe UI", Arial, "HelveticaNeue-Light", sans-serif;
}
#mocha-stats {
font-size: initial;
}
#mocha h1 {
font-size: 1.8em;
font-weight: initial;
}
#mocha .suite .suite h1 {
font-size: 1.4em;
}
#mocha h2 {
font-size: 1.2em;
font-weight: initial;
cursor: default;
}
#mocha .test.pass .duration {
font-size: 13px;
}
#mocha .test.fail::before {
font-size: initial;
}
#mocha .test.pass::before {
content: '\2714';
font-size: initial;
color: forestgreen;
}
#mocha .test.pending::before {
content: '\25CF';
font-size: initial;
color: #0b97c4;
}
#mocha .test.pending:hover h2::after {
content: ' (skipped)'
}
#mocha .test pre:not(.error) {
display: none !important;
}
</style>
</head>
<body>
<div id="mocha"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/9.1.0/mocha.min.js" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chai/4.3.4/chai.min.js" crossorigin="anonymous"></script>
<script class="mocha-init">
mocha.setup({
ui: 'bdd',
slow: 5000,
timeout: 60000
});
</script>
<script src="lib/web/vips.js"></script>
<script type="module" src="test_arithmetic.js"></script>
<script type="module" src="test_colour.js"></script>
<script type="module" src="test_connection.js"></script>
<script type="module" src="test_conversion.js"></script>
<script type="module" src="test_convolution.js"></script>
<script type="module" src="test_create.js"></script>
<script type="module" src="test_draw.js"></script>
<script type="module" src="test_foreign.js"></script>
<script type="module" src="test_histogram.js"></script>
<script type="module" src="test_iofuncs.js"></script>
<script type="module" src="test_morphology.js"></script>
<script type="module" src="test_mosaicing.js"></script>
<script type="module" src="test_resample.js"></script>
<script type="module" class="mocha-exec">
// Global variables used throughout the unit tests
globalThis.expect = chai.expect;
import * as Helpers from './helpers.js';
const options = {
print: (stdout) => console.log(stdout.replace(/\033\[[0-9;]*m/g, "")),
preRun: (module) => {
module['EMBIND_AUTOMATIC_DELETELATER'] = true;
module.setDelayFunction(fn => globalThis.cleanup = fn);
// Handy for debugging
// module.ENV.G_MESSAGES_DEBUG = 'VIPS';
// module.ENV.VIPS_LEAK = '1';
module.FS.mkdir('images');
for (const file of Helpers.TEST_FILES)
module.FS.createPreloadedFile('images', file.split('/').pop(), 'test/unit/' + file, true, false);
},
postRun: (module) => {
const pad = 30;
const have = (name) => module.Utils.typeFind('VipsOperation', name) !== 0;
console.log('vips version:'.padEnd(pad), module.version());
console.log('Emscripten version:'.padEnd(pad), module.emscriptenVersion());
//console.log(module.config());
console.log('Concurrency:'.padEnd(pad), module.concurrency());
console.log('Cache max mem:'.padEnd(pad), module.Cache.maxMem());
console.log('Cache max operations:'.padEnd(pad), module.Cache.max());
console.log('Cache current operations:'.padEnd(pad), module.Cache.size());
console.log('Cache max open files:'.padEnd(pad), module.Cache.maxFiles());
console.log('Memory allocations:'.padEnd(pad), module.Stats.allocations());
console.log('Memory currently allocated:'.padEnd(pad), module.Stats.mem());
console.log('Memory high water:'.padEnd(pad), module.Stats.memHighwater());
console.log('Open files:'.padEnd(pad), module.Stats.files());
console.log('JPEG support:'.padEnd(pad), have('jpegload') ? 'yes' : 'no');
console.log('PNG support:'.padEnd(pad), have('pngload') ? 'yes' : 'no');
console.log('TIFF support:'.padEnd(pad), have('tiffload') ? 'yes' : 'no');
console.log('WebP support:'.padEnd(pad), have('webpload') ? 'yes' : 'no');
console.log('GIF load:'.padEnd(pad), have('gifload') ? 'yes' : 'no');
console.log('SVG load:'.padEnd(pad), have('svgload') ? 'yes' : 'no');
console.log('Text rendering support:'.padEnd(pad), have('text') ? 'yes' : 'no');
}
};
globalThis.vips = await Vips(options);
mocha.run();
</script>
</body>
</html>