From 12b062b2c862fd436cff0df4ebb2e5ca22e75e19 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 5 Mar 2017 04:02:45 +0300 Subject: unittests: Run all unit tests in their own processes Used sed -r -i -e '/ helpers =/ s/$/\nlocal itp = helpers.gen_itp(it)/; s/^(\s*)it\(/\1itp(/' test/unit/**/*_spec.lua to alter all tests. Locally they all run fine now. Reasoning: 1. General: state from one test should not affect other tests. 2. Local: travis build is failing with something which may be an output of garbage collector. This should prevent state of the garbage collector from interferring as well. --- test/unit/memory_spec.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'test/unit/memory_spec.lua') diff --git a/test/unit/memory_spec.lua b/test/unit/memory_spec.lua index 73a32724ef..744ff3cf19 100644 --- a/test/unit/memory_spec.lua +++ b/test/unit/memory_spec.lua @@ -1,4 +1,5 @@ local helpers = require("test.unit.helpers") +local itp = helpers.gen_itp(it) local cimport = helpers.cimport local cstr = helpers.cstr @@ -26,7 +27,7 @@ describe('xstrlcat()', function() return ffi.string(dst_cstr) end - it('concatenates strings', function() + itp('concatenates strings', function() eq('ab', test_xstrlcat('a', 'b', 3)) eq('ab', test_xstrlcat('a', 'b', 4096)) eq('ABCיהZdefgiיהZ', test_xstrlcat('ABCיהZ', 'defgiיהZ', 4096)) @@ -34,7 +35,7 @@ describe('xstrlcat()', function() eq('a', test_xstrlcat('a', '', 4096)) end) - it('concatenates overlapping strings', function() + itp('concatenates overlapping strings', function() eq('abcabc', test_xstrlcat_overlap('abc', 0, 7)) eq('abca', test_xstrlcat_overlap('abc', 0, 5)) eq('abcb', test_xstrlcat_overlap('abc', 1, 5)) @@ -42,7 +43,7 @@ describe('xstrlcat()', function() eq('abcabc', test_xstrlcat_overlap('abc', 0, 2343)) end) - it('truncates if `dsize` is too small', function() + itp('truncates if `dsize` is too small', function() eq('a', test_xstrlcat('a', 'b', 2)) eq('', test_xstrlcat('', 'b', 1)) eq('ABCיהZd', test_xstrlcat('ABCיהZ', 'defgiיהZ', 10)) -- cgit