forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest-fs.js
80 lines (77 loc) · 3.14 KB
/
test-fs.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
// Flags: --experimental-workers
'use strict';
var assert = require('assert');
var util = require('util');
var Worker = require('worker');
var common = require('../common');
var checks = 0;
// FIXME(petkaantonov): Commented out tests can only be run when
// multiple tmp directories are created which is done by tools/run.py
// when running the tests in parallel using multiple processes.
var tests = [
'test/parallel/test-domain-implicit-fs.js',
// test/parallel/test-fs-access.js',
// test/parallel/test-fs-append-file.js',
// test/parallel/test-fs-append-file-sync.js',
// test/parallel/test-fs-chmod.js',
'test/parallel/test-fs-empty-readStream.js',
'test/parallel/test-fs-error-messages.js',
'test/parallel/test-fs-exists.js',
'test/parallel/test-fs-fsync.js',
// test/parallel/test-fs-long-path.js',
'test/parallel/test-fs-make-callback.js',
// test/parallel/test-fs-mkdir.js',
'test/parallel/test-fs-non-number-arguments-throw.js',
'test/parallel/test-fs-null-bytes.js',
'test/parallel/test-fs-open-flags.js',
'test/parallel/test-fs-open.js',
'test/parallel/test-fs-read-buffer.js',
'test/parallel/test-fs-readfile-empty.js',
'test/parallel/test-fs-readfile-error.js',
'test/parallel/test-fs-readfile-pipe.js',
'test/parallel/test-fs-read-file-sync-hostname.js',
'test/parallel/test-fs-read-file-sync.js',
'test/parallel/test-fs-readfile-unlink.js',
'test/parallel/test-fs-readfile-zero-byte-liar.js',
'test/parallel/test-fs-read.js',
'test/parallel/test-fs-read-stream-err.js',
// test/parallel/test-fs-read-stream-fd.js',
'test/parallel/test-fs-read-stream-fd-leak.js',
'test/parallel/test-fs-read-stream-inherit.js',
'test/parallel/test-fs-read-stream.js',
'test/parallel/test-fs-read-stream-resume.js',
// test/parallel/test-fs-realpath.js',
// test/parallel/test-fs-sir-writes-alot.js',
'test/parallel/test-fs-stat.js',
// test/parallel/test-fs-stream-double-close.js',
// test/parallel/test-fs-symlink-dir-junction.js',
// test/parallel/test-fs-symlink-dir-junction-relative.js',
// test/parallel/test-fs-symlink.js',
'test/parallel/test-fs-sync-fd-leak.js',
// test/parallel/test-fs-truncate-fd.js',
// test/parallel/test-fs-truncate-GH-6233.js',
// test/parallel/test-fs-truncate.js',
'test/parallel/test-fs-utimes.js',
// test/parallel/test-fs-write-buffer.js',
// test/parallel/test-fs-write-file-buffer.js',
// test/parallel/test-fs-write-file.js',
// test/parallel/test-fs-write-file-sync.js',
// test/parallel/test-fs-write.js',
// test/parallel/test-fs-write-stream-change-open.js',
// test/parallel/test-fs-write-stream-end.js',
// test/parallel/test-fs-write-stream-err.js',
// test/parallel/test-fs-write-stream.js',
// test/parallel/test-fs-write-string-coerce.js',
// test/parallel/test-fs-write-sync.js'
];
var parallelism = 4;
var testsPerThread = Math.ceil(tests.length / parallelism);
for (var i = 0; i < parallelism; ++i) {
var shareOfTests = tests.slice(i * testsPerThread, (i + 1) * testsPerThread);
var cur = Promise.resolve();
shareOfTests.forEach(function(testFile) {
cur = cur.then(function() {
return common.runTestInsideWorker(testFile);
});
});
}