diff --git a/Makefile b/Makefile index cef30af..d7a7101 100644 --- a/Makefile +++ b/Makefile @@ -18,11 +18,11 @@ lint: .rocks .PHONY: test test: .rocks - .rocks/bin/luatest -c -v ./test.lua + TEST_DISABLE_INBUILT_CHECKS=true .rocks/bin/luatest -c -v ./test.lua .PHONY: perf perf: - .rocks/bin/luatest -c ./perftest.lua + TEST_DISABLE_INBUILT_CHECKS=true .rocks/bin/luatest -c ./perftest.lua .PHONY: clean clean: diff --git a/perftest.lua b/perftest.lua index 13502e7..cb00229 100755 --- a/perftest.lua +++ b/perftest.lua @@ -1,14 +1,20 @@ #!/usr/bin/env tarantool -local t = require('luatest') - -local checks = require('checks') local json = require('json') local log = require('log') local uuid = require('uuid') +local t = require('luatest') + local g = t.group('checks_performance') +if os.getenv('TEST_DISABLE_INBUILT_CHECKS') then + -- Clean up built-in checks to run tests with repository module. + package.preload['checks'] = nil + package.loaded['checks'] = nil +end +local checks = require('checks') + local args = { ['nil'] = nil, ['string'] = 'str', diff --git a/test.lua b/test.lua index 151278f..709f910 100755 --- a/test.lua +++ b/test.lua @@ -1,12 +1,18 @@ #!/usr/bin/env tarantool -local t = require('luatest') - local json = require('json') -local checks = require('checks') + +local t = require('luatest') local g = t.group('checks') +if os.getenv('TEST_DISABLE_INBUILT_CHECKS') then + -- Clean up built-in checks to run tests with repository module. + package.preload['checks'] = nil + package.loaded['checks'] = nil +end +local checks = require('checks') + ------------------------------------------------------------------------------ local current_file = debug.getinfo(1, 'S').short_src