Tarantool development patches archive
 help / color / mirror / Atom feed
From: sergeyb@tarantool.org
To: tarantool-patches@dev.tarantool.org
Cc: o.piskunov@tarantool.org,
	Alexander Turenko <alexander.turenko@tarantool.org>
Subject: [Tarantool-patches] [PATCH 1/2] test: update unit test lib to produce TAP-compliant output
Date: Thu, 21 May 2020 12:59:20 +0300	[thread overview]
Message-ID: <0efa478f960af63eca977f5c3d9615c87197ccc5.1590053781.git.sergeyb@tarantool.org> (raw)
In-Reply-To: <cover.1590053781.git.sergeyb@tarantool.org>

From: Alexander Turenko <alexander.turenko@tarantool.org>

Closes #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 84eb066bd..0704d10f0 100644
--- a/test/unit/CMakeLists.txt
+++ b/test/unit/CMakeLists.txt
@@ -23,46 +23,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)
@@ -87,19 +89,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)
@@ -129,21 +131,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..27879ea98 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-05-21 10:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-21  9:59 [Tarantool-patches] [PATCH 0/2] Make unit tests TAP-compliant sergeyb
2020-05-21  9:59 ` sergeyb [this message]
2020-06-02  9:20   ` [Tarantool-patches] [PATCH 1/2] test: update unit test lib to produce TAP-compliant output Sergey Bronnikov
2020-06-03 22:52   ` Vladislav Shpilevoy
2020-06-08 15:37     ` Sergey Bronnikov
2020-05-21  9:59 ` [Tarantool-patches] [PATCH 2/2] test: update unit tests to make them TAP-compliant sergeyb
2020-06-02  9:20   ` Sergey Bronnikov
2020-06-03 22:52   ` Vladislav Shpilevoy
2020-06-08 15:49     ` Sergey Bronnikov
2020-06-02  9:21 ` [Tarantool-patches] [PATCH 0/2] Make unit tests TAP-compliant Sergey Bronnikov
2020-06-03 22:52 ` Vladislav Shpilevoy
2020-06-08 15:35   ` Sergey Bronnikov

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=0efa478f960af63eca977f5c3d9615c87197ccc5.1590053781.git.sergeyb@tarantool.org \
    --to=sergeyb@tarantool.org \
    --cc=alexander.turenko@tarantool.org \
    --cc=o.piskunov@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 1/2] 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