Skip to content

Commit

Permalink
test: give js-native-api tests consistent names
Browse files Browse the repository at this point in the history
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 <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
gabrielschulhof authored and richardlau committed Jul 20, 2021
1 parent 7d82200 commit e265d8e
Show file tree
Hide file tree
Showing 24 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions test/js-native-api/2_function_arguments/binding.gyp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"targets": [
{
"target_name": "binding",
"target_name": "2_function_arguments",
"sources": [
"../entry_point.c",
"binding.c"
"2_function_arguments.c"
]
}
]
Expand Down
2 changes: 1 addition & 1 deletion test/js-native-api/2_function_arguments/test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';
const common = require('../../common');
const assert = require('assert');
const addon = require(`./build/${common.buildType}/binding`);
const addon = require(`./build/${common.buildType}/2_function_arguments`);

assert.strictEqual(addon.add(3, 5), 8);
File renamed without changes.
4 changes: 2 additions & 2 deletions test/js-native-api/3_callbacks/binding.gyp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"targets": [
{
"target_name": "binding",
"target_name": "3_callbacks",
"sources": [
"../entry_point.c",
"binding.c"
"3_callbacks.c"
]
}
]
Expand Down
2 changes: 1 addition & 1 deletion test/js-native-api/3_callbacks/test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
const common = require('../../common');
const assert = require('assert');
const addon = require(`./build/${common.buildType}/binding`);
const addon = require(`./build/${common.buildType}/3_callbacks`);

addon.RunCallback(function(msg) {
assert.strictEqual(msg, 'hello world');
Expand Down
4 changes: 2 additions & 2 deletions test/js-native-api/4_object_factory/binding.gyp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"targets": [
{
"target_name": "binding",
"target_name": "4_object_factory",
"sources": [
"../entry_point.c",
"binding.c"
"4_object_factory.c"
]
}
]
Expand Down
2 changes: 1 addition & 1 deletion test/js-native-api/4_object_factory/test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
const common = require('../../common');
const assert = require('assert');
const addon = require(`./build/${common.buildType}/binding`);
const addon = require(`./build/${common.buildType}/4_object_factory`);

const obj1 = addon('hello');
const obj2 = addon('world');
Expand Down
4 changes: 2 additions & 2 deletions test/js-native-api/5_function_factory/binding.gyp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"targets": [
{
"target_name": "binding",
"target_name": "5_function_factory",
"sources": [
"../entry_point.c",
"binding.c"
"5_function_factory.c"
]
}
]
Expand Down
2 changes: 1 addition & 1 deletion test/js-native-api/5_function_factory/test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
const common = require('../../common');
const assert = require('assert');
const addon = require(`./build/${common.buildType}/binding`);
const addon = require(`./build/${common.buildType}/5_function_factory`);

const fn = addon();
assert.strictEqual(fn(), 'hello world'); // 'hello world'
4 changes: 2 additions & 2 deletions test/js-native-api/6_object_wrap/binding.gyp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"targets": [
{
"target_name": "binding",
"target_name": "6_object_wrap",
"sources": [
"../entry_point.c",
"myobject.cc"
"6_object_wrap.cc"
]
}
]
Expand Down
2 changes: 1 addition & 1 deletion test/js-native-api/6_object_wrap/test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
const common = require('../../common');
const assert = require('assert');
const addon = require(`./build/${common.buildType}/binding`);
const addon = require(`./build/${common.buildType}/6_object_wrap`);

const getterOnlyErrorRE =
/^TypeError: Cannot set property .* of #<.*> which has only a getter$/;
Expand Down
4 changes: 2 additions & 2 deletions test/js-native-api/7_factory_wrap/binding.gyp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"targets": [
{
"target_name": "binding",
"target_name": "7_factory_wrap",
"sources": [
"../entry_point.c",
"binding.cc",
"7_factory_wrap.cc",
"myobject.cc"
]
}
Expand Down
2 changes: 1 addition & 1 deletion test/js-native-api/7_factory_wrap/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

const common = require('../../common');
const assert = require('assert');
const test = require(`./build/${common.buildType}/binding`);
const test = require(`./build/${common.buildType}/7_factory_wrap`);

assert.strictEqual(test.finalizeCount, 0);
async function runGCTests() {
Expand Down
4 changes: 2 additions & 2 deletions test/js-native-api/8_passing_wrapped/binding.gyp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"targets": [
{
"target_name": "binding",
"target_name": "8_passing_wrapped",
"sources": [
"../entry_point.c",
"binding.cc",
"8_passing_wrapped.cc",
"myobject.cc"
]
}
Expand Down
2 changes: 1 addition & 1 deletion test/js-native-api/8_passing_wrapped/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

const common = require('../../common');
const assert = require('assert');
const addon = require(`./build/${common.buildType}/binding`);
const addon = require(`./build/${common.buildType}/8_passing_wrapped`);

async function runTest() {
let obj1 = addon.createObject(10);
Expand Down
4 changes: 2 additions & 2 deletions test/js-native-api/test_new_target/binding.gyp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
'targets': [
{
'target_name': 'binding',
'target_name': 'test_new_target',
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
'sources': [
'../entry_point.c',
'binding.c'
'test_new_target.c'
]
}
]
Expand Down
2 changes: 1 addition & 1 deletion test/js-native-api/test_new_target/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const common = require('../../common');
const assert = require('assert');
const binding = require(`./build/${common.buildType}/binding`);
const binding = require(`./build/${common.buildType}/test_new_target`);

class Class extends binding.BaseClass {
constructor() {
Expand Down

0 comments on commit e265d8e

Please sign in to comment.