From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 6D4474F62BB; Tue, 4 Jul 2023 20:21:08 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6D4474F62BB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1688491268; bh=NR7v85UslqrCtVSm+mrnJd662lH4719ctBEx2ZTFPs0=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=BLJnRk4udx4jkjDV82Nj0/38d0O1PDnXN0brTSirKdEUQBQhc8lHA9H6crVrghSk7 ZFRcL3U7C2mo8NVplKwl+v5Y+lOD0nEfSbA6pKNxGuYG+X1jCEYT6GdDaw6TMnQa3o FMP0Ksb4RhKwwFJ/2y/ErnZy/KXw7o38SeXlvU3w= Received: from smtp56.i.mail.ru (smtp56.i.mail.ru [95.163.41.94]) (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 C6A0F4F62BB for ; Tue, 4 Jul 2023 20:19:25 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C6A0F4F62BB Received: by smtp56.i.mail.ru with esmtpa (envelope-from ) id 1qGjgS-008Gpt-J0; Tue, 04 Jul 2023 20:19:25 +0300 Date: Tue, 4 Jul 2023 17:10:33 +0000 To: Sergey Kaplun Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD90EBD74C6BAAC9DBAE9A61822823A68649EFBB1BF04C9EBAE182A05F538085040D5AC0EF577E2187CB85DBE0EF5002DC1A12369CD2276124B88F64256AEB4CAE8 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE70312E9A300D47E3BEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063748D05F5E01EE6C998638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D84331CB9FD6F958ADC13A8E6CA36BE7F5117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC2EE5AD8F952D28FBA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735204B6963042765DA4BBDFBBEFFF4125B51D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A127C277FBC8AE2E8B7FE970921847EE7F3AA81AA40904B5D99C9F4D5AE37F343AD1F44FA8B9022EA23BBE47FD9DD3FB595F5C1EE8F4F765FC72CEEB2601E22B093A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E73542F54486E6D6388DC4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A5A4658A112BCDE1371EAC3F2D4B09586C871186B95E10612AF87CCE6106E1FC07E67D4AC08A07B9B0CE135D2742255B35CB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D34980A6B448CFD1B8A1D742E5F1D436EAF37FF991E4056D2BF73EE97E5D128F4086A5232CA8A6EBE8E1D7E09C32AA3244C753F068B0328F46D5CBF82EB178B10C4B038C9161EF167A1ED9A463B7D0AAFF65DA084F8E80FEBD376A4ED3E9341DC2FCD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojtu6fghEd2rU3wwCiv8LWWQ== X-Mailru-Sender: 2FEBA92C8E508479FE7B9A1DF348D531EDAB15FE90EAF998164E10D5EC54435CA5EC7BE87D4351342326FE6F2A341ACE0FB9F97486540B4CD9E8847AB8CFED4D9ABF8A61C016C2CFB0DAF586E7D11B3E67EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v4 luajit 0/6] Reworking C tests X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Igor Munkin via Tarantool-patches Reply-To: Igor Munkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Sergey, I've checked the patchset into all long-term branches in tarantool/luajit and bumped a new version in master, release/2.11 and release/2.10. On 10.06.23, Sergey Kaplun wrote: > The whole idea of the patch-set introduce module for LuaJIT C tests. It > also, can be used for unit tests. > * The first patch is the prerequisite for the patch-set. It fixes > LD_LIBRARY_PATH definition. > * The 2nd and 3d patches provides an API and helper for writing the tests. > * The last 3 patches rewrite existing tests that should be written in C in > the proper way. > > Branch: https://github.com/tarantool/luajit/tree/skaplun/gh-noticket-tarantool-c-tests > PR: https://github.com/tarantool/tarantool/pull/8444 > Related Issue: > * https://github.com/tarantool/tarantool/issues/7900 > * https://github.com/tarantool/tarantool/issues/781 > > Changes in v2: > 1) use > > | int _test_run_group(const char *group_name, const struct test_unit tests[], > | size_t n_tests, void *test_state); > > instead of > > | int _test_run_group(const char *group_name, const struct test_unit *tests, > | size_t n_tests, void *test_state); > > 2) `skip()` `skip_all()` and `todo()` helpers now return values to be > return to runner. > i.e. change usage from > | if (cond) > | skip("NIY"); > to > | if (cond) > | return skip("NIY"); > > `bail_out()` helper still just exits with error code, which corresponding > its standard specification. > > But now some parts of the code start to look "alya cringe": > | return todo("Need to replace backtrace with libunwind first"); > | lua_State *L = test_state; > | utils_get_aux_lfunc(L); > | (void)luaJIT_setmode(L, 0, LUAJIT_MODE_ENGINE | LUAJIT_MODE_OFF); > | (void)luaJIT_setmode(L, 0, LUAJIT_MODE_ENGINE | LUAJIT_MODE_FLUSH); > | check_profile_func(L); > | (void)luaJIT_setmode(L, 0, LUAJIT_MODE_ENGINE | LUAJIT_MODE_ON); > | return TEST_EXIT_SUCCESS; > > (Yes, we want to use unconditional `todo()`). > So I commented the similar code, helper `check_profile_func()`, etc. > with `#if 0`. > > 3) In 4th patch use subtest group for snap-related tests to skip all at > once with disabled JIT. > > 4) lj-49-bad-lightuserdata is moved in C tests, too. > > Changes in the v3: > > 1) Now helper `utils_load_aux_script()` from accepts the > filename of the Lua script to load (so, now define for test contains > the directory instead of the test filename). > 2) Add README.md for the 3rd commit with an example of usage. > 3) Add unit tests (ok, skip, todo) for lib. > 4) Move test builds to the 2nd commit to launch unit test > (), updating here <.gitignore> too. > 5) Fix typos. > > Changes in v4: > 1) Describe why the 1st patch is neccessary for this patchset in the > commit message. > 2) Move adding of the README.md in the second commit with description of > directives and assert macros. > 3) More verbose comments. > > Sergey Kaplun (6): > test: fix setting of {DY}LD_LIBRARY_PATH variables > test: introduce module for C tests > test: introduce utils.h helper for C tests > test: rewrite misclib-getmetrics-capi test in C > test: rewrite misclib-sysprof-capi test in C > test: rewrite lj-49-bad-lightuserdata test in C > > > -- > 2.34.1 > -- Best regards, IM