Add a -N option to vvp. This option causes the $stop task to exit the simulator (just like the -n option does), but with an exit code of 1 so that external automated test scripts can detect a testbench failure.
2009-04-30 13:33:35 UTC in Icarus Verilog