Bugfix: add -P option in test script

To fix the script to accept -P option.