示例#1
0
def output(p, f):
    tmp_file = '__tmp'
    tfile = open(tmp_file, 'w')
    for e in sorted(list(set(p))):
        tfile.write(e)
    tfile.close()
    format_srcfile(tmp_file)
    compare_srcfile(tmp_file, f)
示例#2
0
def output(fns, tests, f):
    tmp_file = '__tmp'
    tfile = open(tmp_file, 'w')
    for e in sorted(list(set(fns))):
        tfile.write(e)

    tfile.write('\n#ifdef HAVE_UNITTEST\n')
    for e in sorted(list(set(tests))):
        tfile.write(e)
    tfile.write('\n#endif\n')

    tfile.close()
    format_srcfile(tmp_file)
    compare_srcfile(tmp_file, f)
示例#3
0
        *     Return the static configuration entry for a test.
        */
    const WT_CONFIG_ENTRY *
    __wt_test_config_match(const char *test_name)
    {
        const WT_CONFIG_ENTRY *ep;

        for (ep = config_entries; ep->method != NULL; ++ep)
            if (strcmp(test_name, ep->method) == 0)
                return (ep);
        return (NULL);
    }
    ''')

tfile.close()
format_srcfile(tmp_file)
compare_srcfile(tmp_file, f)

# Update the config.h file with the #defines for the configuration entries.
if not test_config:
    tfile = open(tmp_file, 'w')
    skip = 0
    config_file = '../src/include/config.h'
    for line in open(config_file, 'r'):
        if skip:
            if 'configuration section: END' in line:
                tfile.write('/*\n' + line)
                skip = 0
        else:
            tfile.write(line)
        if 'configuration section: BEGIN' in line: