2022-12-03 04:20:27 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
2022-12-05 17:58:23 +00:00
|
|
|
// SCSI Target Emulator PiSCSI for Raspberry Pi
|
2022-12-03 04:20:27 +00:00
|
|
|
// Loopback tester utility
|
|
|
|
//
|
|
|
|
// Copyright (C) 2022 akuker
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#include "scsiloop_cout.h"
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
void ScsiLoop_Cout::StartTest(const string &test_name)
|
|
|
|
{
|
|
|
|
cout << CYAN << "Testing " << test_name << ":" << WHITE;
|
|
|
|
}
|
|
|
|
void ScsiLoop_Cout::PrintUpdate()
|
|
|
|
{
|
|
|
|
cout << ".";
|
|
|
|
}
|
|
|
|
|
|
|
|
void ScsiLoop_Cout::FinishTest(const string &test_name, int failures)
|
|
|
|
{
|
|
|
|
if (failures == 0) {
|
|
|
|
cout << GREEN << "OK!" << WHITE << endl;
|
|
|
|
} else {
|
|
|
|
cout << RED << test_name << " FAILED! - " << failures << " errors!" << WHITE << endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-10-15 06:38:15 +00:00
|
|
|
void ScsiLoop_Cout::PrintErrors(const vector<string> &test_errors)
|
2022-12-03 04:20:27 +00:00
|
|
|
{
|
2023-10-15 06:38:15 +00:00
|
|
|
if (!test_errors.empty()) {
|
|
|
|
for (auto& err_string : test_errors) {
|
2022-12-03 04:20:27 +00:00
|
|
|
cout << RED << err_string << endl;
|
|
|
|
}
|
|
|
|
}
|
2023-10-15 06:38:15 +00:00
|
|
|
}
|