From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org> To: Igor Munkin <imun@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: Fri, 10 Apr 2020 00:05:34 +0200 [thread overview] Message-ID: <729e2d44-8a0d-3e98-b3f3-a84e8a1b9992@tarantool.org> (raw) In-Reply-To: <20200407233345.GD5713@tarantool.org> Hi! >>> 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. > > Sounds rational. They are not the same but quite similar (the difference > is only in the result values). At least first 24 lines of them match almost completely (except file name to start with io.popen), that is more than half of each. I think that part either should be simplified so as there is nothing to extract already (my proposal about io.popen() of self may help, or may not), or just extracted into a common file like test/app-tap/utils/utils.lua You can extract even more if you pass expected output with 'checks' array elements. If you want to do that in scope of luajit tests rework, then add it to the ticket description, please, so as not to forget. > I guess I can do it in scope of #4862[1] > if you're OK with it. > >> >>> + 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) >>> > > [1]: https://github.com/tarantool/tarantool/issues/4862 >
next prev parent reply other threads:[~2020-04-09 22:05 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 2020-04-05 19:32 ` Vladislav Shpilevoy 2020-04-07 23:33 ` Igor Munkin 2020-04-09 22:05 ` Vladislav Shpilevoy [this message] 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=729e2d44-8a0d-3e98-b3f3-a84e8a1b9992@tarantool.org \ --to=v.shpilevoy@tarantool.org \ --cc=imun@tarantool.org \ --cc=tarantool-patches@dev.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