Add filtering to copydir and test.