mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2024-12-26 07:29:22 +00:00
fixed vicdual skeleton test
This commit is contained in:
parent
19a38a3c5e
commit
08b32e0102
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "8bitworkshop",
|
||||
"version": "1.0.0",
|
||||
"version": "2.2.0",
|
||||
"author": "Steven Hugg",
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
|
@ -132,7 +132,7 @@ void putstring(byte x, byte y, const char* string) {
|
||||
}
|
||||
|
||||
// PC font (code page 437)
|
||||
//#link "pc437.c"
|
||||
//#link "cp437.c"
|
||||
extern byte font8x8[0x100][8];
|
||||
|
||||
const char BOX_CHARS[8] = { 218, 191, 192, 217, 196, 196, 179, 179 };
|
||||
|
@ -14,6 +14,18 @@ function compile(tool, code, platform, callback, outlen, nlines, nerrors) {
|
||||
doBuild(msgs, callback, outlen, nlines, nerrors);
|
||||
}
|
||||
|
||||
function compileFiles(tool, files, platform, callback, outlen, nlines, nerrors) {
|
||||
var msg = {updates:[], buildsteps:[]};
|
||||
for (var fn of files) {
|
||||
var text = ab2str(fs.readFileSync('presets/'+platform+'/'+fn));
|
||||
msg.updates.push({path:fn, data:text});
|
||||
msg.buildsteps.push({path:fn, platform:platform, tool:tool});
|
||||
}
|
||||
doBuild([msg], callback, outlen, nlines, nerrors);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function doBuild(msgs, callback, outlen, nlines, nerrors) {
|
||||
var msgcount = msgs.length;
|
||||
global.postMessage = function(msg) {
|
||||
@ -29,9 +41,10 @@ function doBuild(msgs, callback, outlen, nlines, nerrors) {
|
||||
nlines = [nlines];
|
||||
//console.log(msg.listings, nlines);
|
||||
var i = 0;
|
||||
for (var key in msg.listings) {
|
||||
var lstkeys = Object.keys(msg.listings);
|
||||
lstkeys.sort();
|
||||
for (var key of lstkeys) {
|
||||
var listing = msg.listings[key];
|
||||
//console.log(listing);
|
||||
assert.equal(listing.lines.length, nlines[i++], "listing lines");
|
||||
}
|
||||
}
|
||||
@ -101,10 +114,12 @@ describe('Worker', function() {
|
||||
it('should compile SDCC w/ include', function(done) {
|
||||
compile('sdcc', '#include <string.h>\nvoid main() {\nstrlen(0);\n}\n', 'mw8080bw', done, 8192, 2, 0);
|
||||
});
|
||||
/*
|
||||
it('should compile vicdual skeleton', function(done) {
|
||||
var csource = ab2str(fs.readFileSync('presets/vicdual/skeleton.sdcc'));
|
||||
compile('sdcc', csource, 'vicdual', done, 16416, 45, 0);
|
||||
});
|
||||
*/
|
||||
it('should compile mw8080 skeleton', function(done) {
|
||||
var csource = ab2str(fs.readFileSync('presets/mw8080bw/skeleton.sdcc'));
|
||||
compile('sdcc', csource, 'mw8080bw', done, 8192, 84, 0);
|
||||
@ -220,6 +235,10 @@ describe('Worker', function() {
|
||||
var msgs = [m, m, m2];
|
||||
doBuild(msgs, done, 8192, [1,1], 0);
|
||||
});
|
||||
it('should compile vicdual skeleton', function(done) {
|
||||
var files = ['skeleton.sdcc', 'cp437.c'];
|
||||
compileFiles('sdcc', files, 'vicdual', done, 16416, [0,45], 0);
|
||||
});
|
||||
// TODO: test if compile, errors, then compile same file
|
||||
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user