1ct_property_test(3) Erlang Module Definition ct_property_test(3)
2
3
4
6 ct_property_test - EXPERIMENTAL support in Common Test for calling
7 property-based tests.
8
10 EXPERIMENTAL support in Common Test for calling property-based tests.
11
12 This module is a first step to run property-based tests in the Common
13 Test framework. A property testing tool like QuickCheck or PropEr is
14 assumed to be installed.
15
16 The idea is to have a Common Test test suite calling a property testing
17 tool with special property test suites as defined by that tool. The
18 usual Erlang application directory structure is assumed. The tests are
19 collected in the test directory of the application. The test directory
20 has a subdirectory property_test, where everything needed for the prop‐
21 erty tests is collected.
22
23 A typical Common Test test suite using ct_property_test is organized as
24 follows:
25
26 -include_lib("common_test/include/ct.hrl").
27
28 all() -> [prop_ftp_case].
29
30 init_per_suite(Config) ->
31 ct_property_test:init_per_suite(Config).
32
33 %%%---- test case
34 prop_ftp_case(Config) ->
35 ct_property_test:quickcheck(
36 ftp_simple_client_server:prop_ftp(Config),
37 Config
38 ).
39
40 Warning:
41 This is experimental code that can be changed or removed anytime with‐
42 out any warning.
43
44
46 init_per_suite(Config) -> Config | {skip, Reason}
47
48 Initializes Config for property testing.
49
50 This function investigates if support is available for either
51 Quickcheck, PropEr, or Triq. The options {property_dir,AbsPath}
52 and {property_test_tool,Tool} are set in the Config returned.
53
54 The function is intended to be called in function init_per_suite
55 in the test suite.
56
57 The property tests are assumed to be in subdirectory prop‐
58 erty_test.
59
60 quickcheck(Property, Config) -> true | {fail, Reason}
61
62 Calls quickcheck and returns the result in a form suitable for
63 Common Test.
64
65 This function is intended to be called in the test cases in the
66 test suite.
67
68
69
70Ericsson AB common_test 1.18 ct_property_test(3)