khimru/ncval_ragel — pull request #2 by pasko (2012-01-24 13:31:10+00:00)
Title: Parallelize the decoder test.

The main goal is to speed up testing x20. Now the test runs in less than an hour
using 5-7 active threads on my 8 core machine.

The decoder test was essentially reimplemented:
* rewrote the python generator of recognizable instructions into C to:
* avoid dependence on python lxml:
* ragel generates the dot file with all states and transitions
* a python script parses the dot file with a few regexps and produces C code
to initialize the C generator
* speed up the generation more than 10x
* wrote a new test runner that processes files produced by the generator in
parallel
* new testing target "check-n", will be renamed back to "check" in the next
commit
* also fix getting the binutils tarball by providing it the directory where to
work

New files:
* parse_dfa.py:
parses the dot file and produces test_dfa_transitions.c
* test_dfa_transitions.c:
code in C to define the ragel state machine: states and transitions
* test_dfa.c:
the generator of valid instruction sequences, produces assembly files
* test_dfa.h:
a common header included in both the generator and the automata definition
* run_objdump_test.py:
the script that tests individual files coming from the generator in parallel
* decoder_test_one_file.sh:
the script that takes a single generated file, runs assembler, decoder,
objdump, compares results