1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2026-04-20 15:16:38 +00:00

setMainFile() starts 1st build; multiple listing files for DASM includes; updated tests

This commit is contained in:
Steven Hugg
2018-08-04 10:21:50 -04:00
parent cfb5f7f59d
commit 0cb8ea7661
8 changed files with 65 additions and 17 deletions
+5 -4
View File
@@ -79,13 +79,13 @@ describe('Store', function() {
var project = new prj.CodeProject(worker, test_platform_id, platform, store);
project.loadFiles(['test'], function(err, result) {
assert.equal(null, err);
assert.deepEqual([ { path: 'test', filename: 'test', data: 'a' } ], result);
assert.deepEqual([ { path: 'test', filename: 'test', data: 'a', link:true } ], result);
done();
});
});
});
it('Should build project', function(done) {
it('Should build linked project', function(done) {
localStorage.clear();
localItems['__migrated__TEST'] = 'true';
var msgs = [];
@@ -94,7 +94,7 @@ describe('Store', function() {
{ preload: 'dasm', platform: '_TEST' },
{
buildsteps: [
{ path: "test.a", platform: "_TEST", tool: "dasm", mainfile:true },
{ path: "test.a", platform: "_TEST", tool: "dasm", mainfile:true, files:["test.a"] },
],
updates: [
{ path: "test.a", data: " lda #0" }
@@ -111,6 +111,7 @@ describe('Store', function() {
var project = new prj.CodeProject(worker, test_platform_id, platform, store);
project.callbackBuildStatus = function(b) { msgs.push(b) };
project.updateFile('test.a', ' lda #0');
project.setMainFile('test.a');
project.updateFile('test.a', ' lda #1'); // don't send twice (yet)
assert.deepEqual(msgs, expectmsgs);
store.getItem('test.a', function(err, result) {
@@ -122,7 +123,7 @@ describe('Store', function() {
// lines: [ { line: 3, offset: 61440, insns: 'a9 00', iscode: true } ] }
it('Should build project', function(done) {
it('Should build asm project', function(done) {
localStorage.clear();
localItems['__migrated__TEST'] = 'true';
var msgs = [];
+19
View File
@@ -0,0 +1,19 @@
var vm = require('vm');
var fs = require('fs');
var assert = require('assert');
var includeInThisContext = function(path) {
var code = fs.readFileSync(path);
vm.runInThisContext(code, path);
};
includeInThisContext("gen/emu.js");
includeInThisContext("gen/util.js");
includeInThisContext("src/platform/nes.js");
describe('LZG', function() {
it('Should decode LZG', function() {
var rom = new Uint8Array(new lzgmini().decode(NES_CONIO_ROM_LZG));
assert.equal(40977, rom.length);
});
});