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 F25D263340; Tue, 2 Feb 2021 23:57:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org F25D263340 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1612299472; bh=qr4I2uL9klqNyAGiFfzapoHiyeuQhZdOw1KYgT15Vy0=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=gQhZqUdJ6gNhcX/uHYpYyZ4wCFztS3RBLKPcoSSHpXp0hNRb4/kd3piB5aFDfglCS 1AO5JVN/s0lT1chhYghMLCzqO9K+/Q0UXo1cIMY53IpWoYOwDIA272u7oAs6qUEEfJ qSRhJzzfGTi//oc7jcCXq3UnEkn9stjuI7CJ76FU= Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [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 C19C96C7D4 for ; Tue, 2 Feb 2021 23:57:50 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C19C96C7D4 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1l72k9-0005mg-Dz; Tue, 02 Feb 2021 23:57:49 +0300 To: Sergey Kaplun , Timur Safin Date: Tue, 2 Feb 2021 23:57:40 +0300 Message-Id: X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD953AC099BC0052A9CD238BCF93DF23716D1711D0DDC4F5AC2182A05F5380850408D0E194D8FB80CC9ACD0BC19D8BA1E460FFD461EC166477F9555306BDD73EBE7 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7011EB7026DD4A9BAEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063790B55F3E386DB9B28638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FCDAFBC183B389AD4445731A170F3BF1D1504C0EDA3B3203DB389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C07E7E81EEA8A9722B8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B68424CA1AAF98A6958941B15DA834481F9449624AB7ADAF3735872C767BF85DA29E625A9149C048EE0A3850AC1BE2E7351CE60B8040019C364AD6D5ED66289B524E70A05D1297E1BB35872C767BF85DA227C277FBC8AE2E8B6435C1528B3C0E0675ECD9A6C639B01B4E70A05D1297E1BBC6867C52282FAC85D9B7C4F32B44FF57285124B2A10EEC6C00306258E7E6ABB4E4A6367B16DE6309 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2BBE337FB72E923155C0AF1600DCBC20B1CE701AD2DEDB67EDE071E99FCCC482E X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C823F58AE0C7795A9BE118F94A9ACAC9415F0D740F76D7C539C2B6934AE262D3EE7EAB7254005DCEDCF79CE3658D143441E0A4E2319210D9B64D260DF9561598F01A9E91200F654B0CCA28C6D779E2CD78E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34AC223B6CC5B2DFAC6CCE279125F4D6F11B72F2BC67C82B4622D393F90EA7A2E4E2BE93479BDF14241D7E09C32AA3244CB2AB9290D1B7A7B1E79D0A07A73ACEBF8580396430872480927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojbL9S8ysBdXgSP4b4jTrwBmv5g1r6TYqA X-Mailru-Sender: 689FA8AB762F73936BC43F508A0638224E1BF1B95D2538D5E1DF60FD81A847FDA7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH luajit 0/5] Self-sufficient LuaJIT testing environment 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" This series moves LuaJIT-related parts of Tarantool testing machinery to LuaJIT repository. For this purpose the build system is partially ported to CMake. To avoid Makefiles name clashing the original build system is renamed to keep it working. As a result of these changes one need to explicitly specify the Makefile in the build command: | make -f Makefile.original These changes provides CMake build system only for the following OS: GNU/Linux, OSX, FreeBSD. For other platrforms use the old build system. To run all available tests a separate target is introduced. The whole testing machinery is reworked much but the existing tests are left mostly unchanged. However, considering the way LuaJIT is integrated into Tarantool, this machinery provides two new configuration options: * LUAJIT_USE_TEST: to omit target configuration for LuaJIT to respect CMP0002 policy. * LUAJIT_TEST_BINARY: to choose which binary (i.e. Lua runtime) to be used for running them. The latter option value is used as a dependency for tests, and its default value is $. Unfortunately older CMake can't expand the generator expression used in DEPENDS section of . As a result the CMake minimum required version is bumped to 3.1 project-wide[1]. For more info see CMake Release notes[2] for 3.1 version. Finally, existing tests are grouped and moved to a separate directory under the root test directory to make the further addition of other available test suites in scope of #4064[3] and #4473[4] easier. Tarantool tests are implemented using Tarantool on-board TAP module[5], that is moved to LuaJIT repository with a little changes to save Lua chunks untouched. Other auxiliary files for Tarantool-specific testing (such as *.skipcond, suite.ini), in turn, are removed. To run static analysis for Lua chunks a separate target is introduced. In scope of this target luacheck is run against all Lua chunks within LuaJIT repository except those inherited from LuaJIT vanilla repository, to leave them coherent with the upstream. Since the regular static analysis has not been enabled for the test chunks in LuaJIT repository yet, the tests for recently implemented features still produce luacheck warnings. The most of the issues are fixed in scope of the commit 8fc103fb1a21c28185a1942e75d8d9485e3aade7 ('test: fix warnings spotted by luacheck') and the last patch fixes the remaining ones. [1]: https://lists.tarantool.org/tarantool-patches/20210127130947.yw5sdswpokujblyr@tarantool.org/T/#t [2]: https://cmake.org/cmake/help/latest/release/3.1.html#commands [3]: https://github.com/tarantool/tarantool/issues/4064 [4]: https://github.com/tarantool/tarantool/issues/4473 [5]: https://www.tarantool.io/en/doc/latest/reference/reference_lua/tap/ Branch: https://github.com/tarantool/luajit/tree/imun/gh-4862-cmake Issues: * https://github.com/tarantool/tarantool/issues/4862 * https://github.com/tarantool/tarantool/issues/5470 * https://github.com/tarantool/tarantool/issues/5631 Igor Munkin (5): build: preserve the original build system build: replace GNU Make with CMake test: run LuaJIT tests via CMake test: fix warnings found with luacheck in misclib* test: run luacheck static analysis via CMake .gitignore | 14 +- .luacheckrc | 11 + CMakeLists.txt | 290 +++++++++++++ Makefile => Makefile.original | 44 +- cmake/LuaJITUtils.cmake | 31 ++ cmake/MakeSourceList.cmake | 47 +++ cmake/SetDynASMFlags.cmake | 130 ++++++ cmake/SetTargetFlags.cmake | 42 ++ cmake/SetVersion.cmake | 45 ++ etc/CMakeLists.txt | 33 ++ etc/{luajit.pc => luajit.pc.in} | 4 +- src/CMakeLists.txt | 396 ++++++++++++++++++ src/{Makefile.dep => Makefile.dep.original} | 0 src/{Makefile => Makefile.original} | 4 +- src/host/CMakeLists.txt | 62 +++ test/CMakeLists.txt | 62 ++- test/gh-4427-ffi-sandwich.skipcond | 7 - test/gh-4427-ffi-sandwich/CMakeLists.txt | 1 - test/lj-flush-on-trace.skipcond | 7 - test/lj-flush-on-trace/CMakeLists.txt | 1 - test/misclib-getmetrics-capi.skipcond | 7 - test/misclib-getmetrics-capi/CMakeLists.txt | 1 - test/misclib-getmetrics-lapi.skipcond | 7 - test/suite.ini | 6 - test/tarantool-tests/CMakeLists.txt | 92 ++++ .../gh-3196-incorrect-string-length.test.lua | 2 +- .../gh-4427-ffi-sandwich.test.lua | 24 +- .../gh-4427-ffi-sandwich/CMakeLists.txt | 1 + .../gh-4427-ffi-sandwich/libsandwich.c | 0 ...gh-4476-fix-string-find-recording.test.lua | 2 +- ...gh-4773-tonumber-fail-on-NUL-char.test.lua | 2 +- .../lj-494-table-chain-infinite-loop.test.lua | 2 +- ...lj-505-fold-no-strref-for-ptrdiff.test.lua | 2 +- .../lj-524-fold-conv-respect-src-irt.test.lua | 2 +- .../lj-flush-on-trace.test.lua | 24 +- .../lj-flush-on-trace/CMakeLists.txt | 1 + .../lj-flush-on-trace/libflush.c | 0 .../misclib-getmetrics-capi.test.lua | 27 +- .../misclib-getmetrics-capi/CMakeLists.txt | 1 + .../misclib-getmetrics-capi/testgetmetrics.c | 0 .../misclib-getmetrics-lapi.test.lua | 38 +- .../misclib-memprof-lapi.test.lua | 15 +- .../or-232-unsink-64-kptr.test.lua | 0 test/tarantool-tests/tap.lua | 306 ++++++++++++++ test/tarantool-tests/utils.lua | 43 ++ test/utils.lua | 33 -- tools/CMakeLists.txt | 77 ++++ tools/luajit-parse-memprof | 9 - tools/luajit-parse-memprof.in | 6 + 49 files changed, 1796 insertions(+), 165 deletions(-) create mode 100644 .luacheckrc create mode 100644 CMakeLists.txt rename Makefile => Makefile.original (85%) create mode 100644 cmake/LuaJITUtils.cmake create mode 100644 cmake/MakeSourceList.cmake create mode 100644 cmake/SetDynASMFlags.cmake create mode 100644 cmake/SetTargetFlags.cmake create mode 100644 cmake/SetVersion.cmake create mode 100644 etc/CMakeLists.txt rename etc/{luajit.pc => luajit.pc.in} (91%) create mode 100644 src/CMakeLists.txt rename src/{Makefile.dep => Makefile.dep.original} (100%) rename src/{Makefile => Makefile.original} (99%) create mode 100644 src/host/CMakeLists.txt delete mode 100644 test/gh-4427-ffi-sandwich.skipcond delete mode 100644 test/gh-4427-ffi-sandwich/CMakeLists.txt delete mode 100644 test/lj-flush-on-trace.skipcond delete mode 100644 test/lj-flush-on-trace/CMakeLists.txt delete mode 100644 test/misclib-getmetrics-capi.skipcond delete mode 100644 test/misclib-getmetrics-capi/CMakeLists.txt delete mode 100644 test/misclib-getmetrics-lapi.skipcond delete mode 100644 test/suite.ini create mode 100644 test/tarantool-tests/CMakeLists.txt rename test/{ => tarantool-tests}/gh-3196-incorrect-string-length.test.lua (94%) rename test/{ => tarantool-tests}/gh-4427-ffi-sandwich.test.lua (70%) create mode 100644 test/tarantool-tests/gh-4427-ffi-sandwich/CMakeLists.txt rename test/{ => tarantool-tests}/gh-4427-ffi-sandwich/libsandwich.c (100%) rename test/{ => tarantool-tests}/gh-4476-fix-string-find-recording.test.lua (99%) rename test/{ => tarantool-tests}/gh-4773-tonumber-fail-on-NUL-char.test.lua (95%) rename test/{ => tarantool-tests}/lj-494-table-chain-infinite-loop.test.lua (99%) rename test/{ => tarantool-tests}/lj-505-fold-no-strref-for-ptrdiff.test.lua (96%) rename test/{ => tarantool-tests}/lj-524-fold-conv-respect-src-irt.test.lua (95%) rename test/{ => tarantool-tests}/lj-flush-on-trace.test.lua (70%) create mode 100644 test/tarantool-tests/lj-flush-on-trace/CMakeLists.txt rename test/{ => tarantool-tests}/lj-flush-on-trace/libflush.c (100%) rename test/{ => tarantool-tests}/misclib-getmetrics-capi.test.lua (88%) create mode 100644 test/tarantool-tests/misclib-getmetrics-capi/CMakeLists.txt rename test/{ => tarantool-tests}/misclib-getmetrics-capi/testgetmetrics.c (100%) rename test/{ => tarantool-tests}/misclib-getmetrics-lapi.test.lua (94%) rename test/{ => tarantool-tests}/misclib-memprof-lapi.test.lua (86%) rename test/{ => tarantool-tests}/or-232-unsink-64-kptr.test.lua (100%) create mode 100644 test/tarantool-tests/tap.lua create mode 100644 test/tarantool-tests/utils.lua delete mode 100644 test/utils.lua create mode 100644 tools/CMakeLists.txt delete mode 100755 tools/luajit-parse-memprof create mode 100644 tools/luajit-parse-memprof.in -- 2.25.0