fix tests on non-linux
This commit is contained in:
parent
da1c00f5c8
commit
b1d719eeeb
3 changed files with 24 additions and 11 deletions
16
lib/tracer-config.test.js
generated
16
lib/tracer-config.test.js
generated
|
|
@ -259,13 +259,19 @@ ava_1.default('getCombinedTracerConfig - valid spec file', async (t) => {
|
|||
},
|
||||
});
|
||||
const result = await tracer_config_1.getCombinedTracerConfig(config, codeQL);
|
||||
const expectedEnv = {
|
||||
'foo': 'bar',
|
||||
'ODASA_TRACER_CONFIGURATION': result.spec,
|
||||
};
|
||||
if (process.platform === 'darwin') {
|
||||
expectedEnv['DYLD_INSERT_LIBRARIES'] = path.join(path.dirname(codeQL.getPath()), 'tools', 'osx64', 'libtrace.dylib');
|
||||
}
|
||||
else if (process.platform !== 'win32') {
|
||||
expectedEnv['LD_PRELOAD'] = path.join(path.dirname(codeQL.getPath()), 'tools', 'linux64', '${LIB}trace.so');
|
||||
}
|
||||
t.deepEqual(result, {
|
||||
spec: path.join(tmpDir, 'compound-spec'),
|
||||
env: {
|
||||
'foo': 'bar',
|
||||
'ODASA_TRACER_CONFIGURATION': result.spec,
|
||||
'LD_PRELOAD': path.join(path.dirname(codeQL.getPath()), 'tools', 'linux64', '${LIB}trace.so'),
|
||||
}
|
||||
env: expectedEnv,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -299,13 +299,20 @@ test('getCombinedTracerConfig - valid spec file', async t => {
|
|||
});
|
||||
|
||||
const result = await getCombinedTracerConfig(config, codeQL);
|
||||
|
||||
const expectedEnv = {
|
||||
'foo': 'bar',
|
||||
'ODASA_TRACER_CONFIGURATION': result!.spec,
|
||||
};
|
||||
if (process.platform === 'darwin') {
|
||||
expectedEnv['DYLD_INSERT_LIBRARIES'] = path.join(path.dirname(codeQL.getPath()), 'tools', 'osx64', 'libtrace.dylib');
|
||||
} else if (process.platform !== 'win32') {
|
||||
expectedEnv['LD_PRELOAD'] = path.join(path.dirname(codeQL.getPath()), 'tools', 'linux64', '${LIB}trace.so');
|
||||
}
|
||||
|
||||
t.deepEqual(result, {
|
||||
spec: path.join(tmpDir, 'compound-spec'),
|
||||
env: {
|
||||
'foo': 'bar',
|
||||
'ODASA_TRACER_CONFIGURATION': result!.spec,
|
||||
'LD_PRELOAD': path.join(path.dirname(codeQL.getPath()), 'tools', 'linux64', '${LIB}trace.so'),
|
||||
}
|
||||
env: expectedEnv,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue