Code Monkey home page Code Monkey logo

run_eqc's Introduction

The run_eqc application

run_eqc - An escript wrapper for Quviq QuickCheck

================================================== .

Copyright (c) 2010 Erlang Solutions Ltd.

Version: 0.1

Run_eqc packages QuickCheck Mini as a single escript file and provides a command-line interface for running QuickCheck tests. with some additional support for output filtering.

Note: The description and examples apply almost precisely also to the run_proper.ez file, which wraps PropEr in the same way. PropEr is an EQC-compatible Open Source component designed by Kostis Sagonas and Manolis Papadakis. You can fetch it at http://github.com/manopapad/proper.git

The file run_eqc.ez should be a runnable version of the wrapper, including eqc-1.0.1 - the current version of EQC Mini. To build a new version, ensure that you have EQC Mini installed, update the location of it in the Makefile, and call make script.

Usage: escript run_eqc.ez [ Option ]
-n NumTests    run NumTests number of tests (default 100)
-m Module      run eqc:module([ Option, ] Module)
-pa Dir        prepend Dir to the code path
-pz Dir        append Dir to the code path
-rpt all       set reporting level - 'all': report everything
| none     'none': (as silent as possible)
| error    'error': report on failing tests.

The -rpt error option buffers all output produced by QuickCheck and discards it for all successful properties. If a property fails, all output for that run is printed.

Example:

Using the (broken) property in run_eqc_test.erl, we can illustrate the use of num_tests (the error is unlikely to appear with only 100 tests), and -rpt error. We also note that run_eqc.escript signals test case failure appropriately to the make script.

$ make test
./rebar compile
==> edown (compile)
==> run_eqc (compile)
escript ebin/run_eqc_gen.beam run_eqc.ez /Users/uwiger/lib/eqc-1.0.1/ebin eqc
escript ebin/run_eqc_gen.beam run_proper.ez /Users/uwiger/git/proper/ebin proper
erlc -W -o test test/run_eqc_test.erl
escript ./run_eqc.ez -m run_eqc_test -n 1000 -rpt error -pa test
Starting eqc mini version 1.0.1 (compiled at {{2010,6,13},{11,15,30}})
FAILED property prop_lists_delete:
...........................................................................................................................................................................................................................................................................................Failed! After 284 tests.
{-41,[5,-30,35,-2,23,-37,26,-7,-41,-2,-41,-13,41,-19,-17]}
Shrinking....(4 times)
{-41,[-41,-41]}
Failed properties in run_eqc_test:
[prop_lists_delete]
make: *** [test_eqc] Error 1

If we test the same module using default values:

$ escript ./run_eqc.ez -m run_eqc_test -pa test
Starting eqc mini version 1.0.1 (compiled at {{2010,6,13},{11,15,30}})
....................................................................................................
OK, passed 100 tests
....................................................................................................
OK, passed 100 tests
....................................................................................................
OK, passed 100 tests
...tests passed (run_eqc_test)

Running EQC Mini interactively

You can load and run the EQC Mini code directly from the escript file, using OTP's ability to load code from a zip archive.

Example:

$ erl -pa run_eqc.ez/eqc/ebin
Erlang R14B02 (erts-5.8.3) [source] [smp:4:4] [rq:4] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.8.3  (abort with ^G)
1> eqc:start().
Starting eqc mini version 1.0.1 (compiled at {{2010,6,13},{11,15,30}})
<0.35.0>

Modules

run_eqc
run_eqc_app
run_eqc_gen
run_eqc_sup
run_proper

run_eqc's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.