Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(#248): added tests option to unphi command #249

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eo-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.35.3
0.35.6
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/commands/unphi.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ module.exports = function(opts) {
[
`-Deo.unphiInputDir=${input}`,
`-Deo.unphiOutputDir=${output}`,
opts.tests ? '-Deo.unphiMetas=+tests' : ''
]
),
opts.target, opts.batch
Expand Down
3 changes: 2 additions & 1 deletion src/eoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,11 @@ program.command('phi')
});

program.command('unphi')
.option('--tests', 'Add "+tests" meta to result XMIR files')
.description('Generate XMIR files from PHI files')
.action((str, opts) => {
clear(str);
unphi(program.opts());
unphi({...program.opts(), ...str});
});

program.command('print')
Expand Down
1 change: 1 addition & 0 deletions test/commands/test_dataize.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const {runSync, parserVersion, homeHash} = require('../helpers');

const versions = new Map([
[parserVersion, homeHash],
['0.35.2', '130afdd1456a0cbafd52aee8d7bc612e1faac547'],
['0.35.1', '130afdd1456a0cbafd52aee8d7bc612e1faac547'],
['0.34.1', '1d605bd872f27494551e9dd2341b9413d0d96d89'],
]);
Expand Down
12 changes: 9 additions & 3 deletions test/commands/test_unphi.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
const fs = require('fs');
const path = require('path');
const {runSync, assertFilesExist, parserVersion, homeHash} = require('../helpers');
const assert = require('assert');

describe('unphi', function() {
it('converts PHI files to XMIR files', function(done) {
Expand All @@ -36,15 +37,20 @@ describe('unphi', function() {
'unphi',
'--verbose',
'--track-optimization-steps',
'--tests',
'--parser=' + parserVersion,
'--hash=' + homeHash,
'-t', path.resolve(home, 'target'),
]);
const unphied = 'target/unphi/app.xmir';
assertFilesExist(
stdout, home,
[
'target/unphi/app.xmir',
]
[unphied]
);
assert.ok(
fs.readFileSync(path.resolve(home, unphied)).toString().includes(
'<head>tests</head>'
)
);
done();
});
Expand Down
2 changes: 1 addition & 1 deletion test/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
// When you upgrade them, don't forget to place old values to the
// "test_dataize.js" table of versions, in order to make sure we
// do test dataization with all possible old versions.
module.exports.parserVersion = '0.35.2';
module.exports.parserVersion = '0.35.6';
module.exports.homeHash = '130afdd1456a0cbafd52aee8d7bc612e1faac547';

/**
Expand Down
Loading