update test script to scan directory