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.
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.cCurrently 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 thestdout
buffer before exit. If running in terminal it will be fine sincelibc
set stdout to line buffer ifisatty() == 1
, however it prevent we tests it using python subprocess.