Skip to content

Commit 6da4aa3

Browse files
gabrielschulhofdanielleadams
authored andcommitted
test: give js-native-api tests consistent names
The convention for js-native-api/<test_name>: * <test_name>.c or <test_name>.cc has the entry point * The name of the target is <test_name> PR-URL: #38692 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent a47fd67 commit 6da4aa3

24 files changed

+24
-24
lines changed

test/js-native-api/2_function_arguments/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"targets": [
33
{
4-
"target_name": "binding",
4+
"target_name": "2_function_arguments",
55
"sources": [
66
"../entry_point.c",
7-
"binding.c"
7+
"2_function_arguments.c"
88
]
99
}
1010
]
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22
const common = require('../../common');
33
const assert = require('assert');
4-
const addon = require(`./build/${common.buildType}/binding`);
4+
const addon = require(`./build/${common.buildType}/2_function_arguments`);
55

66
assert.strictEqual(addon.add(3, 5), 8);

test/js-native-api/3_callbacks/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"targets": [
33
{
4-
"target_name": "binding",
4+
"target_name": "3_callbacks",
55
"sources": [
66
"../entry_point.c",
7-
"binding.c"
7+
"3_callbacks.c"
88
]
99
}
1010
]

test/js-native-api/3_callbacks/test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22
const common = require('../../common');
33
const assert = require('assert');
4-
const addon = require(`./build/${common.buildType}/binding`);
4+
const addon = require(`./build/${common.buildType}/3_callbacks`);
55

66
addon.RunCallback(function(msg) {
77
assert.strictEqual(msg, 'hello world');

test/js-native-api/4_object_factory/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"targets": [
33
{
4-
"target_name": "binding",
4+
"target_name": "4_object_factory",
55
"sources": [
66
"../entry_point.c",
7-
"binding.c"
7+
"4_object_factory.c"
88
]
99
}
1010
]

test/js-native-api/4_object_factory/test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22
const common = require('../../common');
33
const assert = require('assert');
4-
const addon = require(`./build/${common.buildType}/binding`);
4+
const addon = require(`./build/${common.buildType}/4_object_factory`);
55

66
const obj1 = addon('hello');
77
const obj2 = addon('world');

test/js-native-api/5_function_factory/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"targets": [
33
{
4-
"target_name": "binding",
4+
"target_name": "5_function_factory",
55
"sources": [
66
"../entry_point.c",
7-
"binding.c"
7+
"5_function_factory.c"
88
]
99
}
1010
]
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22
const common = require('../../common');
33
const assert = require('assert');
4-
const addon = require(`./build/${common.buildType}/binding`);
4+
const addon = require(`./build/${common.buildType}/5_function_factory`);
55

66
const fn = addon();
77
assert.strictEqual(fn(), 'hello world'); // 'hello world'

test/js-native-api/6_object_wrap/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"targets": [
33
{
4-
"target_name": "binding",
4+
"target_name": "6_object_wrap",
55
"sources": [
66
"../entry_point.c",
7-
"myobject.cc"
7+
"6_object_wrap.cc"
88
]
99
}
1010
]

test/js-native-api/6_object_wrap/test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22
const common = require('../../common');
33
const assert = require('assert');
4-
const addon = require(`./build/${common.buildType}/binding`);
4+
const addon = require(`./build/${common.buildType}/6_object_wrap`);
55

66
const getterOnlyErrorRE =
77
/^TypeError: Cannot set property .* of #<.*> which has only a getter$/;

test/js-native-api/7_factory_wrap/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"targets": [
33
{
4-
"target_name": "binding",
4+
"target_name": "7_factory_wrap",
55
"sources": [
66
"../entry_point.c",
7-
"binding.cc",
7+
"7_factory_wrap.cc",
88
"myobject.cc"
99
]
1010
}

test/js-native-api/7_factory_wrap/test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
const common = require('../../common');
55
const assert = require('assert');
6-
const test = require(`./build/${common.buildType}/binding`);
6+
const test = require(`./build/${common.buildType}/7_factory_wrap`);
77

88
assert.strictEqual(test.finalizeCount, 0);
99
async function runGCTests() {

test/js-native-api/8_passing_wrapped/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"targets": [
33
{
4-
"target_name": "binding",
4+
"target_name": "8_passing_wrapped",
55
"sources": [
66
"../entry_point.c",
7-
"binding.cc",
7+
"8_passing_wrapped.cc",
88
"myobject.cc"
99
]
1010
}

test/js-native-api/8_passing_wrapped/test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
const common = require('../../common');
55
const assert = require('assert');
6-
const addon = require(`./build/${common.buildType}/binding`);
6+
const addon = require(`./build/${common.buildType}/8_passing_wrapped`);
77

88
async function runTest() {
99
let obj1 = addon.createObject(10);

test/js-native-api/test_new_target/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
'targets': [
33
{
4-
'target_name': 'binding',
4+
'target_name': 'test_new_target',
55
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
66
'sources': [
77
'../entry_point.c',
8-
'binding.c'
8+
'test_new_target.c'
99
]
1010
}
1111
]

test/js-native-api/test_new_target/test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const common = require('../../common');
44
const assert = require('assert');
5-
const binding = require(`./build/${common.buildType}/binding`);
5+
const binding = require(`./build/${common.buildType}/test_new_target`);
66

77
class Class extends binding.BaseClass {
88
constructor() {

0 commit comments

Comments
 (0)