static int do_test_file(const char *testfile)
{
    BIO *in;
    EVP_TEST t;
    int c;

    set_test_title(testfile);
    current_test_file = testfile;
    if (!TEST_ptr(in = BIO_new_file(testfile, "rb")))
        return 0;
    memset(&t, 0, sizeof(t));
    t.in = in;

    TEST_info("Reading %s", testfile);
    for ( ; ; ) {
        c = read_stanza(&t);
        if (t.skip)
            continue;
        if (c == 0 || !run_test(&t)) {
            t.errors++;
            break;
        }
        if (c == EOF)
            break;
    }
    clear_test(&t);

    TEST_info("Completed %d tests with %d errors and %d skipped",
              t.ntests, t.errors, t.nskip);
    free_key_list(public_keys);
    free_key_list(private_keys);
    BIO_free(t.key);
    BIO_free(in);
    return t.errors == 0;
}