jserv / amacc

Small C Compiler generating ELF executable Arm architecture, supporting JIT execution
Other
1.01k stars 161 forks source link

Add python run test script #18

Closed yodalee closed 8 years ago

yodalee commented 8 years ago

Add a python script written in python unittest, which will use arm-linux-gnueabihf-gcc as correct answer, and test amacc output result. Using this tool I found three testcase cannot passed: char.c, ptr.c, shift.c

Usage: ./runtest.py # test every c files in tests directory
or
Usage: ./runtest.py pattern # test files in tests that file name contains pattern
example: ./runtest.py eq # only run tests/eq.c

Currently we cannot test against elf output since subprocess cannot get the output of running elf. The problem may cause by that the elf generated by amacc doesn't flush the stdout buffer before exit. If running in terminal it will be fine since libc set stdout to line buffer if isatty() == 1, however it prevent we tests it using python subprocess.

jserv commented 8 years ago

It looks great! Please fix syntax error "only filenames contain pattern will be tested".

jserv commented 8 years ago

Another syntax error: "The problem may due to that the ..."

yodalee commented 8 years ago

fixed

jserv commented 8 years ago

@yodalee : Thanks for your contributions!