diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f156ea8..1f306d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,11 +60,11 @@ jobs: python tools/extract_code.py "bin/test.copapy" "bin/test.copapy.bin" objdump --disassembler-color=on -D -b binary -m i386:x86-64 --adjust-vma=0x1000 bin/test.copapy.bin > bin/test.copapy.asm echo '
test.copapy.asm
' >> $GITHUB_STEP_SUMMARY
- cat bin/test.copapy.asm | ansi2html >> $GITHUB_STEP_SUMMARY
+ cat bin/test.copapy.asm | ansi2html -i >> $GITHUB_STEP_SUMMARY
echo '' >> $GITHUB_STEP_SUMMARY
objdump --disassembler-color=on -d -j .text src/copapy/obj/stencils_x86_64_O3.o > bin/stencils_x86_64_O3.asm
echo 'stencils_x86_64_O3.asm
' >> $GITHUB_STEP_SUMMARY
- cat bin/stencils_x86_64_O3.asm | ansi2html >> $GITHUB_STEP_SUMMARY
+ cat bin/stencils_x86_64_O3.asm | ansi2html -i >> $GITHUB_STEP_SUMMARY
echo '' >> $GITHUB_STEP_SUMMARY
- name: Run tests with pytest
diff --git a/tests/test_compile.py b/tests/test_compile.py
index ecd3630..87576ef 100644
--- a/tests/test_compile.py
+++ b/tests/test_compile.py
@@ -36,7 +36,6 @@ def test_example():
def function(c1, c2):
i1 = c1 // 3.3 + 5
i2 = c2 * 5 + c1
- #r1 = i1 + i2 * 55 / 4
r1 = i1 + i2 * 55 / 4
r2 = 4 * i2 + 5
@@ -48,8 +47,8 @@ def test_compile():
c1 = CPVariable(4)
c2 = CPVariable(2)
- #ret = function(c1, c2)
- ret = [c1 // 3.3 + 5]
+ ret = function(c1, c2)
+ #ret = [c1 // 3.3 + 5]
out = [Write(r) for r in ret]
@@ -58,8 +57,8 @@ def test_compile():
# run program command
il.write_com(binwrite.Command.RUN_PROG)
- #for net in ret:
- # copapy.add_read_command(il, variables, net)
+ for net in ret:
+ copapy.add_read_command(il, variables, net)
il.write_com(binwrite.Command.END_COM)
diff --git a/tests/test_coparun_module.py b/tests/test_coparun_module.py
index d6c5563..cd0adfd 100644
--- a/tests/test_coparun_module.py
+++ b/tests/test_coparun_module.py
@@ -3,9 +3,13 @@ from pytest import approx
def function(c1):
- r1 = c1 / 2
+ i1 = c1 / 4 + c1 / -4 - c1 // 4 * c1 // -4 + (c1 * -1) // 4
- return [r1]
+ r1 = i1 / 32.4 + 54 * c1
+ r2 = 65 * c1 + 8
+ r3 = c1 > r2
+
+ return [r1, r2, r3]
def test_compile():
diff --git a/tests/test_ops.py b/tests/test_ops.py
index b424a45..328f63f 100644
--- a/tests/test_ops.py
+++ b/tests/test_ops.py
@@ -29,8 +29,8 @@ def test_compile():
c_f = CPVariable(1.111)
c_b = CPVariable(True)
- ret_test = function1(c_i) + function1(c_f) #+ function2(c_i) + function2(c_f) + function3(c_i) + function4(c_i) + function5(c_b) + [CPVariable(9) % 2]
- ret_ref = function1(9) + function1(1.111) #+ function2(9) + function2(1.111) + function3(9) + function4(9) + function5(True) + [9 % 2]
+ ret_test = function1(c_i) + function1(c_f) + function2(c_i) + function2(c_f) + function3(c_i) + function4(c_i) + function5(c_b) + [CPVariable(9) % 2]
+ ret_ref = function1(9) + function1(1.111) + function2(9) + function2(1.111) + function3(9) + function4(9) + function5(True) + [9 % 2]
print(ret_test)