Exemplo n.º 1
0
static void manual_metadata(char *configFile)
{
  char inFile[1024];
  char specsFile[1024];
  int ii, suite_passed = TRUE;
  test_config *cfg = read_test_config(configFile);

  if (strcmp_case(cfg->general->status, "new") != 0)
    asfPrintError("Can't run manual tests. Current status: '%s'\nTo run these "
		  "tests manually, reset the general status to 'new'\n", 
		  cfg->general->status);
  asfPrintStatus("   Suite: %s\n", cfg->general->suite);
  for (ii=0; ii<cfg->general->test_count; ii++) {
    strcpy(inFile, cfg->test[ii]->file);
    strcpy(specsFile, cfg->test[ii]->specs);
    asfPrintStatus("\n   Test[%d]: %s ...\n", ii+1, cfg->test[ii]->test);
    if (strcmp_case(cfg->test[ii]->status, "skip") != 0) {
      if (meta_test_ext(inFile, specsFile, REPORT_LEVEL_STATUS)) {
	asfPrintStatus("   Test passed\n");
	strcpy(cfg->test[ii]->status, "passed");
      }
      else {
	asfPrintStatus("   Test failed\n");
	strcpy(cfg->test[ii]->status, "failed");
	suite_passed = FALSE;
      }
    }
    else
      asfPrintStatus("   Test skipped\n");
  }
  if (suite_passed) {
    asfPrintStatus("\n   Suite passed\n\n");
    strcpy(cfg->general->status, "passed");
  }
  else {
    asfPrintStatus("\n   Suite failed\n\n");
    strcpy(cfg->general->status, "failed");
  }
  write_test_config(configFile, cfg);
  free_test_config(cfg);  
}
Exemplo n.º 2
0
int meta_test(char *in_file, char *spec_file)
{
  return meta_test_ext(in_file, spec_file, REPORT_LEVEL_NONE);
}