Skip to content
This repository was archived by the owner on Sep 19, 2025. It is now read-only.

Commit 0a5e429

Browse files
author
Tyler Breisacher
committed
Add a test that the compiler submodule is synced to the right commit
This would fail if, for instance, the person doing the release did a 'git pull' instead of 'git checkout v20160713'
1 parent 35bb7c2 commit 0a5e429

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

test/compiler.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@
2525
var should = require('should');
2626
var compilerPackage = require('../');
2727
var Compiler = compilerPackage.compiler;
28+
var packageInfo = require('../package.json');
2829
var Semver = require('semver');
2930
var compilerVersionExpr = /^Version:\sv(.*)$/m;
31+
var spawn = require('child_process').spawnSync;
3032
require('mocha');
3133

3234
var assertError = new should.Assertion('compiler version');
@@ -51,7 +53,6 @@ describe('compiler.jar', function() {
5153

5254
it('version should be equal to the package major version', function(done) {
5355
var compiler = new Compiler({ version: true});
54-
var packageInfo = require('../package.json');
5556
var packageVer = new Semver(packageInfo.version);
5657
compiler.run(function(exitCode, stdout, stderr) {
5758
var versionInfo = (stdout || '').match(compilerVersionExpr);
@@ -69,3 +70,16 @@ describe('compiler.jar', function() {
6970
});
7071
});
7172
});
73+
74+
describe('compiler submodule', function() {
75+
it('should be synced to the tagged commit', function() {
76+
var gitCmd = spawn('git', ['tag', '--points-at', 'HEAD'], {
77+
cwd: './compiler'
78+
});
79+
should(gitCmd.status).eql(0)
80+
var currentTag = gitCmd.stdout.toString().replace(/\s/g, '');
81+
var packageVer = new Semver(packageInfo.version);
82+
var mvnVersion = 'v' + packageVer.major;
83+
should(currentTag).eql(mvnVersion)
84+
});
85+
});

0 commit comments

Comments
 (0)