From f82d65fb41614ebda1ab546feccd78acc12b8049 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 3 Sep 2012 08:19:12 +0100 Subject: [PATCH] Added stub for BDD mappings --- .../CatchSelfTest.xcodeproj/project.pbxproj | 4 ++ .../CatchSelfTest/CatchSelfTest/BDDTests.cpp | 49 ++++++++++++++++--- .../XCode4/CatchSelfTest/CatchSelfTest/File.h | 14 ------ 3 files changed, 45 insertions(+), 22 deletions(-) delete mode 100644 projects/XCode4/CatchSelfTest/CatchSelfTest/File.h diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj index a3ecdc9f..0e2795e9 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj @@ -17,6 +17,7 @@ 4A6D0C3D149B3D9E00DB3EAA /* MiscTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A6D0C34149B3D9E00DB3EAA /* MiscTests.cpp */; }; 4A6D0C3E149B3D9E00DB3EAA /* TestMain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A6D0C35149B3D9E00DB3EAA /* TestMain.cpp */; }; 4A6D0C3F149B3D9E00DB3EAA /* TrickyTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A6D0C36149B3D9E00DB3EAA /* TrickyTests.cpp */; }; + 4AA7FF4315F3E89E009AD7F9 /* BDDTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AA7FF4115F3E89D009AD7F9 /* BDDTests.cpp */; }; 4AE1840B14EE4F230066340D /* catch_self_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AE1840A14EE4F230066340D /* catch_self_test.cpp */; }; /* End PBXBuildFile section */ @@ -97,6 +98,7 @@ 4A90B59E15D2521E00EF71BC /* catch_resultinfo_builder.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_resultinfo_builder.hpp; sourceTree = ""; }; 4A9D84B11558FC0400FBB209 /* catch_tostring.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_tostring.hpp; sourceTree = ""; }; 4A9D84B315599AC900FBB209 /* catch_resultinfo_builder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_resultinfo_builder.h; sourceTree = ""; }; + 4AA7FF4115F3E89D009AD7F9 /* BDDTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BDDTests.cpp; sourceTree = ""; }; 4AB1C73514F97BDA00F31DF7 /* catch_console_colour_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_console_colour_impl.hpp; sourceTree = ""; }; 4AB1C73714F97C1300F31DF7 /* catch_console_colour.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_console_colour.hpp; sourceTree = ""; }; 4AB77CB51551AEA200857BF0 /* catch_ptr.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_ptr.hpp; sourceTree = ""; }; @@ -160,6 +162,7 @@ 4A6D0C32149B3D9E00DB3EAA /* GeneratorTests.cpp */, 4A6D0C33149B3D9E00DB3EAA /* MessageTests.cpp */, 4A6D0C34149B3D9E00DB3EAA /* MiscTests.cpp */, + 4AA7FF4115F3E89D009AD7F9 /* BDDTests.cpp */, ); name = Tests; sourceTree = ""; @@ -373,6 +376,7 @@ 4A6D0C3E149B3D9E00DB3EAA /* TestMain.cpp in Sources */, 4A6D0C3F149B3D9E00DB3EAA /* TrickyTests.cpp in Sources */, 4AE1840B14EE4F230066340D /* catch_self_test.cpp in Sources */, + 4AA7FF4315F3E89E009AD7F9 /* BDDTests.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp b/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp index c0177bc8..bc88849c 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp @@ -1,9 +1,42 @@ -// -// File.cpp -// CatchSelfTest -// -// Created by Phil Nash on 02/09/2012. -// -// +/* + * Created by Phil on 29/11/2010. + * Copyright 2010 Two Blue Cubes Ltd. All rights reserved. + * + * Distributed under the Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + */ -#include "File.h" +#ifdef __clang__ +#pragma clang diagnostic ignored "-Wpadded" +#endif + +#include "catch.hpp" + +#define STORY( a, b ) +#define SCENARIO( storyName, desc ) TEST_CASE( desc, "" ) +#define GIVEN( desc ) SECTION( desc, "" ) +#define WHEN( desc ) SECTION( desc, "" ) +#define THEN( desc ) SECTION( desc, "" ) + +inline bool itDoesThis(){ return true; } + +STORY( storyName, "once upon a time" ) + +SCENARIO( storyName, "scenario name" ) +{ + GIVEN( "This stuff exists" ) + { + // make stuff exist + + WHEN( "I do this" ) + { + // do this + + THEN( "it should this this") + { + REQUIRE( itDoesThis() ); + } + } + + } +} diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest/File.h b/projects/XCode4/CatchSelfTest/CatchSelfTest/File.h deleted file mode 100644 index ba6e9cff..00000000 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest/File.h +++ /dev/null @@ -1,14 +0,0 @@ -// -// File.h -// CatchSelfTest -// -// Created by Phil Nash on 02/09/2012. -// -// - -#ifndef __CatchSelfTest__File__ -#define __CatchSelfTest__File__ - -#include - -#endif /* defined(__CatchSelfTest__File__) */