mirror of https://github.com/Nonannet/copapy.git
ci und test updated
This commit is contained in:
parent
46dcaf3e66
commit
04a6c7d525
|
|
@ -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 '<p>test.copapy.asm</p><code>' >> $GITHUB_STEP_SUMMARY
|
||||
cat bin/test.copapy.asm | ansi2html >> $GITHUB_STEP_SUMMARY
|
||||
cat bin/test.copapy.asm | ansi2html -i >> $GITHUB_STEP_SUMMARY
|
||||
echo '</code>' >> $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 '<p>stencils_x86_64_O3.asm</p><code>' >> $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 '</code>' >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
- name: Run tests with pytest
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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():
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue