mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 00:20:08 +01:00
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: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
7d82200861
commit
e265d8ee1b
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"targets": [
|
||||
{
|
||||
"target_name": "binding",
|
||||
"target_name": "2_function_arguments",
|
||||
"sources": [
|
||||
"../entry_point.c",
|
||||
"binding.c"
|
||||
"2_function_arguments.c"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"targets": [
|
||||
{
|
||||
"target_name": "binding",
|
||||
"target_name": "3_callbacks",
|
||||
"sources": [
|
||||
"../entry_point.c",
|
||||
"binding.c"
|
||||
"3_callbacks.c"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"targets": [
|
||||
{
|
||||
"target_name": "binding",
|
||||
"target_name": "4_object_factory",
|
||||
"sources": [
|
||||
"../entry_point.c",
|
||||
"binding.c"
|
||||
"4_object_factory.c"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"targets": [
|
||||
{
|
||||
"target_name": "binding",
|
||||
"target_name": "5_function_factory",
|
||||
"sources": [
|
||||
"../entry_point.c",
|
||||
"binding.c"
|
||||
"5_function_factory.c"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"targets": [
|
||||
{
|
||||
"target_name": "binding",
|
||||
"target_name": "6_object_wrap",
|
||||
"sources": [
|
||||
"../entry_point.c",
|
||||
"myobject.cc"
|
||||
"6_object_wrap.cc"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -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$/;
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user