[PATCH nft 0/6] add infrastructure for unit tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


There are new new make targets:

  - "build-all"
  - "check" (runs "normal" tests, like unit tests and "tools/check-tree.sh").
  - "check-more" (runs extra tests, like "tests/build")
  - "check-all" (runs "check" + "check-more")
  - "check-local" (a subset of "check")
  - "check-TESTS" (the unit tests)

The unit tests have a test runner "tools/test-runner.sh". See
`tools/test-runner.sh -h` for options, like valgrind, GDB, or make.
It also runs the test in a separate namespace (rootless).

To run unit tests only, `make check-TESTS` or `tools/test-runner.sh
tests/unit/test-libnftables-static -m`.

The unit tests are of course still empty. "tests/unit" is the place
where tests shall be added.

Thomas Haller (6):
  gitignore: ignore build artifacts from top level file
  build: add basic "check-{local,more,all}" and "build-all" make targets
  build: add `make check-tests-build` to add build test
  build: add check for consistency of source tree
  build: cleanup if blocks for conditional compilation
  tests/unit: add unit tests for libnftables

 .gitignore                           |  15 +-
 Makefile.am                          | 128 ++++++++++++---
 src/.gitignore                       |   5 -
 tests/unit/nft-test.h                |  14 ++
 tests/unit/test-libnftables-static.c |  16 ++
 tests/unit/test-libnftables.c        |  21 +++
 tools/test-runner.sh                 | 228 +++++++++++++++++++++++++++
 7 files changed, 399 insertions(+), 28 deletions(-)
 create mode 100644 tests/unit/nft-test.h
 create mode 100644 tests/unit/test-libnftables-static.c
 create mode 100644 tests/unit/test-libnftables.c
 create mode 100755 tools/test-runner.sh


[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux