Tarantool development patches archive
 help / color / mirror / Atom feed
From: Igor Munkin <imun@tarantool.org>
To: Sergey Ostanevich <sergos@tarantool.org>,
	Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 4/4] test: enable luajit-tap:lj-flush-on-trace tests
Date: Mon, 30 Mar 2020 21:53:27 +0300	[thread overview]
Message-ID: <20200330185327.GL22874@tarantool.org> (raw)
In-Reply-To: <391b2b4e4c8c6d4875f00bdd4dafa08999cc59af.1585312984.git.imun@tarantool.org>

Fixed the issue with shared library suffix. The diff is below:

================================================================================

diff --git a/test/app-tap/lj-flush-on-trace.test.lua b/test/app-tap/lj-flush-on-trace.test.lua
index 70b7bd9a2..ad6a484ed 100755
--- a/test/app-tap/lj-flush-on-trace.test.lua
+++ b/test/app-tap/lj-flush-on-trace.test.lua
@@ -4,9 +4,13 @@ local tap = require('tap')
 
 local test = tap.test('lj-flush-on-trace')
 
-local cmd = string.gsub(
-  'LUA_CPATH=$/?.so LD_LIBRARY_PATH=$ tarantool 2>&1 $/test.lua %d %d',
-  '%$', os.getenv('BUILDDIR') .. '/test/luajit-tap/lj-flush-on-trace')
+local vars = {
+  PATH   = os.getenv('BUILDDIR') .. '/test/luajit-tap/lj-flush-on-trace',
+  SUFFIX = package.cpath:match('?.(%a+);'),
+}
+
+local cmd = string.gsub('LUA_CPATH=<PATH>/?.<SUFFIX> LD_LIBRARY_PATH=<PATH> '
+  .. 'tarantool 2>&1 <PATH>/test.lua %d %d', '%<(%w+)>', vars)
 
 local checks = {
   { hotloop = 1, trigger = 1, success = true  },

================================================================================

Also added a skipcond for FreeBSD:

================================================================================

diff --git a/test/app-tap/lj-flush-on-trace.skipcond
b/test/app-tap/lj-flush-on-trace.skipcond
new file mode 100644
index 000000000..2a2ec4d97
--- /dev/null
+++ b/test/app-tap/lj-flush-on-trace.skipcond
@@ -0,0 +1,7 @@
+import platform
+
+# Disabled on FreeBSD due to #4819.
+if platform.system() == 'FreeBSD':
+    self.skip = 1
+
+# vim: set ft=python:

================================================================================

On 27.03.20, Igor Munkin wrote:
> The test is added as a CMake subdirectory and the runner executes
> tarantool test.lua command via io.popen to check whether the platform
> successfully finishes the execution or platform panic occurs.
> 
> Signed-off-by: Igor Munkin <imun@tarantool.org>
> ---
>  test/CMakeLists.txt                     |  1 +
>  test/app-tap/lj-flush-on-trace.test.lua | 30 +++++++++++++++++++++++++
>  2 files changed, 31 insertions(+)
>  create mode 100755 test/app-tap/lj-flush-on-trace.test.lua
> 
> diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
> index bceea4567..0ae3843e3 100644
> --- a/test/CMakeLists.txt
> +++ b/test/CMakeLists.txt
> @@ -60,6 +60,7 @@ add_subdirectory(app-tap)
>  add_subdirectory(box)
>  add_subdirectory(unit)
>  add_subdirectory(luajit-tap/gh-4427-ffi-sandwich)
> +add_subdirectory(luajit-tap/lj-flush-on-trace)
>  
>  # Move tarantoolctl config
>  if (NOT ${PROJECT_BINARY_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
> diff --git a/test/app-tap/lj-flush-on-trace.test.lua b/test/app-tap/lj-flush-on-trace.test.lua
> new file mode 100755
> index 000000000..70b7bd9a2
> --- /dev/null
> +++ b/test/app-tap/lj-flush-on-trace.test.lua
> @@ -0,0 +1,30 @@
> +#!/usr/bin/env tarantool
> +
> +local tap = require('tap')
> +
> +local test = tap.test('lj-flush-on-trace')
> +
> +local cmd = string.gsub(
> +  'LUA_CPATH=$/?.so LD_LIBRARY_PATH=$ tarantool 2>&1 $/test.lua %d %d',
> +  '%$', os.getenv('BUILDDIR') .. '/test/luajit-tap/lj-flush-on-trace')
> +
> +local checks = {
> +  { hotloop = 1, trigger = 1, success = true  },
> +  { hotloop = 1, trigger = 2, success = false },
> +}
> +
> +test:plan(#checks)
> +
> +for _, ch in pairs(checks) do
> +  local res
> +  local proc = io.popen(cmd:format(ch.hotloop, ch.trigger))
> +  for s in proc:lines('*l') do res = s end
> +  assert(res, 'proc:lines failed')
> +  if ch.success then
> +    test:is(res, 'OK')
> +  else
> +    test:is(res, 'JIT mode change is detected while executing the trace')
> +  end
> +end
> +
> +os.exit(test:check() and 0 or 1)
> -- 
> 2.25.0
> 

-- 
Best regards,
IM

  reply	other threads:[~2020-03-30 18:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-27 13:23 [Tarantool-patches] [PATCH 0/4] Enable LuaJIT tests written in C Igor Munkin
2020-03-27 13:23 ` [Tarantool-patches] [PATCH 1/4] luajit: bump new version Igor Munkin
2020-03-27 13:23 ` [Tarantool-patches] [PATCH 2/4] test: adjust luajit-tap testing machinery Igor Munkin
2020-04-05 19:32   ` Vladislav Shpilevoy
2020-04-07 23:05     ` Igor Munkin
2020-03-27 13:23 ` [Tarantool-patches] [PATCH 3/4] test: enable luajit-tap:gh-4427-ffi-sandwich tests Igor Munkin
2020-03-30 18:53   ` Igor Munkin
2020-04-05 19:32   ` Vladislav Shpilevoy
2020-04-07 23:28     ` Igor Munkin
2020-04-09 22:05       ` Vladislav Shpilevoy
2020-04-15  0:46         ` Igor Munkin
2020-03-27 13:23 ` [Tarantool-patches] [PATCH 4/4] test: enable luajit-tap:lj-flush-on-trace tests Igor Munkin
2020-03-30 18:53   ` Igor Munkin [this message]
2020-04-05 19:32   ` Vladislav Shpilevoy
2020-04-07 23:33     ` Igor Munkin
2020-04-09 22:05       ` Vladislav Shpilevoy
2020-04-15  0:47         ` Igor Munkin
2020-03-27 13:32 ` [Tarantool-patches] [PATCH 0/4] Enable LuaJIT tests written in C Igor Munkin
2020-03-28 11:18   ` Igor Munkin
2020-03-30 18:55     ` Igor Munkin

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=20200330185327.GL22874@tarantool.org \
    --to=imun@tarantool.org \
    --cc=sergos@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 4/4] test: enable luajit-tap:lj-flush-on-trace tests' \
    /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