From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 6BE012D770 for ; Sun, 25 Nov 2018 23:03:20 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SjDJkTr3HFoR for ; Sun, 25 Nov 2018 23:03:20 -0500 (EST) Received: from smtp54.i.mail.ru (smtp54.i.mail.ru [217.69.128.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 9F68D2D673 for ; Sun, 25 Nov 2018 23:03:19 -0500 (EST) Date: Mon, 26 Nov 2018 07:03:16 +0300 From: Alexander Turenko Subject: [tarantool-patches] Re: [PATCH] test: skip test backtrace if no libunwind support Message-ID: <20181126040315.akdyajokz7xsnx4w@tkn_work_nb> References: <20181123100732.11180-1-sergw@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20181123100732.11180-1-sergw@tarantool.org> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: Sergei Voronezhskii Cc: tarantool-patches@freelists.org, 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.