From 211f4ecee5eb1cb99cb81336dd8a0d3a4d3d460d Mon Sep 17 00:00:00 2001 From: Yegor Bugayenko Date: Sat, 11 May 2024 02:55:24 -0400 Subject: [PATCH] #280 --home-tag --- .github/workflows/itest.yml | 6 +++--- src/eoc.js | 2 +- src/mvnw.js | 2 +- test/commands/test_assemble.js | 4 ++-- test/commands/test_compile.js | 8 ++++---- test/commands/test_dataize.js | 8 ++++---- test/commands/test_foreign.js | 6 +++--- test/commands/test_link.js | 4 ++-- test/commands/test_parse.js | 4 ++-- test/commands/test_phi.js | 4 ++-- test/commands/test_print.js | 4 ++-- test/commands/test_sodg.js | 4 ++-- test/commands/test_test.js | 4 ++-- test/commands/test_transpile.js | 4 ++-- test/commands/test_unphi.js | 4 ++-- test/commands/test_verify.js | 4 ++-- test/helpers.js | 2 +- 17 files changed, 37 insertions(+), 37 deletions(-) diff --git a/.github/workflows/itest.yml b/.github/workflows/itest.yml index 09949e2..b9f0185 100644 --- a/.github/workflows/itest.yml +++ b/.github/workflows/itest.yml @@ -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 diff --git a/src/eoc.js b/src/eoc.js index bf18ac7..dd173da 100755 --- a/src/eoc.js +++ b/src/eoc.js @@ -73,7 +73,7 @@ program program .option('-s, --sources ', 'Directory with .EO sources', '.') .option('-t, --target ', 'Directory with all generated files', '.eoc') - .option('--hash ', 'Hash in objectionary/home to compile against', hash) + .option('--home-tag ', 'Git tag in objectionary/home to compile against', hash) .option('--parser ', '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') diff --git a/src/mvnw.js b/src/mvnw.js index e961eff..a97d8d2 100644 --- a/src/mvnw.js +++ b/src/mvnw.js @@ -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' : '', diff --git a/test/commands/test_assemble.js b/test/commands/test_assemble.js index 9b92f90..44e0dbf 100644 --- a/test/commands/test_assemble.js +++ b/test/commands/test_assemble.js @@ -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) { @@ -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'), ]); diff --git a/test/commands/test_compile.js b/test/commands/test_compile.js index 2deb777..36f4d21 100644 --- a/test/commands/test_compile.js +++ b/test/commands/test_compile.js @@ -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) { @@ -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'), ]); @@ -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'), ]); @@ -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'), ]); diff --git a/test/commands/test_dataize.js b/test/commands/test_dataize.js index 82942c0..9aba7d2 100644 --- a/test/commands/test_dataize.js +++ b/test/commands/test_dataize.js @@ -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'); @@ -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'), ]); diff --git a/test/commands/test_foreign.js b/test/commands/test_foreign.js index 72b3a1c..be464e0 100644 --- a/test/commands/test_foreign.js +++ b/test/commands/test_foreign.js @@ -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) { @@ -44,7 +44,7 @@ describe('foreign', function() { 'assemble', '--verbose', '--parser=' + parserVersion, - '--hash=' + homeHash, + '--home-tag=' + homeTag, '-s', path.resolve(home, 'src'), '-t', path.resolve(home, 'target'), ]); @@ -52,7 +52,7 @@ describe('foreign', function() { 'foreign', '--verbose', '--parser=' + parserVersion, - '--hash=' + homeHash, + '--home-tag=' + homeTag, '-t', path.resolve(home, 'target'), ]); assertFilesExist( diff --git a/test/commands/test_link.js b/test/commands/test_link.js index 268682d..9a77e28 100644 --- a/test/commands/test_link.js +++ b/test/commands/test_link.js @@ -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) { @@ -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'), ]); diff --git a/test/commands/test_parse.js b/test/commands/test_parse.js index defc6a8..f15f86f 100644 --- a/test/commands/test_parse.js +++ b/test/commands/test_parse.js @@ -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) { @@ -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'), ]); diff --git a/test/commands/test_phi.js b/test/commands/test_phi.js index e8e5887..0313e99 100644 --- a/test/commands/test_phi.js +++ b/test/commands/test_phi.js @@ -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) { @@ -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'), ]); diff --git a/test/commands/test_print.js b/test/commands/test_print.js index b3db48d..b53029c 100644 --- a/test/commands/test_print.js +++ b/test/commands/test_print.js @@ -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) { @@ -46,7 +46,7 @@ describe('print', function() { '--verbose', '--track-optimization-steps', '--parser=' + parserVersion, - '--hash=' + homeHash, + '--home-tag=' + homeTag, '-t', path.resolve(home, 'target'), ]); assertFilesExist( diff --git a/test/commands/test_sodg.js b/test/commands/test_sodg.js index 0a3f3bd..31e1a85 100644 --- a/test/commands/test_sodg.js +++ b/test/commands/test_sodg.js @@ -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) { @@ -36,7 +36,7 @@ describe('sodg', function() { const stdout = runSync([ 'sodg', '--parser=' + parserVersion, - '--hash=' + homeHash, + '--home-tag=' + homeTag, '--verbose', '--dot', '--include=simple', diff --git a/test/commands/test_test.js b/test/commands/test_test.js index 7979df6..39e65d2 100644 --- a/test/commands/test_test.js +++ b/test/commands/test_test.js @@ -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) { @@ -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'), ]); diff --git a/test/commands/test_transpile.js b/test/commands/test_transpile.js index ace959c..dd8da68 100644 --- a/test/commands/test_transpile.js +++ b/test/commands/test_transpile.js @@ -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) { @@ -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'), ]); diff --git a/test/commands/test_unphi.js b/test/commands/test_unphi.js index c9ac2e5..becb526 100644 --- a/test/commands/test_unphi.js +++ b/test/commands/test_unphi.js @@ -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() { @@ -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'; diff --git a/test/commands/test_verify.js b/test/commands/test_verify.js index 64b74c3..4ddbbac 100644 --- a/test/commands/test_verify.js +++ b/test/commands/test_verify.js @@ -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) { @@ -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'), ]); diff --git a/test/helpers.js b/test/helpers.js index 2031b35..faaf65c 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -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.