fix build errors, fix warning about pragma once in source file

This commit is contained in:
Crzyrndm 2018-07-10 13:39:52 +12:00
parent bf5105f0a3
commit 0e69ea95bf
20 changed files with 4 additions and 74 deletions

View File

@ -21,8 +21,6 @@
// @license: http://www.opensource.org/licenses/mit-license.php
// @author: see AUTHORS file
#pragma once
#include <sstream>
#include <helpers/assertions.hpp>

View File

@ -21,8 +21,6 @@
// @license: http://www.opensource.org/licenses/mit-license.php
// @author: see AUTHORS file
#pragma once
#include <iostream>
#include <helpers/test_suite.hpp>

View File

@ -21,8 +21,6 @@
// @license: http://www.opensource.org/licenses/mit-license.php
// @author: see AUTHORS file
#pragma once
#include <ctime>
#include <iostream>
#include <sstream>

View File

@ -7,10 +7,7 @@ std::vector<std::pair<std::function<void(void)>, std::string>> &test_suite::test
return all_tests;
}
std::string build_name(const std::string &pretty, const std::string &method)
{
return pretty.substr(0, pretty.find("::") + 2) + method;
}
std::string build_name(const std::string &pretty, const std::string &method);
test_status test_suite::go()
{

View File

@ -32,39 +32,7 @@ inline std::string build_name(const std::string &pretty, const std::string &meth
class test_suite
{
public:
static test_status go()
{
test_status status;
for (auto test : tests())
{
try
{
test.first();
std::cout << ".";
status.tests_passed++;
}
catch (std::exception &ex)
{
std::string fail_msg = test.second + " failed with:\n" + std::string(ex.what());
std::cout << "*\n"
<< fail_msg << '\n';
status.tests_failed++;
status.failures.push_back(fail_msg);
}
catch (...)
{
std::cout << "*\n" << test.second << " failed\n";
status.tests_failed++;
status.failures.push_back(test.second);
}
std::cout.flush();
status.tests_run++;
}
return status;
}
static test_status go();
protected:
static void register_test_internal(std::function<void()> t, const std::string &function)

View File

@ -24,14 +24,13 @@
#include <iostream>
#include <helpers/test_suite.hpp>
std::vector<std::pair<std::function<void(void)>, std::string>> test_suite::tests;
void print_summary(const test_status& results)
{
std::cout << "\n\n";
std::cout << "Run: " << results.tests_run << '\n';
std::cout << "Passed: " << results.tests_passed << '\n';
std::cout << "Failed: " << results.tests_failed << '\n';
std::cout << "Failed: " << results.tests_failed << '\n' << '\n';
for (auto failure : results.failures)
{

View File

@ -21,8 +21,6 @@
// @license: http://www.opensource.org/licenses/mit-license.php
// @author: see AUTHORS file
#pragma once
#include <iostream>
#include <helpers/test_suite.hpp>

View File

@ -21,8 +21,6 @@
// @license: http://www.opensource.org/licenses/mit-license.php
// @author: see AUTHORS file
#pragma once
#include <iostream>
#include <helpers/test_suite.hpp>

View File

@ -21,8 +21,6 @@
// @license: http://www.opensource.org/licenses/mit-license.php
// @author: see AUTHORS file
#pragma once
#include <iostream>
#include <helpers/test_suite.hpp>

View File

@ -21,8 +21,6 @@
// @license: http://www.opensource.org/licenses/mit-license.php
// @author: see AUTHORS file
#pragma once
#include <iostream>
#include <helpers/test_suite.hpp>

View File

@ -21,8 +21,6 @@
// @license: http://www.opensource.org/licenses/mit-license.php
// @author: see AUTHORS file
#pragma once
#include <iostream>
#include <helpers/test_suite.hpp>

View File

@ -21,8 +21,6 @@
// @license: http://www.opensource.org/licenses/mit-license.php
// @author: see AUTHORS file
#pragma once
#include <iostream>
#include <stdexcept>

View File

@ -21,8 +21,6 @@
// @license: http://www.opensource.org/licenses/mit-license.php
// @author: see AUTHORS file
#pragma once
#include <iostream>
#include <helpers/path_helper.hpp>

View File

@ -21,8 +21,6 @@
// @license: http://www.opensource.org/licenses/mit-license.php
// @author: see AUTHORS file
#pragma once
#include <iostream>
#include <helpers/test_suite.hpp>

View File

@ -21,8 +21,6 @@
// @license: http://www.opensource.org/licenses/mit-license.php
// @author: see AUTHORS file
#pragma once
#include <iostream>
#include <helpers/test_suite.hpp>

View File

@ -21,8 +21,6 @@
// @license: http://www.opensource.org/licenses/mit-license.php
// @author: see AUTHORS file
#pragma once
#include <iostream>
#include <xlnt/cell/comment.hpp>

View File

@ -21,8 +21,6 @@
// @license: http://www.opensource.org/licenses/mit-license.php
// @author: see AUTHORS file
#pragma once
#include <algorithm>
#include <iostream>

View File

@ -21,8 +21,6 @@
// @license: http://www.opensource.org/licenses/mit-license.php
// @author: see AUTHORS file
#pragma once
#include <iostream>
#include <helpers/test_suite.hpp>

View File

@ -21,8 +21,6 @@
// @license: http://www.opensource.org/licenses/mit-license.php
// @author: see AUTHORS file
#pragma once
#include <iostream>

View File

@ -21,8 +21,6 @@
// @license: http://www.opensource.org/licenses/mit-license.php
// @author: see AUTHORS file
#pragma once
#include <iostream>
#include <xlnt/cell/cell.hpp>