The automake manual says: "the contents of a non-empty AM_TESTS_ENVIRONMENT must be terminated by a semicolon." Without the semicolon, the perl command will indefinitely wait for input from stdin.