Skip to content

Commit

Permalink
Make nodejs test to cobol optional in order to pass the cd/ci tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
viferga committed Apr 24, 2020
1 parent e29a52f commit 84bd16c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
6 changes: 6 additions & 0 deletions source/ports/node_port/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,13 @@ set_property(TEST ${target}

include(TestEnvironmentVariables)

# Enable cobol test if it is built
if(OPTION_BUILD_LOADERS_COB)
set(TESTS_ENVIRONMENT_VARIABLES_COB "OPTION_BUILD_LOADERS_COB=1")
endif()

test_environment_variables(${target}
""
${TESTS_ENVIRONMENT_VARIABLES}
${TESTS_ENVIRONMENT_VARIABLES_COB}
)
25 changes: 12 additions & 13 deletions source/ports/node_port/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ describe('metacall', () => {
assert.notStrictEqual(script, undefined);
assert.strictEqual(script.name, 'ducktype');
});
// Cobol tests are conditional (in order to pass CI/CD)
if (process.env['OPTION_BUILD_LOADERS_COB']) {
it('metacall_load_from_file (cob)', () => {
assert.strictEqual(metacall_load_from_file('cob', [ 'say.cob' ]), undefined);

const script = metacall_handle('cob', 'say');
assert.notStrictEqual(script, undefined);
assert.strictEqual(script.name, 'say');

assert.strictEqual(metacall('say', 'Hello, ', 'world!'), 0);
});
}
it('require (mock)', () => {
const asd = require('asd.mock');
assert.notStrictEqual(asd, undefined);
Expand All @@ -61,19 +73,6 @@ describe('metacall', () => {
assert.strictEqual(asd.three_str('a', 'b', 'c'), 'Hello World');
assert.strictEqual(asd.mixed_args('a', 3, 4, 3.4, 'NOT IMPLEMENTED'), 65);
});
it('metacall_load_from_file (cob)', () => {
assert.strictEqual(metacall_load_from_file('cob', [ 'say.cob' ]), undefined);

const script = metacall_handle('cob', 'say');

// Cobol tests are optional (in order to pass CI/CD)
if (script) {
assert.notStrictEqual(script, undefined);
assert.strictEqual(script.name, 'say');

assert.strictEqual(metacall('say', 'Hello, ', 'world!'), 0);
}
});
it('require (py)', () => {
const example = require('example.py');
assert.notStrictEqual(example, undefined);
Expand Down

0 comments on commit 84bd16c

Please sign in to comment.