Comments (4)
Hmm... even more interesting. I moved all of the code from the CustomMatchers.h
file into the CedarComparators.h
file, between the #ifdef CEDAR_CUSTOM_COMPARATORS
guard, and I'm getting the same errors. I can safely remove the possibility of the CustomMatchers.h
header file being the source of the issue.
from cedar.
Hey @PeqNP, I think I have an idea why you're experiencing this. With recent Cedar versions, Xcode tries to also build a Swift-compatible "module" version of Cedar, which can only include non-C++ components. This change means that all matchers (built-in and custom) need to be wrapped in an #ifdef __cplusplus
/ #endif
block to ensure that they are only built in Objective-C++ mode. See here for an example. It looks like the documentation in the wiki still needs to be updated to reflect this. Let me know if this helps!
from cedar.
That solved the issue! Using the example in the Wiki, I ended up changing the code to look like this:
#import <CoreMedia/CoreMedia.h>
#if TARGET_OS_IPHONE
#import <Cedar-iOS/ComparatorsBase.h>
#import <Cedar-iOS/StringifiersBase.h>
#else
#import <Cedar/ComparatorsBase.h>
#import <Cedar/StringifiersBase.h>
#endif
#ifdef __cplusplus
namespace Cedar { namespace Matchers { namespace Comparators {
template<typename U>
bool compare_equal(CMTimeRange const actualValue, const U & expectedValue) {
return CMTimeRangeEqual(actualValue, expectedValue);
}
}}}
namespace Cedar { namespace Matchers { namespace Stringifiers {
inline NSString * string_for(const CMTimeRange value) {
return [NSString stringWithFormat:@"%lld/%d (duration %lld/%d)", value.start.value, value.start.timescale, value.duration.value, value.duration.timescale];
}
}}}
#endif
Thank you for the response!
from cedar.
Note that this was an unintentional breaking change. 0b92d9e should fix this such that custom matchers won't need the guard to be manually inserted anymore.
from cedar.
Related Issues (20)
- Console output is logged out of order HOT 1
- new project can't find cedar HOT 1
- Xcode 7.3 beta 5 errors on __weak in manual reference counting HOT 6
- Use of @import HOT 2
- Test observation issues HOT 2
- Weak References in XCode 7.3 HOT 4
- Playground support
- Installing template fails on AppCode 2016.1 HOT 1
- Cedar silently accepts misuse of the test structure DSL
- Running Individual Specs HOT 9
- Cedar, Swift and Protocol Declarations - Compiler error HOT 7
- testing watchOS with Cedar and Swift
- Cedar Standalone with XCode 8/ios-sim 5.0.8 HOT 4
- Cedar needs a sticker. HOT 4
- should equal throws exception when comparing const pointer to a non-const pointer HOT 5
- Cedar status HOT 1
- Xcode 9 compatibility HOT 8
- [Known Issue] Cedar's test specs cannot be folded in Xcode 9
- spy_on NSDate crashes on Xcode 10 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cedar.