Low-level tests (tests/lo)
==========================

* These are to test py8x, a.k.a. _libi8x.so.

* The aim is for 100% coverage of libi8x.c.
  (That's everything in libi8x.c.in,
   and everything generated by mkpy3capi.py.)

* Every function you get from "import _libi8x" should have a
  corresponding test_py8x_XXX.py file.

* Don't over-test: don't test C libi8x here, just py8x.
  e.g. i8x_xctx_call can return various i8x_err_e codes,
  but in tests/lo we only need to test:
   - i8x_xctx_call returns I8X_OK
   - i8x_xctx_call returns an error

* How to check coverage?
   - CFLAGS="-coverage" python setup.py build_ext --inplace
   - nosetests tests/lo
   - cp build/temp.linux-x86_64-2.7/*.gc{da,no} .
   - gcov libi8x.gcno

* How to check for functions not used by high-level layer?
   - CFLAGS="-coverage" python setup.py build_ext --inplace
   - nosetests tests/hi
   - cp build/temp.linux-x86_64-2.7/*.gc{da,no} .
   - gcov libi8x.gcno
   - grep '#####.*:py8x_.*self.*args' libi8x.c.gcov \
       | sed 's/.*:\([^[:space:]]*\).*/\1/'


High-level tests (tests/hi)
===========================

* These are to test `find libi8x -name *.py`.

* The aim is for 100% coverage of those files.

* Don't over-test: don't test py8x or C libi8x here.
  e.g. Context.new_execution_context is just a straight wrapper
  for py8x_xctx_new.  We only need to test the success case for
  this to cover Context.new_execution_context.  Tests that ensure
  py8x_xctx_new raises exceptions correctly should be in tests/lo.
  Tests that py8x_xctx_new raises the correct exceptions should
  be in libi8x's tests.

* How to check coverage?
   - python setup.py build_ext --inplace
   - nosetests --with-coverage tests/hi
