From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp44.i.mail.ru (smtp44.i.mail.ru [94.100.177.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 982EE4696C3 for ; Sun, 5 Apr 2020 22:32:42 +0300 (MSK) References: <391b2b4e4c8c6d4875f00bdd4dafa08999cc59af.1585312984.git.imun@tarantool.org> From: Vladislav Shpilevoy Message-ID: <78c7de63-85c7-efbb-3cca-d5d67e151d04@tarantool.org> Date: Sun, 5 Apr 2020 21:32:40 +0200 MIME-Version: 1.0 In-Reply-To: <391b2b4e4c8c6d4875f00bdd4dafa08999cc59af.1585312984.git.imun@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH 4/4] test: enable luajit-tap:lj-flush-on-trace tests List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Munkin , Sergey Ostanevich Cc: tarantool-patches@dev.tarantool.org > 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') This file is exactly the same as the other file for running a luajit test in the previous commit. I propose you to move this to a separate file, which would provide API to run arbitrary test via io.popen. Unless this won't be dropped if you find a way to make the new luajit tests runable via test-run as is. > + 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) >