diff --git a/Gruntfile.js b/Gruntfile.js index 4e80c19..e3d3dd3 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -142,7 +142,7 @@ module.exports = function(grunt) { grunt.registerTask('workbook', ['bsim_workbook','tmsim_workbook']); grunt.registerTask('edx', ['bsim_edx','tmsim_edx']); - //grunt.registerTask('test', ['connect', 'qunit:all']) + grunt.registerTask('test', ['connect', 'qunit:all']) // Builds everything if just called as 'grunt' grunt.registerTask('default', ['bsim','jsim','tmsim']); diff --git a/bsim/assemble.js b/bsim/assemble.js index a70971d..92f1423 100644 --- a/bsim/assemble.js +++ b/bsim/assemble.js @@ -807,6 +807,13 @@ var mParsedFiles = {}; var mPendingIncludes = []; + // allow an assembler to be constructed independantly of an editor + if (editor === undefined) { + editor = { + getFile: function() { return FileSystem.getFile.apply(FileSystem, arguments); } + } + } + // Parses a macro definition var parse_macro = function(stream) { var macro_name = readSymbol(stream); @@ -1116,6 +1123,12 @@ //var can_succeed = true; var errors = []; + // metadata is optional + if(callback === undefined) { + callback = metadata; + metadata = null; + } + sources = []; // initialize list of sources parse_file(file, content, function(syntax) { var code; diff --git a/bsim/tests/assemble.js b/bsim/tests/assemble.js index 2b51445..f748e12 100644 --- a/bsim/tests/assemble.js +++ b/bsim/tests/assemble.js @@ -685,6 +685,6 @@ test(".pcheckoff works", function() { }); assembler.assemble("t.uasm", '.pcheckoff "some url" "some name" 42\n.verify 0x20 8 0x73657420 0x2e2e2e74 0xa 0x20000000 0x73ff0143 0xc15f04e0 0x42ff04e1 0xd2370056', function(success, result) { - equal(result.checkoff.running_checksum, -2102874770, "Negative checksum is calculated correctly."); + equal(result.checkoff.running_checksum, -2102874768, "Negative checksum is calculated correctly."); }); }); diff --git a/bsim/tests/verifier.js b/bsim/tests/verifier.js index eb309f5..53ec814 100644 --- a/bsim/tests/verifier.js +++ b/bsim/tests/verifier.js @@ -3,7 +3,7 @@ module("Verifiers"); test("TextVerifier", function() { var beta = new FakeBeta(); - var verifier = new BSim.TextVerifier(beta, {checksum: -318887899}); + var verifier = new BSim.TextVerifier(beta, {checksum: -318887901}); ok(!verifier.verify(), "Verification fails on un-run beta."); ok(/no simulation results/i.test(verifier.getMessage()), "Failed with no simulation results message."); beta.setCycleCount(1);