Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow overriding of Test.Parameters in Properties #188

Merged
merged 1 commit into from
Aug 19, 2015

Conversation

sid-kap
Copy link
Contributor

@sid-kap sid-kap commented Aug 5, 2015

This is a basic implementation of the feature request in #187.
This would allow a user to do something like

object MyProperties extends Properties("My object") {
  override def overrideParams(p: Test.Parameters) = p.withMinSuccessfulTests(20)
}

if they want Scalacheck to, for this class only, run 20 tests per property instead of whatever value was specified in the sbt argument or the project default.

@sid-kap
Copy link
Contributor Author

sid-kap commented Aug 7, 2015

How do you feel about this approach?
Would you prefer doing this using an annotation instead?

The downside of this approach is that doesn't support property-specific configuration. I think the best way to support both Properties-level configuration and Prop-level configuration would be to use annotations, and, for a Prop inside a Properties, apply Prop-level configuration applied after the Properties-level configuration.

I really hope we can figure this out soon because I'd like to use this feature in a project, so it'd be nice to have this in the next release of scalacheck.

@rickynils
Copy link
Contributor

As you said, this approach works only for property collections. But that is fine for a start, I think. I try to merge this next week.

(for ScalaCheck 2 I have a more general approach going, which should allow for per-property params)

You can also check out specs2, there is a way to set params through implicits there, but I haven't looked at it in detail.

@sid-kap
Copy link
Contributor Author

sid-kap commented Aug 12, 2015

Hi, have you gotten a chance to look at this yet?

1 similar comment
@sid-kap
Copy link
Contributor Author

sid-kap commented Aug 18, 2015

Hi, have you gotten a chance to look at this yet?

rickynils added a commit that referenced this pull request Aug 19, 2015
Allow overriding of Test.Parameters in Properties
@rickynils rickynils merged commit 53746d9 into typelevel:master Aug 19, 2015
@rickynils
Copy link
Contributor

@sid-kap Sorry for my late response... and thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants