Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  unittest.g   Sprache: unbekannt

 
CurrentTestPrefix := "";
NumTestErrors := 0;

TestPrefix := function(title)
  CurrentTestPrefix := title;
end;

TestReportAndExit := function()
  if NumTestErrors = 1 then
    Print("*** 1 error occurred.\n");
    GapExitCode(1);
  elif NumTestErrors > 1 then
    Print("*** ", NumTestErrors, " errors occurred.\n");
    GapExitCode(1);
  else
    Print("*** No errors occurred.\n");
  fi;
end;

TestGeneral := function(success, message)
  local out;
  if success then
    out := "[+] ";
  else
    out := "[-] ";
    NumTestErrors := NumTestErrors + 1;
  fi;
  Append(out, INPUT_FILENAME());
  Append(out, ":");
  Append(out, String(INPUT_LINENUMBER()));
  if CurrentTestPrefix <> "" or message <> "" then
    Append(out, " (");
    if CurrentTestPrefix <> "" then
      Append(out, CurrentTestPrefix);
      if message <> "" then
        Append(out, ", ");
        Append(out, message);
      fi;
    else
      Append(out, message);
    fi;
    Append(out, ")");
  fi;
  while Length(out) < 50 do
    Add(out, ' ');
  od;
  Print(out, "\n");
end;

TestTrue := function(arg)
  if IsBound(arg[2]) then
    TestGeneral(arg[1], arg[2]);
  else
    TestGeneral(arg[1], "");
  fi;
end;

TestFalse := function(arg)
  if IsBound(arg[2]) then
    TestGeneral(not arg[1], arg[2]);
  else
    TestGeneral(not arg[1], "");
  fi;
end;

TestEqual := function(arg)
  if IsBound(arg[3]) then
    TestGeneral(arg[1] = arg[2], arg[3]);
  else
    TestGeneral(arg[1] = arg[2], "");
  fi;
end;

[ Dauer der Verarbeitung: 0.3 Sekunden  (vorverarbeitet)  ]

                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge