{"id":16701443,"url":"https://github.com/ferd/rebar3_proper","last_synced_at":"2025-10-20T08:35:14.147Z","repository":{"id":2454643,"uuid":"44353375","full_name":"ferd/rebar3_proper","owner":"ferd","description":"Run PropEr test suites with rebar3","archived":false,"fork":false,"pushed_at":"2023-08-23T11:21:42.000Z","size":124,"stargazers_count":39,"open_issues_count":1,"forks_count":22,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-30T22:10:00.685Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ferd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-10-16T00:40:54.000Z","updated_at":"2025-03-17T14:19:22.000Z","dependencies_parsed_at":"2025-02-27T16:34:39.441Z","dependency_job_id":"10ff7178-afcf-480d-846f-5d1c8b2efd1e","html_url":"https://github.com/ferd/rebar3_proper","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferd%2Frebar3_proper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferd%2Frebar3_proper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferd%2Frebar3_proper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferd%2Frebar3_proper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ferd","download_url":"https://codeload.github.com/ferd/rebar3_proper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247595335,"owners_count":20963943,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T18:44:05.718Z","updated_at":"2025-10-20T08:35:14.080Z","avatar_url":"https://github.com/ferd.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"Rebar3 Proper Plugin\n=====\n\nRun PropEr test suites.\n\nBy default, will look for all modules starting in `prop_` in the `test/`\ndirectories of a rebar3 project, and running all properties (functions of arity\n0 with a `prop_` prefix) in them.\n\nTodo/Gotchas\n----\n\n- No automated tests yet since this repo runs tests for a living\n\nUse\n---\n\nAdd the plugin to your rebar config:\n\n    %% the plugin itself\n    {project_plugins, [rebar3_proper]}.\n    %% The PropEr dependency is required to compile the test cases\n    %% and will be used to run the tests as well.\n    {profiles,\n        [{test, [\n            {deps, [\n                %% hex\n                {proper, \"1.3.0\"}\n                %% newest from master\n                {proper, {git, \"https://github.com/proper-testing/proper.git\",\n                          {branch, \"master\"}}}\n            ]}\n        ]}\n    ]}.\n\nThen just call your plugin directly in an existing application:\n\n    Usage: rebar3 proper [-d \u003cdir\u003e] [-m \u003cmodule\u003e] [-p \u003cproperties\u003e]\n                         [-n \u003cnumtests\u003e] [-v \u003cverbose\u003e] [-c [\u003ccover\u003e]]\n                         [-w \u003cworkers\u003e] [-t \u003cproperty_type\u003e]\n                         [--retry [\u003cretry\u003e]] [--regressions [\u003cregressions\u003e]]\n                         [--store [\u003cstore\u003e]] [--long_result \u003clong_result\u003e]\n                         [--start_size \u003cstart_size\u003e] [--max_size \u003cmax_size\u003e]\n                         [--max_shrinks \u003cmax_shrinks\u003e]\n                         [--noshrink \u003cnoshrink\u003e]\n                         [--constraint_tries \u003cconstraint_tries\u003e]\n                         [--spec_timeout \u003cspec_timeout\u003e]\n                         [--any_to_integer \u003cany_to_integer\u003e]\n                         [--stop_nodes \u003cboolean\u003e]\n    \n      -d, --dir           directory where the property tests are located\n                          (defaults to \"test\"). The directory also needs to be\n                          declared in extra_src_dirs.\n      -m, --module        name of one or more modules to test (comma-separated)\n      -p, --prop          name of properties to test within a specified module\n                          (comma-separated)\n      -n, --numtests      number of tests to run when testing a given property\n      -s, --search_steps  number of searches to run when testing a given\n                          targeted property\n      -v, --verbose       each property tested shows its output or not\n                          (defaults to true)\n      -c, --cover         generate cover data [default: false]\n      -w, --workers       number of workers to use when parallelizing property \n                          tests\n      -t, --type          this is only used when running parallel PropEr: \n                          indicates the type of the property to test, it can \n                          either be \"pure\" when it is side-effect and has no \n                          state, or \"impure\" when it does\n      --retry             If failing test case counterexamples have been\n                          stored, they are retried [default: false]\n      --regressions       replays the test cases stored in the regression\n                          file. [default: false]\n      --store             stores the last counterexample into the regression\n                          file. [default: false]\n      --long_result       enables long-result mode, displaying\n                          counter-examples on failure rather than just false\n      --start_size        specifies the initial value of the size parameter\n      --max_size          specifies the maximum value of the size parameter\n      --max_shrinks       specifies the maximum number of times a failing test\n                          case should be shrunk before returning\n      --noshrink          instructs PropEr to not attempt to shrink any\n                          failing test cases\n      --constraint_tries  specifies the maximum number of tries before the\n                          generator subsystem gives up on producing an\n                          instance that satisfies a ?SUCHTHAT constraint\n      --spec_timeout      duration, in milliseconds, after which PropEr\n                          considers an input to be failing\n      --any_to_integer    converts instances of the any() type to integers in\n                          order to speed up execution\n      --stop_nodes        this is only used when running parallel PropEr: \n                          indicates whether PropEr should restart the nodes \n                          for each impure property, when testing them in \n                          parallel, or not\n\nAll of [PropEr's standard configurations](http://proper.softlab.ntua.gr/doc/proper.html#Options)\nthat can be put in a consult file can be put in `{proper_opts, [Options]}.` in your rebar.config file.\n\nWorkflow\n---\n\nA workflow to handle errors and do development is being experimented with:\n\n1. Run any properties with `rebar3 proper`\n2. On a test failure, replay the last failing cases with `rebar3 proper --retry`\n3. Call `rebar3 proper --store` if the cases are interesting and you want to keep them for the future. The entries will be appended in a `proper-regressions.consult` file in your configured test directory. Check in that file or edit it as you wish.\n4. Use `rebar3 proper --regressions` to prevent regressions from happening by testing your code against all stored counterexamples\n\nPer-Properties Meta functions\n---\n\nThis plugin allows you to export additional meta functions to add per-property options and documentation. For example, in the following code:\n\n```erlang\n-module(prop_demo).\n-include_lib(\"proper/include/proper.hrl\").\n-export([prop_demo/1]). % NOT auto-exported by PropEr, we must do it ourselves\n\nprop_demo(doc) -\u003e\n    %% Docs are shown when the test property fails\n    \"only properties that return `true' are seen as passing\";\nprop_demo(opts) -\u003e\n    %% Override CLI and rebar.config option for `numtests' only\n    [{numtests, 500}].\n\nprop_demo() -\u003e % auto-exported by Proper\n    ?FORALL(_N, integer(), false). % always fail\n\nprop_works() -\u003e\n    ?FORALL(_N, integer(), true).\n\nprop_fails() -\u003e\n    ?FORALL(_N, integer(), false). % fails also\n```\n\nWhen run, the `prop_demo/0` property will _always_ run 500 times (if it does not fail), and on failure, properties with a doc value have it displayed:\n\n```\n...\n1/3 properties passed, 2 failed\n===\u003e Failed test cases:\nprop_demo:prop_demo() -\u003e false (only properties that return `true' are seen as passing)\nprop_demo:prop_fails() -\u003e false\n```\n\nThe meta function may be omitted entirely.\n\n\nChangelog\n----\n\n- 0.12.1: fix debug message to match newer rebar3 standards, fixes unintuitive handling of non-compiled directories.\n- 0.12.0: drop compile phase since newer rebar3 versions handle all of that for us out of the box. Eliminates old deprecation warning.\n- 0.11.1: fix unicode support in meta-functions output\n- 0.11.0: add option to set search steps for targeted properties\n- 0.10.4: add PropEr FSM template\n- 0.10.3: fix the template change, which was apparently rushed.\n- 0.10.2: create the regression file path if it doesn't exist; simplify prop_statem template\n- 0.10.1: support per-app `erl_opts` values rather than only root config\n- 0.10.0: support hooks for app and umbrella level; add per-property opts and docs via meta-functions; remove runtime dependency on PropEr and use the one specified by the app instead\n- 0.9.0: support for umbrella projects\n- 0.8.0: storage and replay of counterexamples\n- 0.7.2: rely on a non-beta PropEr version\n- 0.7.1: fix bug regarding lib and priv directories in code path\n- 0.7.0: fix bug with include paths of hrl files from parent apps, support counterexamples with --retry\n- 0.6.3: fix bug with cover-compiling in rebar 3.2.0 and above again\n- 0.6.2: fix bug with cover-compiling in rebar 3.2.0 and above\n- 0.6.1: fix bug on option parsing in config files\n- 0.5.0: switches to package dependencies\n- 0.4.0: switches license to BSD with templates\n- 0.3.0: code coverage supported\n- 0.2.0: basic functionality\n- 0.1.0: first commits\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fferd%2Frebar3_proper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fferd%2Frebar3_proper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fferd%2Frebar3_proper/lists"}