jeffh / Fox

Property Based Testing Library for Objective-C and Swift. QuickCheck for Apple's Platforms.
http://fox-testing.rtfd.org
Other
624 stars 30 forks source link

Is this usable from outside PBTSpecs? #2

Closed modocache closed 9 years ago

modocache commented 10 years ago

So, ideally I'd like to build a Nimble matcher based off of this in time for the Functional Swift Conference on Dec. 6th.

I've been building my own version of QuickCheck, but I'd rather not reinvent the wheel, and yours is definitely written better. But I'm having trouble running it from outside of PBTSpecs. I tried making it at least importable (see https://github.com/jeffh/PBT/pull/1), but PBTDeterministicRandom causes build errors.

All I need is something that:

  1. Works in both Swift and Objective-C
  2. Supports shrinking

...so it doesn't have to handle the state machine stuff (which does sound cool, by the way).

Any chance you can take some time from the state machine stuff to first build a sample project that confirms this stuff works from a separate project in Objective-C and Swift?

jeffh commented 10 years ago

Hey @modocache, could you add the linker flag: -lstdc++ and see if that works? I'll have to check the Swift stuff when I get a chance.

jeffh commented 10 years ago

I updated PBT to not use __attribute__((overloadable)) so that all the functions are available in Swift. Let me know how it is (PBTAssert isn't available in Swift, but it's not too hard to roll one).

modocache commented 9 years ago

Yes, -libstdc++ worked! I've imported PBT into a sample project's test target and am successfully using it!!