forked from imaya/zlib.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuster.js
101 lines (93 loc) · 1.93 KB
/
buster.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
/**
* unit test settings for BusterJS.
*/
var config = module.exports;
// ブラウザ共通設定
var browserCommon = {
rootPath: "../",
environment: "browser",
libs: [
"vendor/mt.js/mt.js",
"test/use_typedarray.js",
"test/util.js"
],
tests: [
'test/browser-inflate-test.js',
'test/browser-zlib-test.js',
'test/browser-gunzip-test.js',
'test/browser-gzip-test.js',
'test/browser-unzip-test.js',
'test/browser-zip-test.js'
]
};
// ブラウザでコンパイル前のテスト
config["codepath"] = mixin(
mixin({}, browserCommon),
{
resources: [
"src/**/*.js"
],
libs: [
"closure-primitives/base.js",
"deps.js",
"test/plain.js"
],
tests: [
'test/browser-codepath-test.js',
'test/browser-raw-test.js'
]
}
);
// ブラウザで独立ビルド版のテスト
config["respectively build"] = mixin(
mixin({}, browserCommon),
{
tests: [
'test/browser-raw-test.js'
],
libs: [
"bin/rawinflate.min.js",
"bin/rawdeflate.min.js",
"bin/inflate.min.js",
"bin/deflate.min.js",
"bin/gunzip.min.js",
"bin/gzip.min.js",
"bin/unzip.min.js",
"bin/zip.min.js"
]
}
);
// ブラウザで Zlib まとめてビルド版のテスト
config["zlib"] = mixin(
mixin({}, browserCommon),
{
libs: [
"bin/inflate.min.js",
"bin/zip.min.js",
"bin/unzip.min.js",
"bin/zlib_and_gzip.min.js"
]
}
);
// node
config["node"] = {
rootPath: "../",
environment: "node",
tests: [
"test/node-test.js"
]
};
// config mixin
function mixin(dst, src) {
var i;
for (i in src) {
if (dst[i] instanceof Array && src[i] instanceof Array) {
dst[i] = dst[i].concat(src[i]);
} else if (typeof dst[i] === 'object' && typeof src[i] === 'object') {
mixin(dst[i], src[i]);
} else {
dst[i] = src[i];
}
}
return dst;
}