-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an embedder cctest that also covers a multi-Environment situation, including worker_threads-style inspector support. Co-authored-by: Joyee Cheung <[email protected]> PR-URL: #30467 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
- Loading branch information
Showing
6 changed files
with
183 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
const fixtures = require('../common/fixtures'); | ||
const assert = require('assert'); | ||
const child_process = require('child_process'); | ||
const path = require('path'); | ||
|
||
common.allowGlobals(global.require); | ||
let binary = process.features.debug ? | ||
'out/Debug/embedtest' : 'out/Release/embedtest'; | ||
if (common.isWindows) { | ||
binary += '.exe'; | ||
} | ||
binary = path.resolve(__dirname, '..', '..', binary); | ||
|
||
assert.strictEqual( | ||
child_process.spawnSync(binary, ['console.log(42)']) | ||
.stdout.toString().trim(), | ||
'42'); | ||
|
||
assert.strictEqual( | ||
child_process.spawnSync(binary, ['throw new Error()']).status, | ||
1); | ||
|
||
assert.strictEqual( | ||
child_process.spawnSync(binary, ['process.exitCode = 8']).status, | ||
8); | ||
|
||
|
||
const fixturePath = JSON.stringify(fixtures.path('exit.js')); | ||
assert.strictEqual( | ||
child_process.spawnSync(binary, [`require(${fixturePath})`, 92]).status, | ||
92); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import sys, os | ||
sys.path.append(os.path.join(os.path.dirname(__file__), '..')) | ||
import testpy | ||
|
||
def GetConfiguration(context, root): | ||
return testpy.SimpleTestConfiguration(context, root, 'embedding') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters