See https://code.google.com/p/googletest/source/browse/trunk/scripts/pump.py for the original.