Tarantool development patches archive
 help / color / mirror / Atom feed
From: Sergey Bronnikov via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: tarantool-patches@dev.tarantool.org,
	Sergey Kaplun <skaplun@tarantool.org>,
	max.kokryashkin@gmail.com
Subject: [Tarantool-patches] [PATCH luajit 2/3][v2] test: set dependencies to tarantool-tests explicitly
Date: Thu,  9 Nov 2023 16:08:38 +0300	[thread overview]
Message-ID: <6ea1998ab3bf37b75e3f399fc55572bb99392c0f.1699534835.git.sergeyb@tarantool.org> (raw)
In-Reply-To: <cover.1699534835.git.sergeyb@tarantool.org>

From: Sergey Bronnikov <sergeyb@tarantool.org>

In testsuite `tarantool-tests` we are using CMake macro `BuildTestCLib`
for building test C libraries. This macro builds a list `TESTLIBS` that
contains all libraries required for tarantool tests. However, CMake
skips adding C library to `TESTLIBS` on building test C library in the
following commit.

The patch removes `TESTLIBS` and adds each test C library as dependence
to CMake target `tarantool-tests` explicitly using `add_dependence`
command.
---
 test/tarantool-tests/CMakeLists.txt | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/test/tarantool-tests/CMakeLists.txt b/test/tarantool-tests/CMakeLists.txt
index c15d6037..d46e69a0 100644
--- a/test/tarantool-tests/CMakeLists.txt
+++ b/test/tarantool-tests/CMakeLists.txt
@@ -10,6 +10,10 @@ if(NOT PROVE)
   return()
 endif()
 
+add_custom_target(tarantool-tests
+  DEPENDS ${LUAJIT_TEST_BINARY}
+)
+
 macro(BuildTestCLib lib sources)
   add_library(${lib} SHARED EXCLUDE_FROM_ALL ${sources})
   target_include_directories(${lib} PRIVATE
@@ -37,12 +41,7 @@ macro(BuildTestCLib lib sources)
       CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}"
     )
   endif()
-  # XXX: Append the lib to be built to the dependency list.
-  # Unfortunately, there is no convenient way in CMake to extend
-  # the list in parent scope other than join two strings with
-  # semicolon. If one finds the normal way to make it work, feel
-  # free to reach me.
-  set(TESTLIBS "${lib};${TESTLIBS}" PARENT_SCOPE)
+  add_dependencies(tarantool-tests ${lib})
   # Add the directory where the lib is built to the list with
   # entries for LUA_CPATH environment variable, so LuaJIT can find
   # and load it. See the comment about extending the list in the
@@ -133,11 +132,6 @@ else()
   list(APPEND LUA_TEST_ENV_MORE LD_LIBRARY_PATH=${LD_LIBRARY_PATH})
 endif()
 
-# LUA_CPATH and LD_LIBRARY_PATH variables and also TESTLIBS list
-# with dependecies are set in scope of BuildTestLib macro.
-add_custom_target(tarantool-tests
-  DEPENDS ${LUAJIT_TEST_BINARY} ${TESTLIBS}
-)
 add_custom_command(TARGET tarantool-tests
   COMMENT "Running Tarantool tests"
   COMMAND
@@ -154,4 +148,3 @@ add_custom_command(TARGET tarantool-tests
       ${LUA_TEST_FLAGS}
   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
 )
-
-- 
2.34.1


  parent reply	other threads:[~2023-11-09 13:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-09 13:06 [Tarantool-patches] [PATCH luajit 0/3][v2] Fix C file generation in jit.bcsave Sergey Bronnikov via Tarantool-patches
2023-11-09 13:08 ` [Tarantool-patches] [PATCH luajit 1/3][v2] Add 'cc' file type for saving bytecode Sergey Bronnikov via Tarantool-patches
2023-11-13  7:04   ` Sergey Kaplun via Tarantool-patches
2023-11-15  9:39     ` Sergey Bronnikov via Tarantool-patches
2023-11-09 13:08 ` Sergey Bronnikov via Tarantool-patches [this message]
2023-11-13  7:10   ` [Tarantool-patches] [PATCH luajit 2/3][v2] test: set dependencies to tarantool-tests explicitly Sergey Kaplun via Tarantool-patches
2023-11-15 11:34     ` Sergey Bronnikov via Tarantool-patches
2023-11-09 13:08 ` [Tarantool-patches] [PATCH luajit 3/3][v2] Fix C file generation in jit.bcsave Sergey Bronnikov via Tarantool-patches
2023-11-13  7:10   ` Sergey Kaplun via Tarantool-patches
2024-02-29  7:40 ` [Tarantool-patches] [PATCH luajit 0/3][v2] " Igor Munkin via Tarantool-patches

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=6ea1998ab3bf37b75e3f399fc55572bb99392c0f.1699534835.git.sergeyb@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=estetus@gmail.com \
    --cc=max.kokryashkin@gmail.com \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit 2/3][v2] test: set dependencies to tarantool-tests explicitly' \
    /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