Tarantool development patches archive
 help / color / mirror / Atom feed
From: sergeyb@tarantool.org
To: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org
Subject: [Tarantool-patches] [PATCH v2 1/3] test: update unit test lib to produce TAP-compliant output
Date: Mon,  8 Jun 2020 18:58:20 +0300	[thread overview]
Message-ID: <883fd098e177f14c48d2b1b6dc1482aff148e0e3.1591631501.git.sergeyb@tarantool.org> (raw)
In-Reply-To: <cover.1591631501.git.sergeyb@tarantool.org>

From: Sergey Bronnikov <sergeyb@tarantool.org>

Part of #5000
---
 test/unit/CMakeLists.txt | 49 +++++++++++++++++++++-------------------
 test/unit/unit.c         |  3 +++
 test/unit/unit.h         | 13 ++++++++---
 3 files changed, 39 insertions(+), 26 deletions(-)

diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt
index 3bdfc6bb1..6183bfd78 100644
--- a/test/unit/CMakeLists.txt
+++ b/test/unit/CMakeLists.txt
@@ -27,46 +27,48 @@ target_link_libraries(stailq.test unit)
 add_executable(uri.test uri.c unit.c)
 target_link_libraries(uri.test uri unit)
 add_executable(queue.test queue.c)
+target_link_libraries(queue.test unit)
 add_executable(mhash.test mhash.c)
 target_link_libraries(mhash.test unit)
 add_executable(mhash_bytemap.test mhash_bytemap.c)
 target_link_libraries(mhash_bytemap.test unit)
 add_executable(rope_basic.test rope_basic.c)
-target_link_libraries(rope_basic.test salad)
+target_link_libraries(rope_basic.test salad unit)
 add_executable(rope_avl.test rope_avl.c)
-target_link_libraries(rope_avl.test salad)
+target_link_libraries(rope_avl.test salad unit)
 add_executable(rope_stress.test rope_stress.c)
-target_link_libraries(rope_stress.test salad)
+target_link_libraries(rope_stress.test salad unit)
 add_executable(rope.test rope.c)
-target_link_libraries(rope.test salad)
+target_link_libraries(rope.test salad unit)
 add_executable(int96.test int96.cc)
+target_link_libraries(int96.test unit)
 add_executable(bit.test bit.c bit.c)
-target_link_libraries(bit.test bit)
+target_link_libraries(bit.test bit unit)
 add_executable(bitset_basic.test bitset_basic.c)
-target_link_libraries(bitset_basic.test bitset)
+target_link_libraries(bitset_basic.test bitset unit)
 add_executable(bitset_iterator.test bitset_iterator.c)
-target_link_libraries(bitset_iterator.test bitset)
+target_link_libraries(bitset_iterator.test bitset unit)
 add_executable(bitset_index.test bitset_index.c)
-target_link_libraries(bitset_index.test bitset)
+target_link_libraries(bitset_index.test bitset unit)
 add_executable(base64.test base64.c)
 target_link_libraries(base64.test misc unit)
 add_executable(uuid.test uuid.c)
 target_link_libraries(uuid.test uuid unit)
 
 add_executable(bps_tree.test bps_tree.cc)
-target_link_libraries(bps_tree.test small misc)
+target_link_libraries(bps_tree.test small misc unit)
 add_executable(bps_tree_iterator.test bps_tree_iterator.cc)
-target_link_libraries(bps_tree_iterator.test small misc)
+target_link_libraries(bps_tree_iterator.test small misc unit)
 add_executable(rtree.test rtree.cc)
-target_link_libraries(rtree.test salad small)
+target_link_libraries(rtree.test salad small unit)
 add_executable(rtree_iterator.test rtree_iterator.cc)
-target_link_libraries(rtree_iterator.test salad small)
+target_link_libraries(rtree_iterator.test salad small unit)
 add_executable(rtree_multidim.test rtree_multidim.cc)
-target_link_libraries(rtree_multidim.test salad small)
+target_link_libraries(rtree_multidim.test salad small unit)
 add_executable(light.test light.cc)
-target_link_libraries(light.test small)
+target_link_libraries(light.test small unit)
 add_executable(bloom.test bloom.cc)
-target_link_libraries(bloom.test salad)
+target_link_libraries(bloom.test salad unit)
 add_executable(vclock.test vclock.cc)
 target_link_libraries(vclock.test vclock unit)
 add_executable(xrow.test xrow.cc)
@@ -91,19 +93,19 @@ if (NOT ENABLE_GCOV)
 endif ()
 
 add_executable(fiber_stress.test fiber_stress.cc)
-target_link_libraries(fiber_stress.test core)
+target_link_libraries(fiber_stress.test core unit)
 
 add_executable(fiber_cond.test fiber_cond.c unit.c)
-target_link_libraries(fiber_cond.test core)
+target_link_libraries(fiber_cond.test core unit)
 
 add_executable(fiber_channel.test fiber_channel.cc unit.c)
-target_link_libraries(fiber_channel.test core)
+target_link_libraries(fiber_channel.test core unit)
 
 add_executable(fiber_channel_stress.test fiber_channel_stress.cc)
-target_link_libraries(fiber_channel_stress.test core)
+target_link_libraries(fiber_channel_stress.test core unit)
 
 add_executable(cbus_stress.test cbus_stress.c)
-target_link_libraries(cbus_stress.test core stat)
+target_link_libraries(cbus_stress.test core stat unit)
 
 add_executable(cbus.test cbus.c)
 target_link_libraries(cbus.test core unit stat)
@@ -133,21 +135,22 @@ if (ENABLE_BUNDLED_MSGPUCK)
 endif ()
 
 add_executable(scramble.test scramble.c)
-target_link_libraries(scramble.test scramble)
+target_link_libraries(scramble.test scramble unit)
 
 add_executable(guava.test guava.c)
-target_link_libraries(guava.test salad small)
+target_link_libraries(guava.test salad small unit)
 
 add_executable(find_path.test find_path.c
     ${CMAKE_SOURCE_DIR}/src/find_path.c
 )
+target_link_libraries(find_path.test unit)
 
 add_executable(reflection_c.test reflection_c.c unit.c
     ${CMAKE_SOURCE_DIR}/src/lib/core/reflection.c)
 add_executable(reflection_cxx.test reflection_cxx.cc unit.c
     ${CMAKE_SOURCE_DIR}/src/lib/core/reflection.c)
 add_executable(csv.test csv.c)
-target_link_libraries(csv.test csv)
+target_link_libraries(csv.test csv unit)
 
 add_executable(json.test json.c)
 target_link_libraries(json.test json unit ${ICU_LIBRARIES})
diff --git a/test/unit/unit.c b/test/unit/unit.c
index d12b66f91..302dce2ef 100644
--- a/test/unit/unit.c
+++ b/test/unit/unit.c
@@ -26,6 +26,9 @@ plan(int count)
 	tests_done[level] = 0;
 	tests_failed[level] = 0;
 
+	if (level == 0)
+		printf("TAP version 13\n");
+
 	_space(stdout);
 	printf("%d..%d\n", 1, plan_test[level]);
 }
diff --git a/test/unit/unit.h b/test/unit/unit.h
index 43c301b28..b0f9e7f9f 100644
--- a/test/unit/unit.h
+++ b/test/unit/unit.h
@@ -33,9 +33,6 @@
 #include <stdio.h>
 #include <stdlib.h> /* exit() */
 
-#define header() printf("\t*** %s ***\n", __func__)
-#define footer() printf("\t*** %s: done ***\n", __func__)
-
 #define fail(expr, result) do {					\
 	fprintf(stderr, "Test failed: %s is %s at %s:%d, in function '%s'\n",\
 		expr, result, __FILE__, __LINE__, __func__);		\
@@ -129,6 +126,16 @@ int check_plan(void);
 	}						\
 }
 
+#define header() do {                                   \
+        _space(stdout);                                 \
+        printf("# *** %s ***\n", __func__);             \
+} while(0)
+
+#define footer() do {                                   \
+        _space(stdout);                                 \
+        printf("# *** %s: done ***\n", __func__);       \
+} while(0)
+
 #if defined(__cplusplus)
 }
 #endif /* defined(__cplusplus) */
-- 
2.23.0

  reply	other threads:[~2020-06-08 16:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-08 15:58 [Tarantool-patches] [PATCH v2 0/3] Make unit tests TAP-compliant sergeyb
2020-06-08 15:58 ` sergeyb [this message]
2020-06-08 23:55   ` [Tarantool-patches] [PATCH v2 1/3] test: update unit test lib to produce TAP-compliant output Vladislav Shpilevoy
2020-06-09 18:25     ` Sergey Bronnikov
2020-06-08 15:58 ` [Tarantool-patches] [PATCH v2 2/3] test: update unit tests to make them TAP-compliant sergeyb
2020-06-08 23:55   ` Vladislav Shpilevoy
2020-06-09 16:04     ` Sergey Bronnikov
2020-06-11 18:42   ` Vladislav Shpilevoy
2020-06-08 15:58 ` [Tarantool-patches] [PATCH v2 3/3] msgpuck: bump version to make test output TAP-compliant sergeyb
2020-06-08 16:03 ` [Tarantool-patches] [PATCH v2 4/3][msgpuck] test: " Sergey Bronnikov
2020-06-11 18:42 ` [Tarantool-patches] [PATCH v2 4/3] test: add additional checks Vladislav Shpilevoy
2020-06-11 18:42 ` [Tarantool-patches] [PATCH v2 0/3] Make unit tests TAP-compliant Vladislav Shpilevoy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=883fd098e177f14c48d2b1b6dc1482aff148e0e3.1591631501.git.sergeyb@tarantool.org \
    --to=sergeyb@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2 1/3] test: update unit test lib to produce TAP-compliant output' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox