Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH luajit 0/5] Self-sufficient LuaJIT testing environment
@ 2021-02-02 20:57 Igor Munkin via Tarantool-patches
  2021-02-02 20:57 ` [Tarantool-patches] [PATCH luajit 1/5] build: preserve the original build system Igor Munkin via Tarantool-patches
                   ` (5 more replies)
  0 siblings, 6 replies; 46+ messages in thread
From: Igor Munkin via Tarantool-patches @ 2021-02-02 20:57 UTC (permalink / raw)
  To: Sergey Kaplun, Timur Safin; +Cc: 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 <options>

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 <test> 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 $<TARGET_FILE:${LUAJIT_DEPS}>. Unfortunately older
CMake can't expand the generator expression used in DEPENDS section of
<add_custom_(command|target)>. 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


^ permalink raw reply	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2021-02-28 22:04 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-02 20:57 [Tarantool-patches] [PATCH luajit 0/5] Self-sufficient LuaJIT testing environment Igor Munkin via Tarantool-patches
2021-02-02 20:57 ` [Tarantool-patches] [PATCH luajit 1/5] build: preserve the original build system Igor Munkin via Tarantool-patches
2021-02-04 22:53   ` Timur Safin via Tarantool-patches
2021-02-08 15:56     ` Igor Munkin via Tarantool-patches
2021-02-09 11:38   ` Sergey Kaplun via Tarantool-patches
2021-02-09 12:47     ` Igor Munkin via Tarantool-patches
2021-02-09 14:45       ` Sergey Kaplun via Tarantool-patches
2021-02-09 15:28         ` Igor Munkin via Tarantool-patches
2021-02-10  9:35           ` Sergey Kaplun via Tarantool-patches
2021-02-02 20:57 ` [Tarantool-patches] [PATCH luajit 2/5] build: replace GNU Make with CMake Igor Munkin via Tarantool-patches
2021-02-04 22:53   ` Timur Safin via Tarantool-patches
2021-02-08 15:56     ` Igor Munkin via Tarantool-patches
2021-02-09 13:55       ` Timur Safin via Tarantool-patches
2021-02-09 15:09         ` Igor Munkin via Tarantool-patches
2021-02-11 19:23   ` Sergey Kaplun via Tarantool-patches
2021-02-16 15:28     ` Igor Munkin via Tarantool-patches
2021-02-18  9:56       ` Sergey Kaplun via Tarantool-patches
2021-02-20 19:18         ` Igor Munkin via Tarantool-patches
2021-02-27 10:48           ` Sergey Kaplun via Tarantool-patches
2021-02-28 18:18             ` Igor Munkin via Tarantool-patches
2021-02-13  3:47   ` Sergey Kaplun via Tarantool-patches
2021-02-16 15:32     ` Igor Munkin via Tarantool-patches
2021-02-02 20:57 ` [Tarantool-patches] [PATCH luajit 3/5] test: run LuaJIT tests via CMake Igor Munkin via Tarantool-patches
2021-02-08 15:05   ` Timur Safin via Tarantool-patches
2021-02-08 16:29     ` Igor Munkin via Tarantool-patches
2021-02-09  8:16       ` Timur Safin via Tarantool-patches
2021-02-09  8:43         ` Igor Munkin via Tarantool-patches
2021-02-09 13:59           ` Timur Safin via Tarantool-patches
2021-02-09 15:10             ` Igor Munkin via Tarantool-patches
2021-02-14 18:48   ` Sergey Kaplun via Tarantool-patches
2021-02-19 19:04     ` Igor Munkin via Tarantool-patches
2021-02-27 13:50       ` Sergey Kaplun via Tarantool-patches
2021-02-28 18:18         ` Igor Munkin via Tarantool-patches
2021-02-02 20:57 ` [Tarantool-patches] [PATCH luajit 4/5] test: fix warnings found with luacheck in misclib* Igor Munkin via Tarantool-patches
     [not found]   ` <012f01d6fe1a$a2aa6890$e7ff39b0$@tarantool.org>
     [not found]     ` <2c495492-50f4-acfd-ad66-2cb44abb5fa1@tarantool.org>
2021-02-08 15:40       ` Sergey Bronnikov via Tarantool-patches
2021-02-08 15:58       ` Igor Munkin via Tarantool-patches
2021-02-08 15:57     ` Igor Munkin via Tarantool-patches
2021-02-14 19:16   ` Sergey Kaplun via Tarantool-patches
2021-02-16 15:29     ` Igor Munkin via Tarantool-patches
2021-02-16 16:36       ` Sergey Kaplun via Tarantool-patches
2021-02-02 20:57 ` [Tarantool-patches] [PATCH luajit 5/5] test: run luacheck static analysis via CMake Igor Munkin via Tarantool-patches
2021-02-04 22:52   ` Timur Safin via Tarantool-patches
2021-02-08 15:57     ` Igor Munkin via Tarantool-patches
2021-02-14 19:32   ` Sergey Kaplun via Tarantool-patches
2021-02-19 19:14     ` Igor Munkin via Tarantool-patches
2021-02-28 22:04 ` [Tarantool-patches] [PATCH luajit 0/5] Self-sufficient LuaJIT testing environment Igor Munkin via Tarantool-patches

Tarantool development patches archive

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://lists.tarantool.org/tarantool-patches/0 tarantool-patches/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 tarantool-patches tarantool-patches/ https://lists.tarantool.org/tarantool-patches \
		tarantool-patches@dev.tarantool.org.
	public-inbox-index tarantool-patches

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git