mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-24 22:36:10 +01:00
Convert examples to piecemeal includes
This commit is contained in:
parent
26f78f96aa
commit
17281c09c3
@ -6,7 +6,8 @@
|
|||||||
|
|
||||||
// main() provided in 000-CatchMain.cpp
|
// main() provided in 000-CatchMain.cpp
|
||||||
|
|
||||||
#include <catch2/catch.hpp>
|
#include <catch2/catch_test_macros.hpp>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
TEST_CASE( "vectors can be sized and resized", "[vector]" ) {
|
TEST_CASE( "vectors can be sized and resized", "[vector]" ) {
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
// main() provided in 000-CatchMain.cpp
|
// main() provided in 000-CatchMain.cpp
|
||||||
|
|
||||||
#include <catch2/catch.hpp>
|
#include <catch2/catch_test_macros.hpp>
|
||||||
|
|
||||||
class DBConnection
|
class DBConnection
|
||||||
{
|
{
|
||||||
|
@ -10,7 +10,9 @@
|
|||||||
// Let Catch provide the required interfaces:
|
// Let Catch provide the required interfaces:
|
||||||
#define CATCH_CONFIG_EXTERNAL_INTERFACES
|
#define CATCH_CONFIG_EXTERNAL_INTERFACES
|
||||||
|
|
||||||
#include <catch2/catch.hpp>
|
#include <catch2/catch_test_macros.hpp>
|
||||||
|
#include <catch2/reporters/catch_reporter_bases.hpp>
|
||||||
|
#include <catch2/catch_reporter_registrars.hpp>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
#include <catch2/catch_default_main.hpp>
|
#include <catch2/catch_default_main.hpp>
|
||||||
|
|
||||||
#include <catch2/catch.hpp>
|
#include <catch2/catch_test_macros.hpp>
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
@ -4,7 +4,9 @@
|
|||||||
// Specifically we will implement a random number generator for integers
|
// Specifically we will implement a random number generator for integers
|
||||||
// It will have infinite capacity and settable lower/upper bound
|
// It will have infinite capacity and settable lower/upper bound
|
||||||
|
|
||||||
#include <catch2/catch.hpp>
|
#include <catch2/catch_test_macros.hpp>
|
||||||
|
#include <catch2/catch_generators.hpp>
|
||||||
|
#include <catch2/catch_generators_generic.hpp>
|
||||||
|
|
||||||
#include <random>
|
#include <random>
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
// 301-Gen-MapTypeConversion.cpp
|
// 301-Gen-MapTypeConversion.cpp
|
||||||
// Shows how to use map to modify generator's return type.
|
// Shows how to use map to modify generator's return type.
|
||||||
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
#include <catch2/catch.hpp>
|
#include <catch2/catch_test_macros.hpp>
|
||||||
|
#include <catch2/catch_generators_generic.hpp>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
// _WILL_ outlive the variables -- thus they should be either captured
|
// _WILL_ outlive the variables -- thus they should be either captured
|
||||||
// by value directly, or copied by the generators during construction.
|
// by value directly, or copied by the generators during construction.
|
||||||
|
|
||||||
#include <catch2/catch.hpp>
|
#include <catch2/catch_test_macros.hpp>
|
||||||
|
#include <catch2/catch_generators_generic.hpp>
|
||||||
|
#include <catch2/catch_generators_specific.hpp>
|
||||||
|
|
||||||
TEST_CASE("Generate random doubles across different ranges",
|
TEST_CASE("Generate random doubles across different ranges",
|
||||||
"[generator][example][advanced]") {
|
"[generator][example][advanced]") {
|
||||||
|
@ -9,7 +9,9 @@
|
|||||||
// per-variable custom capture list, this example shows how to achieve
|
// per-variable custom capture list, this example shows how to achieve
|
||||||
// that.
|
// that.
|
||||||
|
|
||||||
#include <catch2/catch.hpp>
|
#include <catch2/catch_test_macros.hpp>
|
||||||
|
#include <catch2/catch_generators_generic.hpp>
|
||||||
|
#include <catch2/catch_generators_specific.hpp>
|
||||||
|
|
||||||
TEST_CASE("Generate random doubles across different ranges",
|
TEST_CASE("Generate random doubles across different ranges",
|
||||||
"[generator][example][advanced]") {
|
"[generator][example][advanced]") {
|
||||||
|
Loading…
Reference in New Issue
Block a user