Improve test framework: fix Mac OS X grep bug

Mac OS X grep(1) does not support the -V (version number compare) option.