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 B067D4427E9; Sat, 20 May 2023 11:42:32 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org B067D4427E9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1684572152; bh=1iOFcMj5OJH+7ELityUeCRQZaSc7WAnqqvG3E5q+zWM=; 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=mXrS1XhrvciO+VVLrXqkT0jEQPpuHWqUn33dYiImjfaSy69cQz+9Ewu2vJyAg/OhS PgdoEs+o9Q7AX5S3A/Uai4VqRE7rGwHsXzdJvJ6dBpS5fFj0a6op7w2qhQF5IB2q/G d79/X8rI+zQ4zfa69Fiub1NIHAp6gaviugnu4PIM= Received: from smtpng3.i.mail.ru (smtpng3.i.mail.ru [94.100.177.149]) (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 B60214427C8 for ; Sat, 20 May 2023 11:42:31 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org B60214427C8 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1q0IAY-0007qF-QO; Sat, 20 May 2023 11:42:31 +0300 Date: Sat, 20 May 2023 11:38:26 +0300 To: Maxim Kokryashkin Message-ID: References: <1684506553.475278652@f161.i.mail.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1684506553.475278652@f161.i.mail.ru> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD921E8753A900160F1284B0F69140CBAD176CF7240C0898F5B182A05F5380850403500C10CCC5807AD3C97A079B435C944AD722089DFC51B112A2E99FC7D0CECAF X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7DB7B102DCB413779EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006375DA0115FC9FAE6C68638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8BF3C837AF5F38EC4465EC628BB17AE6E117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCB816BE3345416868389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC84D3DDB508812D900F6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8BAEB924C2B054B06E75ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A5B4B777C688DE0981039ABA157452E89015CB3BCAE338322DF87CCE6106E1FC07E67D4AC08A07B9B01F9513A7CA91E555CB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D34AF12ADB97C97CD89E1D9BC01E9BD7CDA003AD0002E095A4FC218DAF311A20AEB6E901AB9AD11B79B1D7E09C32AA3244C8451695349C2D976FD34B89DF84991D864EE5813BBCA3A9D927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojlaZ30BpkxfKN7YpjHYC58Q== X-DA7885C5: 3E712C65848D83E0B3281E8271068F84C6B14DBB856EAAE0743BEAFB5D782EEA262E2D401490A4A0DB037EFA58388B346E8BC1A9835FDE71 X-Mailru-Sender: 689FA8AB762F73930F533AC2B33E986B360335A41D19739E2EC04DB1862163460FBE9A32752B8C9C2AA642CC12EC09F1FB559BB5D741EB962F61BD320559CF1EFD657A8799238ED55FEEDEB644C299C0ED14614B50AE0675 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 luajit 0/6] Revorking 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: Sergey Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Maxim! Thanks for the reply! On 19.05.23, Maxim Kokryashkin wrote: > > Hi! > Thanks for the comments. >   > >  > >>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 > >> > >>Thanks Maxim, for the review! > >> > >>I've fixed some Maxim comments and suggestions for the previous series. > >>Some ignorable comments about wording are ignored:). > >> > >>Also, see answers for your questions below: > >> > >>> >+if(NOT PROVE) > >>> >+ message(WARNING "`prove' is not found, so tarantool-c-tests target is not generated") > >>> >+ return() > >>> >+endif() > >>> There is the same check in the test/tarantool-tests/CMakeLists.txt. Maybe > >>> we should move it to the higher-level CMake so the lower-level CMakeLists > >>> inherit it. > >> > >>I agree it maybe done, but not within this particular patchsett, so > >>ignoring for now. > >Don’t see any reason to postpone it, tbh. New module requires the same > >checks as the already present one. It seems logical to do necessary changes > >in this patchset. There are two testing suite (except the new one), that use this approach: * tarantool-tests * lua-Harness-tests So, for this patchset I just use the same beaten path. Also, we may try to build tests-target (suite) independently, and in this case the check should be in low-level CMake. > >> > >> > >>> >+#include "lj_arch.h" > >>> Side note: I don't like the approach with private headers, but > >>> I couldn't find any better way to check that. Maybe it is a good > >>> idea to implement a public C API function to get the information > >>> about OS and ARCH, since it is a really common to check them? > >> > >>I think, that this is the best option, espessialy if we want to write > >>some unit test for some specific module (I mean ). > >> > >>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; > >Well, what is cringe here? There are a few unreachable lines, but now it is > >obvious that those are skipped. Yes, unreachable lines looks very strange to me. > >> > >>(Yes, we want to use unconditional `todo()`). > >>So I commented the similar code, helper `check_profile_func()`, etc. > >>with `#if 0`. > >Do we really need to that though? Again, it is clearly visible that those are > >unreachable. Comment in `todo` is sufficient. I'm not sure about that, so I'll wait for the 2nd reviewer opinion. > > > > > >-- > >Best regards, > >Maxim Kokryashkin > >  -- Best regards, Sergey Kaplun