building file test logic