Roxen.git / server / modules / configuration / roxen_test.pike

version» Context lines:

Roxen.git/server/modules/configuration/roxen_test.pike:40:      int is_last_test_configuration()   {    foreach(roxen.configurations, Configuration config)    if(config->call_provider("roxen_test", "is_not_finished"))    return 0;    return 1;   }      int tests, ltests, test_num; + int lskipped;   int fails, lfails;   int pass;   string tag_test_data;   int bkgr_fails;      void background_failure()   {    // Called in all configurations/instances of this module, by    // describe_backtrace() (roxenloader.pike), in self test mode. We    // need to check whether it's for us or not by checking if we're
Roxen.git/server/modules/configuration/roxen_test.pike:536:    test_error ("Failed to parse test: " +    master()->describe_backtrace (error));    fails++;    lfails++;    }       if( verbose && strlen( rxml ) ) test_ok();    return;   }    + mixed xml_testsuite(Parser.HTML file_parser, mapping args, string c, +  mapping(int:RXML.PCode) p_code_cache) { +  if (roxen.is_shutting_down()) { +  return ({}); // Stop parsing. +  } +  string env = args["if-not-env"]; +  if (env && getenv(env)) { +  if (pass == 1) { +  report_debug("Skipping tests since env. var %s is defined.\n", env); +  // Count number of tests we are skipping. +  Roxen.get_xml_parser()->add_quote_tag ("!--", "", "--") +  ->add_tags ((["test": lambda () { lskipped++; }])) +  ->finish (c); +  } +  return ({}); // Stop parsing. +  } +  return c; // Continue to parse content withing this tag. + } +    class TagTestData {    inherit RXML.Tag;    constant name = "test-data";    constant flags = RXML.FLAG_DONT_CACHE_RESULT;    array(RXML.Type) result_types = ({RXML.t_html (RXML.PXml)});       class Frame {    inherit RXML.Frame;       array do_return(RequestID id) {
Roxen.git/server/modules/configuration/roxen_test.pike:569:       // El cheapo xml header parser.    if (has_prefix (data, "<?xml")) {    sscanf (data, "%[^\n]", string s);    if (sscanf (s, "%*sencoding=\"%s\"", s) == 2)    data = Charset.decoder (s)->feed (data)->drain();    }       ltests=0;    lfails=0; +  lskipped=0;       test_num = 0;    pass = 1;    Roxen.get_xml_parser()->add_containers( ([    "add-module" : xml_add_module,    "drop-module" : xml_dummy /* xml_drop_module */,    "use-module": xml_use_module, -  +  "testsuite" : xml_testsuite,    "test" : xml_test,    "comment": xml_comment,    ]) )->    set_extra (p_code_cache, used_modules)->    finish(data);       if (roxen.is_shutting_down()) return;       int test_tags = 0;       Roxen.get_xml_parser()->add_quote_tag ("!--", "", "--")    ->add_tags ((["test": lambda () {test_tags++;}]))    ->finish (data);    -  if(test_tags != ltests) +  if(test_tags != (ltests + lskipped))    report_warning("Possibly XML error in testsuite - "    "got %d test tags but did %d tests.\n",    test_tags, ltests);       // Go through them again, evaluation from the p-code this time.    test_num = 0;    pass = 2;    Roxen.get_xml_parser()->add_containers( ([    "add-module" : xml_dummy /* xml_add_module */,    "drop-module" : xml_drop_module, -  +  "testsuite" : xml_testsuite,    "test" : xml_test,    "comment": xml_comment,    ]) )->    set_extra (p_code_cache, used_modules)->    finish(data);       if (roxen.is_shutting_down()) return;       foreach (indices (used_modules), string modname)    conf->disable_module (modname);    -  report_debug("Did %d tests, failed on %d%s.\n", ltests, lfails, +  report_debug("Did %d tests, failed on %d, skipped %d%s.\n", +  ltests, lfails, lskipped,    bkgr_fails ?    ", detected " + bkgr_fails + " background failures" : "");       if (bkgr_fails) {    fails += bkgr_fails;    bkgr_fails = 0;    }       continue_run_tests();   }