Skip to content

Commit

Permalink
add doctest include wrapper to avoid linker problems
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasbuhr committed Oct 12, 2020
1 parent ff01094 commit 6859698
Show file tree
Hide file tree
Showing 30 changed files with 41 additions and 29 deletions.
2 changes: 1 addition & 1 deletion test/async_auto_reset_event_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <vector>

#include <ostream>
#include "doctest/doctest.h"
#include "doctest/cppcoro_doctest.h"

TEST_SUITE_BEGIN("async_auto_reset_event");

Expand Down
2 changes: 1 addition & 1 deletion test/async_generator_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <cppcoro/when_all.hpp>

#include <ostream>
#include "doctest/doctest.h"
#include "doctest/cppcoro_doctest.h"

TEST_SUITE_BEGIN("async_generator");

Expand Down
2 changes: 1 addition & 1 deletion test/async_latch_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <cppcoro/sync_wait.hpp>

#include <ostream>
#include "doctest/doctest.h"
#include "doctest/cppcoro_doctest.h"

TEST_SUITE_BEGIN("async_latch");

Expand Down
2 changes: 1 addition & 1 deletion test/async_manual_reset_event_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <cppcoro/sync_wait.hpp>
#include <cppcoro/when_all_ready.hpp>

#include "doctest/doctest.h"
#include "doctest/cppcoro_doctest.h"

TEST_SUITE_BEGIN("async_manual_reset_event");

Expand Down
2 changes: 1 addition & 1 deletion test/async_mutex_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <cppcoro/sync_wait.hpp>

#include <ostream>
#include "doctest/doctest.h"
#include "doctest/cppcoro_doctest.h"

TEST_SUITE_BEGIN("async_mutex");

Expand Down
2 changes: 1 addition & 1 deletion test/cancellation_token_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <thread>

#include <ostream>
#include "doctest/doctest.h"
#include "doctest/cppcoro_doctest.h"

TEST_SUITE_BEGIN("cancellation_token tests");

Expand Down
12 changes: 12 additions & 0 deletions test/doctest/cppcoro_doctest.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) Andreas Buhr
// Licenced under MIT license. See LICENSE.txt for details.
///////////////////////////////////////////////////////////////////////////////
#ifndef CPPCORO_CPPCORO_DOCTEST_H_INCLUDED
#define CPPCORO_CPPCORO_DOCTEST_H_INCLUDED

#define DOCTEST_CONFIG_USE_STD_HEADERS
#include "doctest.h"

#endif

2 changes: 1 addition & 1 deletion test/file_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "io_service_fixture.hpp"

#include <ostream>
#include "doctest/doctest.h"
#include "doctest/cppcoro_doctest.h"

TEST_SUITE_BEGIN("file");

Expand Down
2 changes: 1 addition & 1 deletion test/generator_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <string>
#include <forward_list>

#include "doctest/doctest.h"
#include "doctest/cppcoro_doctest.h"

TEST_SUITE_BEGIN("generator");

Expand Down
2 changes: 1 addition & 1 deletion test/io_service_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <vector>

#include <ostream>
#include "doctest/doctest.h"
#include "doctest/cppcoro_doctest.h"

TEST_SUITE_BEGIN("io_service");

Expand Down
2 changes: 1 addition & 1 deletion test/ip_address_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <cppcoro/net/ip_address.hpp>

#include "doctest/doctest.h"
#include "doctest/cppcoro_doctest.h"

TEST_SUITE_BEGIN("ip_address");

Expand Down
2 changes: 1 addition & 1 deletion test/ip_endpoint_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <cppcoro/config.hpp>
#include <cppcoro/net/ip_endpoint.hpp>

#include "doctest/doctest.h"
#include "doctest/cppcoro_doctest.h"

TEST_SUITE_BEGIN("ip_endpoint");

Expand Down
2 changes: 1 addition & 1 deletion test/ipv4_address_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <cppcoro/net/ipv4_address.hpp>

#include "doctest/doctest.h"
#include "doctest/cppcoro_doctest.h"


TEST_SUITE_BEGIN("ipv4_address");
Expand Down
2 changes: 1 addition & 1 deletion test/ipv4_endpoint_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <cppcoro/net/ipv4_endpoint.hpp>

#include "doctest/doctest.h"
#include "doctest/cppcoro_doctest.h"

TEST_SUITE_BEGIN("ip_endpoint");

Expand Down
2 changes: 1 addition & 1 deletion test/ipv6_address_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <cppcoro/net/ipv6_address.hpp>

#include "doctest/doctest.h"
#include "doctest/cppcoro_doctest.h"


TEST_SUITE_BEGIN("ipv6_address");
Expand Down
2 changes: 1 addition & 1 deletion test/ipv6_endpoint_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <cppcoro/config.hpp>
#include <cppcoro/net/ipv6_endpoint.hpp>

#include "doctest/doctest.h"
#include "doctest/cppcoro_doctest.h"

TEST_SUITE_BEGIN("ipv6_endpoint");

Expand Down
2 changes: 1 addition & 1 deletion test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
///////////////////////////////////////////////////////////////////////////////

#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#include "doctest/doctest.h"
#include "doctest/cppcoro_doctest.h"
2 changes: 1 addition & 1 deletion test/multi_producer_sequencer_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <chrono>

#include <ostream>
#include "doctest/doctest.h"
#include "doctest/cppcoro_doctest.h"

DOCTEST_TEST_SUITE_BEGIN("multi_producer_sequencer");

Expand Down
2 changes: 1 addition & 1 deletion test/recursive_generator_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <algorithm>

#include <ostream>
#include "doctest/doctest.h"
#include "doctest/cppcoro_doctest.h"

TEST_SUITE_BEGIN("recursive_generator");

Expand Down
2 changes: 1 addition & 1 deletion test/scheduling_operator_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "io_service_fixture.hpp"

#include <ostream>
#include "doctest/doctest.h"
#include "doctest/cppcoro_doctest.h"

TEST_SUITE_BEGIN("schedule/resume_on");

Expand Down
2 changes: 1 addition & 1 deletion test/sequence_barrier_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <stdio.h>
#include <thread>

#include "doctest/doctest.h"
#include "doctest/cppcoro_doctest.h"

DOCTEST_TEST_SUITE_BEGIN("sequence_barrier");

Expand Down
2 changes: 1 addition & 1 deletion test/shared_task_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <ostream>
#include <string>

#include "doctest/doctest.h"
#include "doctest/cppcoro_doctest.h"

TEST_SUITE_BEGIN("shared_task");

Expand Down
2 changes: 1 addition & 1 deletion test/single_consumer_async_auto_reset_event_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <cassert>
#include <vector>

#include "doctest/doctest.h"
#include "doctest/cppcoro_doctest.h"

TEST_SUITE_BEGIN("single_consumer_async_auto_reset_event");

Expand Down
2 changes: 1 addition & 1 deletion test/single_producer_sequencer_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <thread>

#include <ostream>
#include "doctest/doctest.h"
#include "doctest/cppcoro_doctest.h"

DOCTEST_TEST_SUITE_BEGIN("single_producer_sequencer");

Expand Down
2 changes: 1 addition & 1 deletion test/socket_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <cppcoro/cancellation_token.hpp>
#include <cppcoro/async_scope.hpp>

#include "doctest/doctest.h"
#include "doctest/cppcoro_doctest.h"

using namespace cppcoro;
using namespace cppcoro::net;
Expand Down
2 changes: 1 addition & 1 deletion test/static_thread_pool_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <iostream>
#include <numeric>

#include "doctest/doctest.h"
#include "doctest/cppcoro_doctest.h"

TEST_SUITE_BEGIN("static_thread_pool");

Expand Down
2 changes: 1 addition & 1 deletion test/sync_wait_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <string>
#include <type_traits>

#include "doctest/doctest.h"
#include "doctest/cppcoro_doctest.h"

TEST_SUITE_BEGIN("sync_wait");

Expand Down
2 changes: 1 addition & 1 deletion test/task_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <string>
#include <type_traits>

#include "doctest/doctest.h"
#include "doctest/cppcoro_doctest.h"

TEST_SUITE_BEGIN("task");

Expand Down
2 changes: 1 addition & 1 deletion test/when_all_ready_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <vector>

#include <ostream>
#include "doctest/doctest.h"
#include "doctest/cppcoro_doctest.h"

TEST_SUITE_BEGIN("when_all_ready");

Expand Down
2 changes: 1 addition & 1 deletion test/when_all_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <vector>

#include <ostream>
#include "doctest/doctest.h"
#include "doctest/cppcoro_doctest.h"

TEST_SUITE_BEGIN("when_all");

Expand Down

0 comments on commit 6859698

Please sign in to comment.