Giter Site home page Giter Site logo

ao's Introduction

AO - Assert Operator

A New Approach To Unit Testing And Not Only

Concepts

Assert operator or ao |ei'ou| is a software to simplify multi-platform testing.

The ao promotes the approach of isolating test data from testing code and as a consequence the ao test consists of assert operator cases.

An assert operator case is a test case consumed by the user-supplied assert_case() function that should return an assert operation as a result. The test case structure is usually defined by the aocase_t type and hence the recommended function declaration is aop_t assert_case(aocase_t *aoc).

An assert operation or aop |ei'ou'pi| is an assertion unit of the assert operator case and is one of the following:

  • AOP_PASS - the assert operation is successful (always 0)
  • AOP_FAIL - the assert operation is failed and by default the test stops immediatly and the remaining assert operations are not run
  • AOP_SKIP - the assert operation is skipped and the test continues to run the remaining assert operations

To run an assert operation means to execute the assert_case() function with a test case to determine its assertion unit, aop. And during such exuction the assert operation can be violated by different factors and this process is called assertion operation violation. It is strongly recommended to assert operation violation as some can disrupt and even crash the system.

Currently, the following assertion operation violation can be caught:

  • AOV_MEMV - Unexpected Memory Access
  • AOV_PTRV - Unexpected Pointer Value
  • AOV_RTMV - Unexpected Real Time Expiration
  • AOV_UTMV - Unexpected User Time Expiration
  • AOV_ETMV - Unexpected Execution Time Expiration

An easy way to assert time expiration is to use an according assert operator timer:

  • AOT_RTM - Real Time
  • AOT_UTM - User (Virtual) Time
  • AOT_ETM - Execution (Profiling) Time

The assert operation, if complicated, can be subdivided into several assert operations and concatenated together as a final result using the most to less strict order: AOP_FAIL, AOP_SKIP and AOP_PASS. However, if the further computation is unnecessary or expensive then classical assertions should be used instead.

The plentiful functions provided are corporated the libaop library consisting of the following modules:

  • ao - functions to run assert operator
  • aop - functions to assert operations
  • aopf - functions to assert operations with the expected and actual arguments auto-formatting and optional formatting
  • assert - classical assertions
  • aov - functions to assert operation violation
  • aot - functions to run assert operator times
  • ... - *modules are to be added...

Installation

tar xzvf ao.tar.gz
cd ao
./ao.sh setup --verbose

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.