Lines Matching defs:test
20 # Modules we want to skip in API test
181 # Extra code needed for some test cases
274 # Do not test destructors
399 global test
415 test.write("#ifdef %s\n" % (modules_defines[module]))
417 test.write("""
426 test.write("#endif\n\n")
445 # Copy the beginning of the C test program result
452 test = open('testapi.c.new', 'w')
455 global test
457 test.close()
462 test = open('testapi.c.new', "r").read()
463 if input != test:
482 test.write(line)
488 test.close()
493 test.write("/* CUT HERE: everything below that line is generated */\n")
561 test.write("#ifdef %s\n" % (modules_defines[module]))
563 test.write("#define gen_nb_%s %d\n" % (name, len(vals)))
564 test.write("""static %s gen_%s(int no, int nr ATTRIBUTE_UNUSED) {\n""" %
568 test.write(" if (no == %d) return(%s);\n" % (i, value))
570 test.write(""" return(0);
581 test.write("#ifdef %s\n" % (modules_defines[module]))
583 test.write("""static void desret_%s(%s val ATTRIBUTE_UNUSED) {
589 test.write("#endif\n\n")
608 # do not test deprecated APIs
615 test.write("#include <libxml/%s.h>\n" % name)
622 test.write("static int test_%s(void);\n" % module);
628 test.write("""
645 test.write(" test_ret += test_%s();\n" % module)
647 test.write("""
661 global test
715 test.write("""
724 test.write("""
735 test.write("#if %s\n" % (cond.get_content()))
742 test.write("#ifdef %s\n" % (function_defines[name]))
748 test.write(" int mem_base;\n");
752 test.write(" %s ret_val;\n" % (t_ret[1]))
758 test.write(" %s %s; /* %s */\n" % (crtype, nam, info))
759 test.write(" int n_%s;\n" % (nam))
760 test.write("\n")
766 test.write(" for (n_%s = 0;n_%s < gen_nb_%s;n_%s++) {\n" % (
771 test.write(" mem_base = xmlMemBlocks();\n");
778 test.write(" %s = gen_%s(n_%s, %d);\n" % (nam, type, nam, i))
783 test.write(" %s\n"% (extra_pre_call[name]))
785 test.write("\n ret_val = %s(" % (name))
790 test.write(", ")
794 test.write("(%s)" % rtype)
795 test.write("%s" % nam);
796 test.write(");\n")
798 test.write(" %s\n"% (extra_post_call[name]))
799 test.write(" desret_%s(ret_val);\n" % t_ret[0])
801 test.write("\n %s(" % (name));
806 test.write(", ")
810 test.write("(%s)" % rtype)
811 test.write("%s" % nam)
812 test.write(");\n")
814 test.write(" %s\n"% (extra_post_call[name]))
816 test.write(" call_tests++;\n");
826 test.write(" des_%s(n_%s, " % (type, nam))
828 test.write("(%s)" % rtype)
829 test.write("%s, %d);\n" % (nam, i))
832 test.write(" xmlResetLastError();\n");
835 test.write(""" if (mem_base != xmlMemBlocks()) {
842 test.write(""" printf(" %%d", n_%s);\n""" % (nam))
843 test.write(""" printf("\\n");\n""")
844 test.write(" }\n")
847 test.write(" }\n")
849 test.write(" function_tests++;\n")
854 test.write("#endif\n")
857 test.write("#endif\n")
861 test.write("""
878 # iterate over all functions in the module generating the test
886 test.write("""static int
898 test.write(" test_ret += test_%s();\n" % (name))
901 test.write("""
911 test.write("""static int
915 test.write(""" if (!strcmp(module, "%s")) return(test_%s());\n""" % (
917 test.write(""" return(0);
921 print "Generated test for %d modules and %d functions" %(len(modules), nb_tests)