faster CIs (#13803)

* ttables: smaller table, 5x speedup

* thavlak: less iterations, less loops; 30% speedup

* tasyncclosestall: shorter timeout; 35% speedup

* gcleak4: less iterations, 2x speedup

* ttimes: remove deprecated stuff

* tdangerisrelease: remove cpp backend, 3x speedup

* tfrexp1: smaller range, 2x speedup

* trtree: fix warnings, less iterations, 6x speedup

* tasyncawait_cyclebreaker: smaller swarm size; 2x speedup

* trealloc: smaller number of iterations; 10x speedup

* towned_binary_tree: less iterations, 4x speedup

* tclosure: remove unused code, less iterations; 2x speedup

* twaitany: less durations; 1.4x speedup

* tasync_misc: less iterations, 2x speedup

* t8535: smaller sleep, 1.5x speedup

* tmanyjoin: smaller sleep, 2x speedup

* t12221: shorter sleeps, removed two slower tests; 1.6x speedup

* tfuturestream: smaller sleep; 1.5x speedup

* growobjcrash: less iterations; 2x speedup

* ttryrecv: smaller sleep; 1.5x speedup

* treusetvar: less threads; 2x speedup

* delete tthreadanalysis2, basically a duplicate of tthreadanalysis

* t7758: less iterations, 1.5x speedup

* tasyncawait: smaller swarm, less messages; 1.5x speedup

* tjsandnativeasync: smaller sleep, 1.5x speedup

* tpendingcheck: smaller sleep, 1.5x speedup

* remove rodfiles test category

* move tseq from its own category to 'collections' category

* remove unneeded tests and helpers from 'assert' category

* stdlib: merge tbitops2 into tbitops

* remove 'trepr2' from 'stdlib' cat

* merge 'tstreams' into one file

* remove 'tinefficient_const_table' from 'ccbugs' cat

* merge 'tcollections_to_string' into 'tcollections'

* tblocking_channel: smaller sleep, small speedup

* tconvexhull: less iterartions; 1.2x speedup

* merge 'tdeepcopy2' into 'tdeepcopy'

* merge 'tdisjoint_slice2' into 'tdisjoint_slice1'

* tmissing_deepcopy: smaller sequence

* tsendtwice: smaller arrays; 5x speedup

* remove 'tindexerrorformatbounds'

* disable multimethod tests

* remove 'gc:none' and 'refc' without 'd:useRealtimeGC' from gc tests

* koch.nim: bootstrap just with '-d:release', no need for 'csource'

* add github workflow for documentation

* testament: no need for 8 sub-second decimals
This commit is contained in:
Miran 2020-03-30 13:18:12 +02:00 • committed by GitHub
commit 8088633250
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
72 changed files with 532 additions and 1082 deletions

View file

@ -1,45 +1,30 @@
discard """
output: '''
test1:ok
test2:ok
test3:ok
test4:ok
test5:ok
test6:ok
test7:ok
`false` first assertion from bar
`false` second assertion from bar
-1
tassert2.nim
test8:ok
test9:ok
test10:ok
test11:ok
'''
"""
import testhelper
from strutils import endsWith
type
TLineInfo = tuple[filename: string, line: int, column: int]
TMyError = object of Exception
lineinfo: TLineInfo
EMyError = ref TMyError
echo("")
# NOTE: when entering newlines, adjust `expectedEnd` outputs
try:
doAssert(false, "msg1") # doAssert test
except AssertionError as e:
checkMsg(e.msg, "tassert2.nim(30, 11) `false` msg1", "test1")
try:
assert false, "msg2" # assert test
except AssertionError as e:
checkMsg(e.msg, "tassert2.nim(35, 10) `false` msg2", "test2")
assert e.msg.endsWith "tassert2.nim(20, 11) `false` msg1"
try:
assert false # assert test with no msg
except AssertionError as e:
checkMsg(e.msg, "tassert2.nim(40, 10) `false` ", "test3")
assert e.msg.endsWith "tassert2.nim(25, 10) `false` "
try:
let a = 1
@ -47,13 +32,13 @@ try:
# BUG: const folding would make "1+1==1" appear as `false` in
# assert message
except AssertionError as e:
checkMsg(e.msg, "`a + a == 1` ", "test4")
assert e.msg.endsWith "`a + a == 1` "
try:
let a = 1
doAssert a+a==1 # ditto with `doAssert` and no parens
except AssertionError as e:
checkMsg(e.msg, "`a + a == 1` ", "test5")
assert e.msg.endsWith "`a + a == 1` "
proc fooStatic() =
# protect against https://github.com/nim-lang/Nim/issues/8758
@ -80,12 +65,12 @@ block:
proc bar: int =
# local overrides that are active only in this proc
onFailedAssert(msg):
checkMsg(msg, "tassert2.nim(85, 11) `false` first assertion from bar", "test6")
echo msg[^32..^1]
assert(false, "first assertion from bar")
onFailedAssert(msg):
checkMsg(msg, "tassert2.nim(91, 11) `false` second assertion from bar", "test7")
echo msg[^33..^1]
return -1
assert(false, "second assertion from bar")
@ -97,8 +82,7 @@ block:
foo()
except:
let e = EMyError(getCurrentException())
echo e.lineinfo.filename
checkMsg(e.msg, "tassert2.nim(77, 11) `false` assertion from foo", "test8")
assert e.msg.endsWith "tassert2.nim(62, 11) `false` assertion from foo"
block: ## checks for issue https://github.com/nim-lang/Nim/issues/8518
template fun(a: string): string =
@ -109,14 +93,14 @@ block: ## checks for issue https://github.com/nim-lang/Nim/issues/8518
doAssert fun("foo1") == fun("foo2"), "mymsg"
except AssertionError as e:
# used to expand out the template instantiaiton, sometimes filling hundreds of lines
checkMsg(e.msg, """tassert2.nim(109, 14) `fun("foo1") == fun("foo2")` mymsg""", "test9")
assert e.msg.endsWith ""
block: ## checks for issue https://github.com/nim-lang/Nim/issues/9301
try:
doAssert 1 + 1 == 3
except AssertionError as e:
# used to const fold as false
checkMsg(e.msg, "tassert2.nim(116, 14) `1 + 1 == 3` ", "test10")
assert e.msg.endsWith "tassert2.nim(100, 14) `1 + 1 == 3` "
block: ## checks AST isn't transformed as it used to
let a = 1
@ -124,4 +108,4 @@ block: ## checks AST isn't transformed as it used to
doAssert a > 1
except AssertionError as e:
# used to rewrite as `1 < a`
checkMsg(e.msg, "tassert2.nim(124, 14) `a > 1` ", "test11")
assert e.msg.endsWith "tassert2.nim(108, 14) `a > 1` "

View file

@ -1,20 +0,0 @@
discard """
cmd: "nim $target -d:release $options $file"
output: '''
test1:ok
test2:ok
'''
"""
import testhelper
onFailedAssert(msg):
checkMsg(msg, "tdoassert.nim(15, 9) `a == 2` foo", "test1")
var a = 1
doAssert(a == 2, "foo")
onFailedAssert(msg):
checkMsg(msg, "tdoassert.nim(20, 10) `a == 3` ", "test2")
doAssert a == 3

View file

@ -1,12 +0,0 @@
from strutils import endsWith, split
from os import isAbsolute
proc checkMsg*(msg, expectedEnd, name: string, absolute = true)=
let filePrefix = msg.split(' ', maxSplit = 1)[0]
if absolute and not filePrefix.isAbsolute:
echo name, ":not absolute: `", msg & "`"
elif not msg.endsWith expectedEnd:
echo name, ":expected suffix:\n`" & expectedEnd & "`\ngot:\n`" & msg & "`"
else:
echo name, ":ok"

View file

@ -1,11 +0,0 @@
discard """
cmd: "nim $target $options --excessiveStackTrace:off $file"
output: '''
test:ok
'''
"""
import testhelper
try:
doAssert(false, "msg")
except AssertionError as e:
checkMsg(e.msg, "trelativeassert.nim(9, 11) `false` msg", "test", false)