Commit Graph

5317 Commits

Author SHA1 Message Date
Kartik Agaram
23bc3650e0 .
reorg in subx-common.subx
2019-07-07 22:51:29 -07:00
Kartik Agaram
c38b36e260 move is-label? to subx-common 2019-07-07 22:49:04 -07:00
nc
c0a904382b made first compute-offset test pass 2019-07-07 21:19:50 -04:00
nc
c17643b7a8 remove segfaults in survey.subx 2019-07-07 19:41:26 -04:00
Kartik Agaram
fb8474af88 new failing test: emit-segments
Now the only piece I plan to not write tests for is emit-headers.
2019-07-07 13:19:51 -07:00
Kartik Agaram
633c289f30 . 2019-07-07 13:13:38 -07:00
Kartik Agaram
764b5726df move phase 3 out of helpers 2019-07-07 13:13:38 -07:00
nc
b95060262e cleanup in compute-offset and fix bug in compute-width 2019-07-07 15:39:35 -04:00
nc
9ac5834194 more progress in compute-offset 2019-07-04 22:59:15 -04:00
nc
f80a025e52 implement segment section in compute-offsets 2019-07-04 12:21:41 -04:00
Kartik Agaram
c015791e80 .
Fix a couple of syntax errors.

survey.subx still failing tests.
2019-07-04 00:02:53 -07:00
Kartik Agaram
06abba2607 Merge branch 'master' into survey
High time we pulled in the final changes to dquotes.

In the process we fix one recently introduced duplicate symbol.
2019-07-03 23:56:48 -07:00
Kartik Agaram
76aec0e636 .
Get 'assort.subx' working again.
2019-07-03 23:51:40 -07:00
Kartik Agaram
85cc81a5fb .
Revert a bad merge.
2019-07-03 23:51:33 -07:00
nc
d818fdd7e5 add todo for section thats not quite complete 2019-07-03 23:04:24 -04:00
nc
98096ca81e add is-label block 2019-07-03 23:02:14 -04:00
nc
87ef858628 updates to survey - part of compute-offsets implemented 2019-07-03 22:39:47 -04:00
Kartik Agaram
34cf8a7034 subx/survey: now computing label addresses 2019-07-02 14:24:44 -07:00
Kartik Agaram
7895d0a480 .
subx/survey/compute-addresses: Now computing segment starting addresses
correctly.
2019-07-02 13:45:48 -07:00
Kartik Agaram
9d5ba2dfbf . 2019-07-02 00:16:23 -07:00
Kartik Agaram
dc8484384e . 2019-07-02 00:14:03 -07:00
Kartik Agaram
1c576e99d7 error in pseudocode for compute-offsets 2019-07-02 00:00:58 -07:00
Kartik Agaram
13be43dff9 .
Now tracing segment names correctly.
2019-07-01 23:46:22 -07:00
Kartik Agaram
22cea315f5 . 2019-07-01 23:29:14 -07:00
Kartik Agaram
0e510776d3 . 2019-07-01 23:24:45 -07:00
Kartik Agaram
065b82af2e .
Make `compute-addresses` less clever. Stop striding from the middle of
one row to the next. This way we'll also obviate the need for indexing
backwards from a pointer in the next commit.
2019-07-01 23:09:58 -07:00
Kartik Agaram
120a740871 some primitives for emitting traces
Kinda hacky, but might scale enough for machine code.

This was really hard to debug. Single tests passed, but when I ran all
tests I got breakage because tests long before (from the 056trace layer)
were not cleaning up properly.

My instinct was to call clear-stream on Trace-stream, which was wrong
(the trace didn't have the wrong contents, it was literally a bad
object). It was also wrong in a counter-productive way: calling
clear-stream on a real Trace stream (which is the size of a page of
memory) takes a long time in emulated mode.
2019-07-01 23:09:58 -07:00
Kartik Agaram
4d0a047f65 . 2019-07-01 23:09:58 -07:00
Kartik Agaram
51c311d5f9 unsigned comparison for addresses in more places 2019-07-01 23:09:58 -07:00
Kartik Agaram
954133e200 . 2019-07-01 23:09:58 -07:00
Kartik Agaram
eada7e30a0 .
When rerunning most recently run test, also load the same files as
before. Try the following commands in sequence:

  $ ./run_one_test.sh 056trace.subx test-compute-addresses        # 1
  0 error: missing reference to global 'test-compute-addresses'
  $ ./run_one_test.sh apps/survey.subx test-compute-addresses     # 2
  $ ./run_one_test.sh 056trace.subx trace  # run previous test    # 3

Now command 3 will work, and it will behave identically to command 2.

This way I can switch to another file in Vim and hit `\t` in a random
place in the file and still have the previously run test be rerun.
2019-07-01 23:09:58 -07:00
Kartik Agaram
7a276d63c0 . 2019-07-01 23:09:58 -07:00
Kartik Agaram
5a917623e1 . 2019-07-01 23:09:58 -07:00
Kartik Agaram
0fab3deb6c .
Simplify run_one_test.sh. We already create /tmp/run_one_test.subx, we
don't need to track more state across runs.
2019-07-01 23:09:58 -07:00
Kartik Agaram
89a7cac6c9 .
Fix some comments.
2019-07-01 23:09:58 -07:00
Kartik Agaram
5df043bd95 . 2019-07-01 23:09:58 -07:00
Kartik Agaram
b41c2c7184 . 2019-07-01 23:09:58 -07:00
nc
676a80bf15 add test data 2019-06-29 18:03:56 -04:00
nc
0721fb5891 Implement is-label? 2019-06-29 17:59:14 -04:00
Kartik Agaram
aa09f29419 . 2019-06-28 18:24:44 -07:00
Kartik Agaram
8e9fde4210 initial draft of solution for 'compute-addresses'
No trace statements yet, so we don't know if it works.
2019-06-28 18:20:21 -07:00
Kartik Agaram
397f7c4687 . 2019-06-28 17:31:33 -07:00
Kartik Agaram
33ba3de93d .
Clean up CI.
2019-06-28 16:56:21 -07:00
Kartik Agaram
a7e21dbdf7 .
Flesh out final test some more. We also now have a new family of
primitives for writing non-strings to input streams in tests.
2019-06-28 16:54:41 -07:00
Kartik Agaram
5be5fcd7eb fix layout and some comments
When two assertions don't share context they're clearer when separated.
2019-06-17 01:03:22 -07:00
Kartik Agaram
3b2d621be4 .
Move tests adjacent to function being tested.

Originally I didn't expect the helpers to get their own tests. But even
so, arguably the original layout was less clear.
2019-06-17 00:52:07 -07:00
Kartik Agaram
f3d3c4ec2a . 2019-06-17 00:50:42 -07:00
Kartik Agaram
ff30b00b14 .
Make a test a little less confusing; stream was initialized with data
filled in but outside bounds.
2019-06-17 00:50:42 -07:00
Kartik Agaram
21299a301a fix two hangs in trace-scan
1. skip-next-line should skip newline
2. trace-scan was falling into an infinite loop on non-matching lines
2019-06-17 00:43:29 -07:00
Kartik Agaram
8effbb4714 move test data to bottom of file 2019-06-17 00:43:29 -07:00