mirror of
https://github.com/davidalbertonogueira/MLP.git
synced 2025-12-17 04:14:41 +03:00
Update deps (fix microunit bug).
This commit is contained in:
18
deps/microunit.h
vendored
18
deps/microunit.h
vendored
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @file microunit.h
|
||||
* @version 0.1
|
||||
* @version 0.2
|
||||
* @author Sebastiao Salvador de Miranda (ssm)
|
||||
* @brief Tiny library for cpp unit testing. Should work on any c++11 compiler.
|
||||
*
|
||||
@@ -25,7 +25,7 @@
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* @copyright Copyright (c) 2016, Sebastiao Salvador de Miranda.
|
||||
* @copyright Copyright (c) 2016-2017, Sebastiao Salvador de Miranda.
|
||||
* All rights reserved. See licence below.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -94,8 +94,8 @@ const static int COLORCODE_YELLOW{ 14 };
|
||||
std::string ColorCodeToANSI(const int color_code) {
|
||||
switch (color_code) {
|
||||
case COLORCODE_GREY: return "\033[22;37m";
|
||||
case COLORCODE_GREEN: return "\033[01;31m";
|
||||
case COLORCODE_RED: return "\033[01;32m";
|
||||
case COLORCODE_GREEN: return "\033[01;32m";
|
||||
case COLORCODE_RED: return "\033[01;31m";
|
||||
case COLORCODE_YELLOW: return "\033[01;33m";
|
||||
default: return "";
|
||||
}
|
||||
@@ -226,6 +226,10 @@ public:
|
||||
static bool Run() {
|
||||
std::vector<std::string> failures, sucesses;
|
||||
|
||||
TERMINAL_INFO
|
||||
<< "Will run " << Instance().unitfunction_map_.size()
|
||||
<< " test cases";
|
||||
|
||||
// Iterate all registered unit tests
|
||||
for (auto& unit : Instance().unitfunction_map_) {
|
||||
std::cout << MICROUNIT_SEPARATOR << std::endl;
|
||||
@@ -238,7 +242,8 @@ public:
|
||||
if (!result.success) {
|
||||
TERMINAL_BAD << "Failed test";
|
||||
failures.push_back(unit.first);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
TERMINAL_GOOD << "Passed test";
|
||||
sucesses.push_back(unit.first);
|
||||
}
|
||||
@@ -259,7 +264,8 @@ public:
|
||||
TERMINAL_GOOD << "All tests passed";
|
||||
std::cout << MICROUNIT_SEPARATOR << std::endl;
|
||||
return true;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
TERMINAL_BAD << "Failed " << failures.size()
|
||||
<< " test cases:";
|
||||
for (const auto& failure : failures) {
|
||||
|
||||
Reference in New Issue
Block a user