use integers as states of FTS returned by `discretize`

and update the relevant test
add script to run all examples and stop at first error