From c25d9aa42a7d3ea142ca8cb3887030866ac32a6f Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Wed, 10 Oct 2018 23:39:50 -0700 Subject: 4684 Turns out the tests for 'trace' have been broken in native mode since the original commit (4674). Dangers of running my tests on Darwin, where I can't run them natively. The test failures didn't get flagged on CI because I'd forgotten to update the exit code of the factorial app in commit 4664. At least that's fixed in this commit. --- subx/055trace.subx | 2 +- subx/apps/crenshaw2-1 | Bin 2522 -> 2529 bytes subx/apps/factorial | Bin 2520 -> 2533 bytes subx/apps/factorial.subx | 5 +++-- subx/test_apps | 8 +++++++- 5 files changed, 11 insertions(+), 4 deletions(-) (limited to 'subx') diff --git a/subx/055trace.subx b/subx/055trace.subx index 237fbed9..68309ab0 100644 --- a/subx/055trace.subx +++ b/subx/055trace.subx @@ -219,7 +219,7 @@ test-trace-single: 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP # check-ints-equal(*Test-trace-stream.data, 41/A 62/b 0a/newline 00, msg) # push args - 68/push "F - test-trace"/imm32 + 68/push "F - test-trace-single"/imm32 68/push 0x0a6241/imm32/Ab-newline # push *Test-trace-stream.data b8/copy-to-EAX Test-trace-stream/imm32 diff --git a/subx/apps/crenshaw2-1 b/subx/apps/crenshaw2-1 index f551dbf9..40c1e72d 100755 Binary files a/subx/apps/crenshaw2-1 and b/subx/apps/crenshaw2-1 differ diff --git a/subx/apps/factorial b/subx/apps/factorial index 5b7811bc..ad2c98a4 100755 Binary files a/subx/apps/factorial and b/subx/apps/factorial differ diff --git a/subx/apps/factorial.subx b/subx/apps/factorial.subx index 8eac94bc..578aeb70 100644 --- a/subx/apps/factorial.subx +++ b/subx/apps/factorial.subx @@ -36,9 +36,10 @@ # check result 3d/compare-EAX 1/imm32 75/jump-if-not-equal $run-main/disp8 - # then + # then return run-tests() e8/call run-tests/disp32 - eb/jump $main-exit/disp8 + 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 0/r32/EAX Num-test-failures/disp32 # copy *Num-test-failures to EAX + eb/jump $main-exit/disp8 # where EAX will get copied to EBX # else EAX = factorial(5) $run-main: # push arg diff --git a/subx/test_apps b/subx/test_apps index 8f00e538..a8060016 100755 --- a/subx/test_apps +++ b/subx/test_apps @@ -115,7 +115,11 @@ echo ex11 CFLAGS=-g ./subx translate examples/ex11.subx -o examples/ex11 test `uname -m` = 'i686' && git diff --quiet examples/ex11 CFLAGS=-g ./subx run examples/ex11 -test `uname` = 'Linux' && examples/ex11 +echo +test `uname` = 'Linux' && { + examples/ex11 + echo +} echo ex12 CFLAGS=-g ./subx translate examples/ex12.subx -o examples/ex12 @@ -129,10 +133,12 @@ test `uname -m` = 'i686' && git diff --quiet apps/factorial CFLAGS=-g ./subx run apps/factorial || ret=$? test $ret -eq 120 # factorial(5) CFLAGS=-g ./subx run apps/factorial test +echo test `uname` = 'Linux' && { apps/factorial || ret=$? test $ret -eq 120 # factorial(5) apps/factorial test + echo } echo crenshaw2-1 -- cgit 1.4.1-2-gfad0