forked from IIIF-Commons/manifesto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
161 lines (129 loc) · 7.02 KB
/
index.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
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
const finalhandler = require('finalhandler');
const http = require('http');
const serveStatic = require('serve-static');
let server;
function importTest(name, path) {
describe(name, function () {
this.timeout(5000);
require(path);
});
}
before(function (done) {
const serve = serveStatic('test/fixtures', { 'index': ['index.html', 'index.htm'] });
server = http.createServer(function (req, res) {
const final = finalhandler(req, res);
serve(req, res, final)
});
server.listen(3001);
done();
});
after(function () {
server.close();
});
function run_v3_tests(){
importTest('rijksmuseum-image-api-v3-thumbnails', './tests/rijksmuseum-image-api-v3-thumbnails');
importTest('aarau', './tests/aarau');
importTest('annotation-dimensions', './tests/annotation-dimensions');
importTest('annotation-list', './tests/annotation-list');
importTest('anzacbulletin', './tests/anzacbulletin');
importTest('audio', './tests/audio');
importTest('bad-manifest-url', './tests/bad-manifest-url');
importTest('biocrats', './tests/biocrats');
importTest('book-of-remembrance', './tests/book-of-remembrance');
importTest('canvas-metadata', './tests/canvas-metadata');
importTest('cardiganshire', './tests/cardiganshire');
importTest('collection-with-thumbnail', './tests/collection-with-thumbnail');
importTest('correspondance', './tests/correspondance');
importTest('deep-hierarchy', './tests/deep-hierarchy');
importTest('default-label', './tests/default-label');
importTest('get-manifest-behavior', './tests/get-manifest-behavior');
importTest('get-range-by-path', './tests/get-range-by-path');
importTest('get-range-by-id', './tests/get-range-by-id');
importTest('get-resource', './tests/get-resource');
importTest('herbal', './tests/herbal');
importTest('horriblemurders', './tests/horriblemurders');
importTest('https', './tests/https');
importTest('illustrationsofchina', './tests/illustrationsofchina');
importTest('items-not-sequence', './tests/items-not-sequence');
importTest('LabelValuePair', './tests/LabelValuePair.test');
importTest('LanguageMap', './tests/LanguageMap.test');
importTest('logo', './tests/logo');
importTest('lunchroommanners', './tests/lunchroommanners');
importTest('manifest-with-thumbnail', './tests/manifest-with-thumbnail');
importTest('members-collection', './tests/members-collection');
importTest('members-ranges', './tests/members-ranges');
importTest('members', './tests/members');
importTest('multi-value-range-metadata', './tests/multi-value-range-metadata');
importTest('nested', './tests/nested');
importTest('nga-highlights', './tests/nga-highlights');
importTest('no-nav-ranges', './tests/no-nav-ranges');
importTest('plato', './tests/plato');
importTest('poster-canvas', './tests/poster-canvas');
importTest('potterselectric', './tests/potterselectric');
//importTest('pres3-3d', './tests/pres3-3d');
importTest('pres3-av-basic', './tests/pres3-av-basic');
importTest('pres3-collection', './tests/pres3-collection');
importTest('pres3-collection2', './tests/pres3-collection2');
importTest('pres3-collection3', './tests/pres3-collection3');
importTest('pres3-collection4', './tests/pres3-collection4');
importTest('pres3-pdf', './tests/pres3-pdf');
importTest('pres3', './tests/pres3');
importTest('presentation2-paging', './tests/presentation2-paging');
importTest('presentation3-paging', './tests/presentation3-paging');
importTest('PropertyValue', './tests/PropertyValue.test')
importTest('pseudoalbert', './tests/pseudoalbert');
importTest('qatarrighttoleft', './tests/qatarrighttoleft');
importTest('querystring', './tests/querystring');
importTest('required-statement', './tests/required-statement');
importTest('rhul', './tests/rhul');
importTest('riksarkivetlarge', './tests/riksarkivetlarge');
importTest('scroll', './tests/scroll');
importTest('storyofwellcome', './tests/storyofwellcome');
importTest('string', './tests/string');
importTest('tankeryshouse', './tests/tankeryshouse');
importTest('translations', './tests/translations');
importTest('witnesstopeter', './tests/witnesstopeter');
importTest('Utils', './tests/Utils.test');
}
// uncomment this, or in some other javascripty way assign a true value to variable skip_v3_tests, for purposes
// of only running 3d-relevant tests. One way to do this in mocha is to use a mocha .js configuration file,
// see https://www.testim.io/blog/mocharc-configuration/ ; https://github.com/mochajs/mocha/tree/master/example/config
// let skip_v3_tests=true;
let skip_v3_tests = Boolean(process.env.skip_v3_tests);
if ( (typeof(skip_v3_tests) !== "undefined") && skip_v3_tests){
console.log("Skipping V3 tests");
}
else{
describe("api-v3-tests", run_v3_tests );
}
function run_iiif3d_tests(){
require('./tests_3d/core_tests/parse_manifest.js');
require('./tests_3d/core_tests/class_color.js');
require('./tests_3d/core_tests/annotationIdMap.js');
require('./tests_3d/core_tests/threejs_math.js');
require('./tests_3d/core_tests/Geometry3d.js');
require('./tests_3d/core_tests/iiif_label.js');
describe("1_basic_model_in_scene" , function(){
importTest('model_origin', './tests_3d/1_basic_model_in_scene/model_origin.js');
importTest('model_origin_bgcolor', './tests_3d/1_basic_model_in_scene/model_origin_bgcolor.js');
});
describe("4_transform_and_position" , function(){
importTest('model_origin', './tests_3d/4_transform_and_position/model_position.js');
importTest('model_transform_translate_rotate_position', './tests_3d/4_transform_and_position/model_transform_translate_rotate_position.js');
importTest('model_transform_scale_position', './tests_3d/4_transform_and_position/model_transform_scale_position.js');
});
describe("3_lights" , function(){
importTest('ambient_green_light', './tests_3d/3_lights/ambient_green_light.js');
importTest('directional light', './tests_3d/3_lights/direction_light_transform_rotate.js');
importTest('spot light', './tests_3d/3_lights/spotlight_lookat_point.js');
});
describe("2_cameras" , function(){
importTest('position_camera_lookat_anno', './tests_3d/2_cameras/positioned_camera_lookat_anno.js');
importTest('position_camera_lookat_point', './tests_3d/2_cameras/positioned_camera_lookat_point.js');
importTest('orthographic_camera_lookat_point', './tests_3d/2_cameras/orthographic_camera_lookat_point.js');
});
describe("xx_whale_comments" , function(){
importTest('c_comments_with_camera', './tests_3d/xx_whale_comments/c_comment_annotation_camera.js');
});
}
describe("iiif-3d tests", run_iiif3d_tests );