Support cwd file option + unit tests