Generating Test Inputs from String Constraints with an Automata-Based Solver