Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4067cde

Browse filesBrowse files
Fishrock123Myles Borins
authored andcommitted
test: abstract skip functionality to common
The tap skipping output is so prevalent yet obscure in nature that we ought to move it into it's own function in test/common.js Re-do of 52bae22 for v4.x Ref: #6697 PR-URL: #7114 Reviewed-By: Myles Borins <myles.borins@gmail.com>
1 parent eadb7e5 commit 4067cde
Copy full SHA for 4067cde

File tree

Expand file treeCollapse file tree

219 files changed

+291
-294
lines changed
Open diff view settings
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree

219 files changed

+291
-294
lines changed
Open diff view settings
Collapse file

‎test/addons/stringbytes-external-exceed-max/test-stringbytes-external-at-max.js‎

Copy file name to clipboardExpand all lines: test/addons/stringbytes-external-exceed-max/test-stringbytes-external-at-max.js
+4-5Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ const assert = require('assert');
88
// v8::String::kMaxLength defined in v8.h
99
const kStringMaxLength = process.binding('buffer').kStringMaxLength;
1010

11-
const skipMessage =
12-
'1..0 # Skipped: intensive toString tests due to memory confinements';
11+
const skipMessage = 'intensive toString tests due to memory confinements';
1312
if (!common.enoughTestMem) {
14-
console.log(skipMessage);
13+
common.skip(skipMessage);
1514
return;
1615
}
1716

@@ -20,13 +19,13 @@ try {
2019
} catch (e) {
2120
// If the exception is not due to memory confinement then rethrow it.
2221
if (e.message !== 'Invalid array buffer length') throw (e);
23-
console.log(skipMessage);
22+
common.skip(skipMessage);
2423
return;
2524
}
2625

2726
// Ensure we have enough memory available for future allocations to succeed.
2827
if (!binding.ensureAllocation(2 * kStringMaxLength)) {
29-
console.log(skipMessage);
28+
common.skip(skipMessage);
3029
return;
3130
}
3231

Collapse file

‎test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-ascii.js‎

Copy file name to clipboardExpand all lines: test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-ascii.js
+4-5Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ const common = require('../../common');
44
const binding = require('./build/Release/binding');
55
const assert = require('assert');
66

7-
const skipMessage =
8-
'1..0 # Skipped: intensive toString tests due to memory confinements';
7+
const skipMessage = 'intensive toString tests due to memory confinements';
98
if (!common.enoughTestMem) {
10-
console.log(skipMessage);
9+
common.skip(skipMessage);
1110
return;
1211
}
1312

@@ -20,13 +19,13 @@ try {
2019
} catch (e) {
2120
// If the exception is not due to memory confinement then rethrow it.
2221
if (e.message !== 'Invalid array buffer length') throw (e);
23-
console.log(skipMessage);
22+
common.skip(skipMessage);
2423
return;
2524
}
2625

2726
// Ensure we have enough memory available for future allocations to succeed.
2827
if (!binding.ensureAllocation(2 * kStringMaxLength)) {
29-
console.log(skipMessage);
28+
common.skip(skipMessage);
3029
return;
3130
}
3231

Collapse file

‎test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-base64.js‎

Copy file name to clipboardExpand all lines: test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-base64.js
+4-5Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ const common = require('../../common');
44
const binding = require('./build/Release/binding');
55
const assert = require('assert');
66

7-
const skipMessage =
8-
'1..0 # Skipped: intensive toString tests due to memory confinements';
7+
const skipMessage = 'intensive toString tests due to memory confinements';
98
if (!common.enoughTestMem) {
10-
console.log(skipMessage);
9+
common.skip(skipMessage);
1110
return;
1211
}
1312

@@ -20,13 +19,13 @@ try {
2019
} catch (e) {
2120
// If the exception is not due to memory confinement then rethrow it.
2221
if (e.message !== 'Invalid array buffer length') throw (e);
23-
console.log(skipMessage);
22+
common.skip(skipMessage);
2423
return;
2524
}
2625

2726
// Ensure we have enough memory available for future allocations to succeed.
2827
if (!binding.ensureAllocation(2 * kStringMaxLength)) {
29-
console.log(skipMessage);
28+
common.skip(skipMessage);
3029
return;
3130
}
3231

Collapse file

‎test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-binary.js‎

Copy file name to clipboardExpand all lines: test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-binary.js
+4-5Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ const common = require('../../common');
44
const binding = require('./build/Release/binding');
55
const assert = require('assert');
66

7-
const skipMessage =
8-
'1..0 # Skipped: intensive toString tests due to memory confinements';
7+
const skipMessage = 'intensive toString tests due to memory confinements';
98
if (!common.enoughTestMem) {
10-
console.log(skipMessage);
9+
common.skip(skipMessage);
1110
return;
1211
}
1312

@@ -20,13 +19,13 @@ try {
2019
} catch (e) {
2120
// If the exception is not due to memory confinement then rethrow it.
2221
if (e.message !== 'Invalid array buffer length') throw (e);
23-
console.log(skipMessage);
22+
common.skip(skipMessage);
2423
return;
2524
}
2625

2726
// Ensure we have enough memory available for future allocations to succeed.
2827
if (!binding.ensureAllocation(2 * kStringMaxLength)) {
29-
console.log(skipMessage);
28+
common.skip(skipMessage);
3029
return;
3130
}
3231

Collapse file

‎test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-hex.js‎

Copy file name to clipboardExpand all lines: test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-hex.js
+4-5Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ const common = require('../../common');
44
const binding = require('./build/Release/binding');
55
const assert = require('assert');
66

7-
const skipMessage =
8-
'1..0 # Skipped: intensive toString tests due to memory confinements';
7+
const skipMessage = 'intensive toString tests due to memory confinements';
98
if (!common.enoughTestMem) {
10-
console.log(skipMessage);
9+
common.skip(skipMessage);
1110
return;
1211
}
1312

@@ -20,13 +19,13 @@ try {
2019
} catch (e) {
2120
// If the exception is not due to memory confinement then rethrow it.
2221
if (e.message !== 'Invalid array buffer length') throw (e);
23-
console.log(skipMessage);
22+
common.skip(skipMessage);
2423
return;
2524
}
2625

2726
// Ensure we have enough memory available for future allocations to succeed.
2827
if (!binding.ensureAllocation(2 * kStringMaxLength)) {
29-
console.log(skipMessage);
28+
common.skip(skipMessage);
3029
return;
3130
}
3231

Collapse file

‎test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-utf8.js‎

Copy file name to clipboardExpand all lines: test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-utf8.js
+4-5Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ const common = require('../../common');
44
const binding = require('./build/Release/binding');
55
const assert = require('assert');
66

7-
const skipMessage =
8-
'1..0 # Skipped: intensive toString tests due to memory confinements';
7+
const skipMessage = 'intensive toString tests due to memory confinements';
98
if (!common.enoughTestMem) {
10-
console.log(skipMessage);
9+
common.skip(skipMessage);
1110
return;
1211
}
1312

@@ -20,13 +19,13 @@ try {
2019
} catch (e) {
2120
// If the exception is not due to memory confinement then rethrow it.
2221
if (e.message !== 'Invalid array buffer length') throw (e);
23-
console.log(skipMessage);
22+
common.skip(skipMessage);
2423
return;
2524
}
2625

2726
// Ensure we have enough memory available for future allocations to succeed.
2827
if (!binding.ensureAllocation(2 * kStringMaxLength)) {
29-
console.log(skipMessage);
28+
common.skip(skipMessage);
3029
return;
3130
}
3231

Collapse file

‎test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-2.js‎

Copy file name to clipboardExpand all lines: test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-2.js
+4-5Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ const common = require('../../common');
44
const binding = require('./build/Release/binding');
55
const assert = require('assert');
66

7-
const skipMessage =
8-
'1..0 # Skipped: intensive toString tests due to memory confinements';
7+
const skipMessage = 'intensive toString tests due to memory confinements';
98
if (!common.enoughTestMem) {
10-
console.log(skipMessage);
9+
common.skip(skipMessage);
1110
return;
1211
}
1312

@@ -20,13 +19,13 @@ try {
2019
} catch (e) {
2120
// If the exception is not due to memory confinement then rethrow it.
2221
if (e.message !== 'Invalid array buffer length') throw (e);
23-
console.log(skipMessage);
22+
common.skip(skipMessage);
2423
return;
2524
}
2625

2726
// Ensure we have enough memory available for future allocations to succeed.
2827
if (!binding.ensureAllocation(2 * kStringMaxLength)) {
29-
console.log(skipMessage);
28+
common.skip(skipMessage);
3029
return;
3130
}
3231

Collapse file

‎test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max.js‎

Copy file name to clipboardExpand all lines: test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max.js
+4-5Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ const common = require('../../common');
44
const binding = require('./build/Release/binding');
55
const assert = require('assert');
66

7-
const skipMessage =
8-
'1..0 # Skipped: intensive toString tests due to memory confinements';
7+
const skipMessage = 'intensive toString tests due to memory confinements';
98
if (!common.enoughTestMem) {
10-
console.log(skipMessage);
9+
common.skip(skipMessage);
1110
return;
1211
}
1312

@@ -20,13 +19,13 @@ try {
2019
} catch (e) {
2120
// If the exception is not due to memory confinement then rethrow it.
2221
if (e.message !== 'Invalid array buffer length') throw (e);
23-
console.log(skipMessage);
22+
common.skip(skipMessage);
2423
return;
2524
}
2625

2726
// Ensure we have enough memory available for future allocations to succeed.
2827
if (!binding.ensureAllocation(2 * kStringMaxLength)) {
29-
console.log(skipMessage);
28+
common.skip(skipMessage);
3029
return;
3130
}
3231

Collapse file

‎test/common.js‎

Copy file name to clipboardExpand all lines: test/common.js
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,10 @@ exports.fail = function(msg) {
459459
assert.fail(null, null, msg);
460460
};
461461

462+
exports.skip = function(msg) {
463+
console.log(`1..0 # Skipped: ${msg}`);
464+
};
465+
462466
// Returns true if the exit code "exitCode" and/or signal name "signal"
463467
// represent the exit code and/or signal name of a node process that aborted,
464468
// false otherwise.
Collapse file

‎test/disabled/tls_server.js‎

Copy file name to clipboardExpand all lines: test/disabled/tls_server.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var certPem = fs.readFileSync(common.fixturesDir + '/cert.pem');
1313
try {
1414
var credentials = crypto.createCredentials({key: keyPem, cert: certPem});
1515
} catch (e) {
16-
console.log('1..0 # Skipped: node compiled without OpenSSL.');
16+
common.skip('node compiled without OpenSSL.');
1717
return;
1818
}
1919
var i = 0;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.