From 68d7535fe0cccd50622884f704edeb9d8bb47430 Mon Sep 17 00:00:00 2001 From: tmanevik Date: Fri, 18 Dec 2015 12:21:32 +0100 Subject: Common Test: Editorial changes 3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reference Manual files from Pär Wennstad added --- lib/common_test/doc/src/ct_property_test.xml | 116 +++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 lib/common_test/doc/src/ct_property_test.xml (limited to 'lib/common_test/doc/src/ct_property_test.xml') diff --git a/lib/common_test/doc/src/ct_property_test.xml b/lib/common_test/doc/src/ct_property_test.xml new file mode 100644 index 0000000000..2e9bd1969c --- /dev/null +++ b/lib/common_test/doc/src/ct_property_test.xml @@ -0,0 +1,116 @@ + + + + +
+ + 20102012 + Ericsson AB. All Rights Reserved. + + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + + + ct_property_test + + + + + + + A + ct_property_test.xml +
+ 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:

+ +
+ -include_lib("common_test/include/ct.hrl").
+
+ all() -> [prop_ftp_case].
+
+ init_per_suite(Config) ->
+     ct_property_test:init_per_suite(Config).
+
+ %%%---- test case
+ prop_ftp_case(Config) ->
+     ct_property_test:quickcheck(
+       ftp_simple_client_server:prop_ftp(Config),
+       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. + +

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. + +

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.

+
+
+
+ +
+ + -- cgit v1.2.3