The problem isn't GUI or ncurses, the problem is if the test blocks (i.e. doesn't exit with a clean exist code without user input).