Skip to content

Commit

Permalink
Remove files that shouldn't be in testdata
Browse files Browse the repository at this point in the history
And change default output of program to stop creating them there.
  • Loading branch information
jblebrun committed Oct 17, 2020
1 parent e9e8920 commit e94a09c
Show file tree
Hide file tree
Showing 16 changed files with 9 additions and 109 deletions.
9 changes: 7 additions & 2 deletions octopy/__main__.py
@@ -1,3 +1,4 @@
import os
import sys

from octopy.assemble import assemble
Expand All @@ -9,19 +10,23 @@

f = open(sys.argv[1])

path, filename = os.path.split(sys.argv[1])
basename, ext = os.path.splitext(filename)


program = assemble(f)

if len(sys.argv) > 2:
outname = sys.argv[2]
else:
outname = sys.argv[1].split(".")[0] + ".ch8"
outname = basename + ".ch8"
fout = open(outname, 'w')
fout.buffer.write(program.program)

if len(sys.argv) > 3:
outname = sys.argv[3]
else:
outname = sys.argv[1].split(".")[0] + ".sym"
outname = basename + ".sym"

fout = open(outname, 'w')
for name, pc in program.labels.items():
Expand Down
4 changes: 2 additions & 2 deletions scripts/testprogram.sh
@@ -1,5 +1,5 @@
#!/bin/sh

# Test that the main program runs as expected
python3 -m octopy test/testdata/loop.8o
cmp test/testdata/loop.8o.ch8 test/testdata/loop.expect.ch8
python3 -m octopy test/testdata/fibble.8o
cmp fibble.ch8 test/testdata/fibble.expect.ch8
Binary file removed test/testdata/begin.ch8
Binary file not shown.
19 changes: 0 additions & 19 deletions test/testdata/begin.sym

This file was deleted.

Binary file removed test/testdata/calls.ch8
Binary file not shown.
22 changes: 0 additions & 22 deletions test/testdata/calls.sym

This file was deleted.

Binary file removed test/testdata/etc.ch8
Binary file not shown.
19 changes: 0 additions & 19 deletions test/testdata/etc.sym

This file was deleted.

Binary file removed test/testdata/loop.8o.ch8
Binary file not shown.
1 change: 0 additions & 1 deletion test/testdata/macro.8o.ch8

This file was deleted.

1 change: 0 additions & 1 deletion test/testdata/macro.ch8

This file was deleted.

20 changes: 0 additions & 20 deletions test/testdata/macro.sym

This file was deleted.

Binary file removed test/testdata/octoballs.8o.ch8
Binary file not shown.
Binary file removed test/testdata/sinusoid.8o.ch8
Binary file not shown.
Binary file removed test/testdata/unpack.ch8
Binary file not shown.
23 changes: 0 additions & 23 deletions test/testdata/unpack.sym

This file was deleted.

0 comments on commit e94a09c

Please sign in to comment.