Tarantool development patches archive
 help / color / mirror / Atom feed
* [tarantool-patches] [PATCH] test: skip test backtrace if no libunwind support
@ 2018-11-23 10:07 Sergei Voronezhskii
  2018-11-26  4:03 ` [tarantool-patches] " Alexander Turenko
  2018-11-29 12:36 ` [tarantool-patches] " Vladimir Davydov
  0 siblings, 2 replies; 3+ messages in thread
From: Sergei Voronezhskii @ 2018-11-23 10:07 UTC (permalink / raw)
  To: tarantool-patches; +Cc: Kirill Yukhin, Georgy Kirichenko, Alexander Turenko

Fixes: #3824
---
BASE: 1.10-features
BUILD: https://travis-ci.org/tarantool/tarantool/builds/458722725
BRANCH: https://github.com/tarantool/tarantool/tree/sergw/fix-fiber-test-if-no-libunwind
 test/app/fiber.result   | 4 +++-
 test/app/fiber.test.lua | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/test/app/fiber.result b/test/app/fiber.result
index 59aa8d5c6..79f6642f2 100644
--- a/test/app/fiber.result
+++ b/test/app/fiber.result
@@ -864,7 +864,9 @@ f1 = fiber.create(sf3)
 info = fiber.info()
 ---
 ...
-backtrace = info[f1:id()].backtrace
+-- if compibled without libunwind support, need to return mock object here
+-- to skip this test, see #3824
+backtrace = info[f1:id()].backtrace or {{L = 'sf1'}, {L = 'loop'}, {L = 'sf3'}}
 ---
 ...
 bt_str = ''
diff --git a/test/app/fiber.test.lua b/test/app/fiber.test.lua
index b9d82ef05..e3165edaf 100644
--- a/test/app/fiber.test.lua
+++ b/test/app/fiber.test.lua
@@ -340,7 +340,9 @@ function sf3() sf2() end
 f1 = fiber.create(sf3)
 
 info = fiber.info()
-backtrace = info[f1:id()].backtrace
+-- if compibled without libunwind support, need to return mock object here
+-- to skip this test, see #3824
+backtrace = info[f1:id()].backtrace or {{L = 'sf1'}, {L = 'loop'}, {L = 'sf3'}}
 bt_str = ''
 for _, b in pairs(backtrace) do bt_str = bt_str .. (b['L'] or '') end
 bt_str:find('sf1') ~= nil
-- 
2.18.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tarantool-patches] Re: [PATCH] test: skip test backtrace if no libunwind support
  2018-11-23 10:07 [tarantool-patches] [PATCH] test: skip test backtrace if no libunwind support Sergei Voronezhskii
@ 2018-11-26  4:03 ` Alexander Turenko
  2018-11-29 12:36 ` [tarantool-patches] " Vladimir Davydov
  1 sibling, 0 replies; 3+ messages in thread
From: Alexander Turenko @ 2018-11-26  4:03 UTC (permalink / raw)
  To: Sergei Voronezhskii; +Cc: tarantool-patches, Kirill Yukhin, Georgy Kirichenko

On Fri, Nov 23, 2018 at 01:07:32PM +0300, Sergei Voronezhskii wrote:
> Fixes: #3824
> ---
> BASE: 1.10-features
> BUILD: https://travis-ci.org/tarantool/tarantool/builds/458722725
> BRANCH: https://github.com/tarantool/tarantool/tree/sergw/fix-fiber-test-if-no-libunwind
>  test/app/fiber.result   | 4 +++-
>  test/app/fiber.test.lua | 4 +++-
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 

> diff --git a/test/app/fiber.test.lua b/test/app/fiber.test.lua
> index b9d82ef05..e3165edaf 100644
> --- a/test/app/fiber.test.lua
> +++ b/test/app/fiber.test.lua
> @@ -340,7 +340,9 @@ function sf3() sf2() end
>  f1 = fiber.create(sf3)
>  
>  info = fiber.info()
> -backtrace = info[f1:id()].backtrace
> +-- if compibled without libunwind support, need to return mock object here

compibled -> compiled

> +-- to skip this test, see #3824
> +backtrace = info[f1:id()].backtrace or {{L = 'sf1'}, {L = 'loop'}, {L = 'sf3'}}
>  bt_str = ''
>  for _, b in pairs(backtrace) do bt_str = bt_str .. (b['L'] or '') end
>  bt_str:find('sf1') ~= nil

We can check

require('tarantool').build.options:match('-DENABLE_BACKTRACE=([^ ]+)'):upper()

against 1, ON, YES, TRUE, Y, or a non-zero number (see [1]) (note that
default is enabled) and disable the test when backtraces are disabled
(you can wrap the test into a function).

Your approach is simpler, but it will accept lack of backtrace for a
build with enabled backtraces. Hovewer it looks okay for me, because
unlikely to occur.

Georgy, what do you think?

[1]: https://cmake.org/cmake/help/v3.0/command/if.html

WBR, Alexander Turenko.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [tarantool-patches] [PATCH] test: skip test backtrace if no libunwind support
  2018-11-23 10:07 [tarantool-patches] [PATCH] test: skip test backtrace if no libunwind support Sergei Voronezhskii
  2018-11-26  4:03 ` [tarantool-patches] " Alexander Turenko
@ 2018-11-29 12:36 ` Vladimir Davydov
  1 sibling, 0 replies; 3+ messages in thread
From: Vladimir Davydov @ 2018-11-29 12:36 UTC (permalink / raw)
  To: Sergei Voronezhskii
  Cc: tarantool-patches, Kirill Yukhin, Georgy Kirichenko, Alexander Turenko

Pushed to 2.1.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-29 12:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-23 10:07 [tarantool-patches] [PATCH] test: skip test backtrace if no libunwind support Sergei Voronezhskii
2018-11-26  4:03 ` [tarantool-patches] " Alexander Turenko
2018-11-29 12:36 ` [tarantool-patches] " Vladimir Davydov

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