From b171def11aa4b69cdda032a66c19ce97f5e12cf8 Mon Sep 17 00:00:00 2001 From: Steven Hugg Date: Thu, 11 Oct 2018 11:08:15 -0400 Subject: [PATCH] fixed some tests --- test/cli/testasm.js | 4 ++-- test/cli/testplatforms.js | 7 ++++--- test/cli/testverilog.js | 5 ++++- test/cli/testworker.js | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/test/cli/testasm.js b/test/cli/testasm.js index 9d353d5a..04fe13cc 100644 --- a/test/cli/testasm.js +++ b/test/cli/testasm.js @@ -38,7 +38,7 @@ var includeInThisContext = function(path) { vm.runInThisContext(code, path); }; -includeInThisContext("gen/worker/assembler.js"); +var assembler = require("gen/worker/assembler.js"); describe('Assemble', function() { it('Should assemble', function() { @@ -76,7 +76,7 @@ WaitVsync: sta 0 jmp DisplayLoop `; - var asm = new Assembler(EXAMPLE_SPEC); + var asm = new assembler.Assembler(EXAMPLE_SPEC); var result = asm.assembleFile(source); //console.log(result); //assert.equal(result, {}); diff --git a/test/cli/testplatforms.js b/test/cli/testplatforms.js index 63ce4538..a0ff6d72 100644 --- a/test/cli/testplatforms.js +++ b/test/cli/testplatforms.js @@ -19,12 +19,13 @@ global['$'] = require("jquery/jquery-2.2.3.min.js"); includeInThisContext("javatari.js/release/javatari/javatari.js"); Javatari.AUTO_START = false; includeInThisContext('src/cpu/z80fast.js'); -//includeInThisContext('tss/js/Log.js'); -global.Log = require('tss/js/Log.js').Log; +includeInThisContext('tss/js/Log.js'); +//global.Log = require('tss/js/Log.js').Log; includeInThisContext('tss/js/tss/PsgDeviceChannel.js'); includeInThisContext('tss/js/tss/MasterChannel.js'); includeInThisContext('tss/js/tss/AudioLooper.js'); -includeInThisContext("jsnes/jsnes.min.js"); +//includeInThisContext("jsnes/jsnes.min.js"); +global.jsnes = require("jsnes/jsnes.min.js"); var emu = require('gen/emu.js'); var Keys = emu.Keys; diff --git a/test/cli/testverilog.js b/test/cli/testverilog.js index c14a2da5..43119a7c 100644 --- a/test/cli/testverilog.js +++ b/test/cli/testverilog.js @@ -9,8 +9,11 @@ var VerilogPlatform = emu.PLATFORMS['verilog']; Object.assign(global, verilog); // copy global VL_* properties +// TODO: must define $ + function loadPlatform(msg) { var platform = new VerilogPlatform(); + platform.resume = function() { }; // prevent resume after reset try { //console.log(msg.output.ports); //console.log(msg.output.signals); @@ -28,7 +31,7 @@ function loadPlatform(msg) { assert.deepEqual(state, platform.saveState()); } catch (e) { //platform.printErrorCodeContext(e, msg.output.code); - console.log(msg.intermediate.listing); + //console.log(msg.intermediate.listing); console.log(msg.output.code); console.log(e); throw e; diff --git a/test/cli/testworker.js b/test/cli/testworker.js index 687f6d73..e8303469 100644 --- a/test/cli/testworker.js +++ b/test/cli/testworker.js @@ -197,7 +197,7 @@ describe('Worker', function() { assert.ok(fn); done(err, msg); }; - doBuild(msgs, done2, 49699, 0, 0); + doBuild(msgs, done2, 51459, 0, 0); }); it('should compile verilog assembler file (JSASM)', function(done) { var csource = ab2str(fs.readFileSync('presets/verilog/test2.asm'));