0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-10-18 18:08:45 +00:00
Commit Graph

14 Commits

Author SHA1 Message Date
Pavel Tvrdík
c23cd84ed5 Add HMAC-SHA256 hash library and unit tests 2015-04-25 13:43:49 +02:00
Pavel Tvrdík
26b1fd1dc4 Add SHA256, SHA224 hash libraries and unit tests 2015-04-23 15:19:36 +02:00
Pavel Tvrdík
5245c4dd6d Birdtest: add io_log_event() mockup 2015-04-20 16:50:51 +02:00
Pavel Tvrdík
5419d2a3c5 Birdtest: Compability bug fixes
Tested on Ubuntu & FreeBSD & NetBSD & OpenBSD
2015-04-15 15:42:43 +02:00
Pavel Tvrdík
1ce8d33b80 Birdtest: Improve the testing framework
- non-blocking asserts, only set bt_test_suite_success
- unification of testing output from bt_assert_fn_in_out and bt_assert_out_fn_in
2015-04-15 11:51:24 +02:00
Pavel Tvrdík
a84b9c62d1 Birdtest: Add bt_assert_fn_in_*
- Improved test output formating: aligned, colored [ OK ] / [FAIL]
- A failed assert will not interupt the whole test suite
- bt_assert_fn_in_* are macros for testing input and output from the some
  function
2015-04-13 10:52:21 +02:00
Pavel Tvrdík
947018a7ef Birdtest: bt_test_case() -> bt_test_suite() 2015-04-13 10:42:10 +02:00
Pavel Tvrdík
83131f3fa5 Birdtest: Add Event Processing Tests
Add test/birdtest_support.h for provisional hack a build system
2015-04-03 12:52:44 +02:00
Pavel Tvrdík
e7bb2daf1f Birdtest: improve bt_check macro
Now dat for testing can be defined somelike this:

  struct in_out_data_ {
    char *in;
    u32 out;
  } in_out_data[] = {
      {
	  .in  = "192.168.1.128",
	  .out = build_ip4(192, 168, 1, 128),
      },
      {
	  .in  = "255.255.255.255",
	  .out = build_ip4(255, 255, 255, 255),
      },
      ...
  };

  bt_check(ip4_pton_, in_out_data, "%s", "0x%08X");
2015-04-03 12:46:04 +02:00
Pavel Tvrdík
1bdf2a54ed Birdtest: move def bt_rand_num() at a better place 2015-04-03 12:44:47 +02:00
Pavel Tvrdík
4b5e005d57 Birdtest: Add printing backtrace while segfault 2015-04-03 12:42:49 +02:00
Pavel Tvrdík
8edf5b99e8 Birdtest: Add bt_check()
- A function for check test some other function for
    in and out/expected data in array.
2015-03-27 14:04:37 +01:00
Pavel Tvrdík
cf545a3ceb Birdtest: Add bt_rand_num() 2015-03-27 14:03:47 +01:00
Pavel Tvrdík
f26cf70152 Birdtest: Refactore tests and build system
Rename directory:
  birdtest/* -> test/*

Rename Makefile rule:
  build-tests -> tests

Move run-all-test shell script from Makefile to stand-alone shell script

Simplify Makefile test build system
2015-03-23 17:40:13 +01:00