Skip to content

Commit

Permalink
#280 --home-tag
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed May 11, 2024
1 parent 9d96dc0 commit 211f4ec
Show file tree
Hide file tree
Showing 17 changed files with 37 additions and 37 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/itest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
distribution: 'zulu'
java-version: ${{ matrix.java }}
- run: npm install
- run: cd itest && node ../src/eoc.js --parser=0.36.0 --hash=afc6c10c54e28efe01f2352d699c137c3cb0a68d --batch dataize program
- run: cd itest && node ../src/eoc.js --parser=0.36.0 --hash=afc6c10c54e28efe01f2352d699c137c3cb0a68d --alone --batch dataize program
- run: cd itest && node ../src/eoc.js --parser=0.36.0 --home-tag=afc6c10c54e28efe01f2352d699c137c3cb0a68d --batch dataize program
- run: cd itest && node ../src/eoc.js --parser=0.36.0 --home-tag=afc6c10c54e28efe01f2352d699c137c3cb0a68d --alone --batch dataize program
- run: cd itest && node ../src/eoc.js clean
- run: cd itest && node ../src/eoc.js --parser=0.36.0 --hash=afc6c10c54e28efe01f2352d699c137c3cb0a68d --batch test
- run: cd itest && node ../src/eoc.js --parser=0.36.0 --home-tag=afc6c10c54e28efe01f2352d699c137c3cb0a68d --batch test
2 changes: 1 addition & 1 deletion src/eoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ program
program
.option('-s, --sources <path>', 'Directory with .EO sources', '.')
.option('-t, --target <path>', 'Directory with all generated files', '.eoc')
.option('--hash <hex>', 'Hash in objectionary/home to compile against', hash)
.option('--home-tag <version>', 'Git tag in objectionary/home to compile against', hash)
.option('--parser <version>', 'Set the version of EO parser to use', parser)
.option('--latest', 'Use the latest parser version from Maven Central')
.option('--alone', 'Just run a single command without dependencies')
Expand Down
2 changes: 1 addition & 1 deletion src/mvnw.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ module.exports.flags = function(opts) {
console.debug('Target in %s', rel(target));
return [
'-Deo.version=' + opts.parser,
'-Deo.hash=' + (opts.hash ? opts.hash : opts.parser),
'-Deo.tag=' + (opts.tag ? opts.tag : opts.parser),
opts.verbose ? '--errors' : '',
opts.verbose ? '' : '--quiet',
opts.debug ? '--debug' : '',
Expand Down
4 changes: 2 additions & 2 deletions test/commands/test_assemble.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
const assert = require('assert');
const fs = require('fs');
const path = require('path');
const {runSync, assertFilesExist, parserVersion, homeHash} = require('../helpers');
const {runSync, assertFilesExist, parserVersion, homeTag} = require('../helpers');

describe('assemble', function() {
it('assembles a simple .EO program', function(done) {
Expand All @@ -38,7 +38,7 @@ describe('assemble', function() {
'--verbose',
'--track-optimization-steps',
'--parser=' + parserVersion,
'--hash=' + homeHash,
'--home-tag=' + homeTag,
'-s', path.resolve(home, 'src'),
'-t', path.resolve(home, 'target'),
]);
Expand Down
8 changes: 4 additions & 4 deletions test/commands/test_compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const rel = require('relative');
const assert = require('assert');
const fs = require('fs');
const path = require('path');
const {runSync, assertFilesExist, parserVersion, homeHash} = require('../helpers');
const {runSync, assertFilesExist, parserVersion, homeTag} = require('../helpers');

describe('compile', function() {
it('compiles a simple .EO program into Java bytecode .class files', function(done) {
Expand All @@ -37,7 +37,7 @@ describe('compile', function() {
const stdout = runSync([
'compile',
'--parser=' + parserVersion,
'--hash=' + homeHash,
'--home-tag=' + homeTag,
'-s', path.resolve(home, 'src'),
'-t', path.resolve(home, 'target'),
]);
Expand Down Expand Up @@ -74,7 +74,7 @@ describe('compile', function() {
'compile',
'--verbose',
'--parser=' + parserVersion,
'--hash=' + homeHash,
'--home-tag=' + homeTag,
'-s', path.resolve(home, 'src'),
'-t', path.resolve(home, 'target'),
]);
Expand All @@ -97,7 +97,7 @@ describe('compile', function() {
'compile',
'--clean',
'--parser=' + parserVersion,
'--hash=' + homeHash,
'--home-tag=' + homeTag,
'-s', path.resolve(home, 'src'),
'-t', path.resolve(home, 'target'),
]);
Expand Down
8 changes: 4 additions & 4 deletions test/commands/test_dataize.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ const rel = require('relative');
const fs = require('fs');
const assert = require('assert');
const path = require('path');
const {runSync, parserVersion, homeHash} = require('../helpers');
const {runSync, parserVersion, homeTag} = require('../helpers');

const versions = new Map([
[parserVersion, homeHash],
[parserVersion, homeTag],
// They don't work, but they should:
// Let's continue after this bug is fixed: https://github.com/objectionary/eo/issues/3093
// ['0.35.2', '130afdd1456a0cbafd52aee8d7bc612e1faac547'],
// ['0.35.1', '130afdd1456a0cbafd52aee8d7bc612e1faac547'],
// ['0.34.1', '1d605bd872f27494551e9dd2341b9413d0d96d89'],
]);
versions.forEach(function(hash, version) {
versions.forEach(function(tag, version) {
describe('dataize', function() {
it('dataizes with ' + version, function(done) {
const home = path.resolve('temp/test-dataize/' + version + '/simple');
Expand All @@ -59,7 +59,7 @@ versions.forEach(function(hash, version) {
'--stack=64M',
'--clean',
'--parser=' + version,
'--hash=' + hash,
'--home-tag=' + tag,
'-s', path.resolve(home, 'src'),
'-t', path.resolve(home, 'target'),
]);
Expand Down
6 changes: 3 additions & 3 deletions test/commands/test_foreign.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
const assert = require('assert');
const fs = require('fs');
const path = require('path');
const {runSync, assertFilesExist, parserVersion, homeHash} = require('../helpers');
const {runSync, assertFilesExist, parserVersion, homeTag} = require('../helpers');

describe('foreign', function() {
it('inspects foreign objects and prints a report', function(done) {
Expand All @@ -44,15 +44,15 @@ describe('foreign', function() {
'assemble',
'--verbose',
'--parser=' + parserVersion,
'--hash=' + homeHash,
'--home-tag=' + homeTag,
'-s', path.resolve(home, 'src'),
'-t', path.resolve(home, 'target'),
]);
const stdout = runSync([
'foreign',
'--verbose',
'--parser=' + parserVersion,
'--hash=' + homeHash,
'--home-tag=' + homeTag,
'-t', path.resolve(home, 'target'),
]);
assertFilesExist(
Expand Down
4 changes: 2 additions & 2 deletions test/commands/test_link.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
const assert = require('assert');
const fs = require('fs');
const path = require('path');
const {runSync, assertFilesExist, parserVersion, homeHash} = require('../helpers');
const {runSync, assertFilesExist, parserVersion, homeTag} = require('../helpers');

describe('link', function() {
it('compiles a simple .EO program into an executable .JAR', function(done) {
Expand All @@ -47,7 +47,7 @@ describe('link', function() {
'link',
'--verbose',
'--parser=' + parserVersion,
'--hash=' + homeHash,
'--home-tag=' + homeTag,
'-s', path.resolve(home, 'src'),
'-t', path.resolve(home, 'target'),
]);
Expand Down
4 changes: 2 additions & 2 deletions test/commands/test_parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
const assert = require('assert');
const fs = require('fs');
const path = require('path');
const {runSync, assertFilesExist, parserVersion, homeHash} = require('../helpers');
const {runSync, assertFilesExist, parserVersion, homeTag} = require('../helpers');

describe('parse', function() {
it('parses a simple .EO program', function(done) {
Expand All @@ -37,7 +37,7 @@ describe('parse', function() {
'parse',
'--verbose',
'--parser=' + parserVersion,
'--hash=' + homeHash,
'--home-tag=' + homeTag,
'-s', path.resolve(home, 'src'),
'-t', path.resolve(home, 'target'),
]);
Expand Down
4 changes: 2 additions & 2 deletions test/commands/test_phi.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

const fs = require('fs');
const path = require('path');
const {runSync, assertFilesExist, parserVersion, homeHash} = require('../helpers');
const {runSync, assertFilesExist, parserVersion, homeTag} = require('../helpers');

describe('phi', function() {
it('converts XMIR files to PHI files', function(done) {
Expand All @@ -37,7 +37,7 @@ describe('phi', function() {
'--verbose',
'--track-optimization-steps',
'--parser=' + parserVersion,
'--hash=' + homeHash,
'--home-tag=' + homeTag,
'-s', path.resolve(home, 'src'),
'-t', path.resolve(home, 'target'),
]);
Expand Down
4 changes: 2 additions & 2 deletions test/commands/test_print.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

const fs = require('fs');
const path = require('path');
const {runSync, assertFilesExist, parserVersion, homeHash} = require('../helpers');
const {runSync, assertFilesExist, parserVersion, homeTag} = require('../helpers');

describe('print', function() {
it('converts XMIR files to EO files', function(done) {
Expand All @@ -46,7 +46,7 @@ describe('print', function() {
'--verbose',
'--track-optimization-steps',
'--parser=' + parserVersion,
'--hash=' + homeHash,
'--home-tag=' + homeTag,
'-t', path.resolve(home, 'target'),
]);
assertFilesExist(
Expand Down
4 changes: 2 additions & 2 deletions test/commands/test_sodg.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
const assert = require('assert');
const fs = require('fs');
const path = require('path');
const {runSync, assertFilesExist, parserVersion, homeHash} = require('../helpers');
const {runSync, assertFilesExist, parserVersion, homeTag} = require('../helpers');

describe('sodg', function() {
it('generates SODG files for a simple .EO program', function(done) {
Expand All @@ -36,7 +36,7 @@ describe('sodg', function() {
const stdout = runSync([
'sodg',
'--parser=' + parserVersion,
'--hash=' + homeHash,
'--home-tag=' + homeTag,
'--verbose',
'--dot',
'--include=simple',
Expand Down
4 changes: 2 additions & 2 deletions test/commands/test_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

const fs = require('fs');
const path = require('path');
const {runSync, assertFilesExist, parserVersion, homeHash} = require('../helpers');
const {runSync, assertFilesExist, parserVersion, homeTag} = require('../helpers');

describe('test', function() {
it('executes a single unit test', function(done) {
Expand All @@ -47,7 +47,7 @@ describe('test', function() {
'test',
'--verbose',
'--parser=' + parserVersion,
'--hash=' + homeHash,
'--home-tag=' + homeTag,
'-s', path.resolve(home, 'src'),
'-t', path.resolve(home, 'target'),
]);
Expand Down
4 changes: 2 additions & 2 deletions test/commands/test_transpile.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

const fs = require('fs');
const path = require('path');
const {runSync, assertFilesExist, parserVersion, homeHash} = require('../helpers');
const {runSync, assertFilesExist, parserVersion, homeTag} = require('../helpers');

describe('transpile', function() {
it('transpiles a simple .EO program', function(done) {
Expand All @@ -36,7 +36,7 @@ describe('transpile', function() {
'transpile',
'--verbose',
'--parser=' + parserVersion,
'--hash=' + homeHash,
'--home-tag=' + homeTag,
'-s', path.resolve(home, 'src'),
'-t', path.resolve(home, 'target'),
]);
Expand Down
4 changes: 2 additions & 2 deletions test/commands/test_unphi.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

const fs = require('fs');
const path = require('path');
const {runSync, assertFilesExist, parserVersion, homeHash} = require('../helpers');
const {runSync, assertFilesExist, parserVersion, homeTag} = require('../helpers');
const assert = require('assert');

describe('unphi', function() {
Expand All @@ -39,7 +39,7 @@ describe('unphi', function() {
'--track-optimization-steps',
'--tests',
'--parser=' + parserVersion,
'--hash=' + homeHash,
'--home-tag=' + homeTag,
'-t', path.resolve(home, 'target'),
]);
const unphied = 'target/unphi/app.xmir';
Expand Down
4 changes: 2 additions & 2 deletions test/commands/test_verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
const assert = require('assert');
const fs = require('fs');
const path = require('path');
const {runSync, assertFilesExist, parserVersion, homeHash} = require('../helpers');
const {runSync, assertFilesExist, parserVersion, homeTag} = require('../helpers');

describe('verify', function() {
it('verifies a simple .EO program', function(done) {
Expand All @@ -38,7 +38,7 @@ describe('verify', function() {
'--verbose',
'--track-optimization-steps',
'--parser=' + parserVersion,
'--hash=' + homeHash,
'--home-tag=' + homeTag,
'-s', path.resolve(home, 'src'),
'-t', path.resolve(home, 'target'),
]);
Expand Down
2 changes: 1 addition & 1 deletion test/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
// "test_dataize.js" table of versions, in order to make sure we
// do test dataization with all possible old versions.
module.exports.parserVersion = '0.36.0';
module.exports.homeHash = 'afc6c10c54e28efe01f2352d699c137c3cb0a68d';
module.exports.homeTag = '0.36.0';

/**
* Helper to run EOC command line tool.
Expand Down

0 comments on commit 211f4ec

Please sign in to comment.