Program UnitTestsX86;
@projectsettings "amstradcpc_options" "-O system.printer=1 -O file.printer_file=/tmp/printer.dat"
@use "system/memory"
@use "unittests/unittests"
@use "unittests/common"
@use "system/file"

var
	f : File::File;
	
procedure TestResult(txt:pointer);
begin
	Screen::NewLine();
	Screen::Print(txt);	
	Screen::NewLine();
end;

procedure SaveResult();
begin
	f.Create("RESULT.BIN");
	f.Open("RESULT.BIN",File::W);
	f.Write(1,#Common::unittests_status);
	f.Close();
end;

begin
	Unittests::Exec();
	if Common::unittests_status = 0 then
		TestResult("SUCCESS!")
	else
	TestResult("FAILURE!");

	SaveResult();
	Memory::Quit();	       		
end.