"Fossies" - the Fresh Open Source Software Archive

Member "man/man3/ct_property_test.3" (17 Sep 2019, 2198 Bytes) of package /linux/misc/otp_doc_man_22.1.tar.gz:

Caution: As a special service "Fossies" has tried to format the requested manual source page into HTML format but links to other man pages may be missing or even erroneous. Alternatively you can here view or download the uninterpreted manual source code. A member file download can also be achieved by clicking within a package contents listing on the according byte size field. See also the latest Fossies "Diffs" side-by-side code changes report for "ct_property_test.3": 22.0_vs_22.1.




ct_property_test − EXPERIMENTAL support in Common Test for calling
property-based tests.


EXPERIMENTAL support in Common Test for calling property-based tests.

This module is a first step to run property-based tests in the Common Test framework. A property testing tool like QuickCheck or PropEr is assumed to be installed.

The idea is to have a Common Test test suite calling a property testing tool with special property test suites as defined by that tool. The usual Erlang application directory structure is assumed. The tests are collected in the test directory of the application. The test directory has a subdirectory property_test, where everything needed for the property tests is collected.

A typical Common Test test suite using ct_property_test is organized as follows:


all() -> [prop_ftp_case].

init_per_suite(Config) ->

%---- test case
prop_ftp_case(Config) ->


This is experimental code that can be changed or removed anytime without any warning.


init_per_suite(Config) -> Config | {skip, Reason}

Initializes Config for property testing.

This function investigates if support is available for either Quickcheck, PropEr, or Triq. The options {property_dir,AbsPath} and {property_test_tool,Tool} are set in the Config returned.

The function is intended to be called in function init_per_suite in the test suite.

The property tests are assumed to be in subdirectory property_test.

quickcheck(Property, Config) -> true | {fail, Reason}

Calls quickcheck and returns the result in a form suitable for Common Test.

This function is intended to be called in the test cases in the test suite.