Commit Graph

4588 Commits

Author SHA1 Message Date
n5m
436e1fa5b1 fix #15631 (#15632)
* trigger valgrind failure on memory leak

* remove non-malloc tests

* remove ORC test

is redundant because we already have an ARC test

* only run valgrind tests on 64-bit Linux

* disable freebsd and openbsd

* Remove tleak_refc

As to not test implementation details (or bug)

* Fix test failures by removing redundant test

Since this tests/shoulfail/tvalgrind.nim was specified here to fail this test
itself fails since it will be skipped on non-linux CI

* Remove test, reason detailed in the previous commit

* Remove redundant disables

* Revert removing disables

* Add and use valgrind: leaks

* Fix

Co-authored-by: Clyybber <darkmine956@gmail.com>
Co-authored-by: n5m
2020-10-19 22:25:43 +02:00
Danil Yarantsev
d22ab0fb96 Add tests to #15363 (#15633) 2020-10-19 13:16:56 +02:00
n5m
78cbb52fa0 add tests for #15584 (#15619)
* add test for #15584

* Rename userlocks.nim to trlocks.nim

* add bug comment

* improve cmd

* reference bugfix, not bug

* add test that runs rlocks

* disallow joining

joining with other test cases (e.g., a test case that invokes `RLock.initRLock()`) may cause this test to compile, when the goal is to test if these lines can be compiled in isolation
2020-10-18 12:57:13 -04:00
Clyybber
66cd9c2e57 Fix #15599 (#15601)
* Fix #15599

* Add test
2020-10-16 18:03:01 +02:00
Andreas Rumpf
da4aa2e1fb renamed '=' to '=copy' [backport:1.2] (#15585)
* Assign hook name changed to `=copy`
* Adapt destructors.rst
* [nobackport] Duplicate tests for =copy hook
* Fix tests
* added a changelog entry

Co-authored-by: Clyybber <darkmine956@gmail.com>
2020-10-15 12:52:30 +02:00
Andreas Rumpf
1bbc20010e harden the ORC asyncleak3 test case (#15580)
* harden the ORC asyncleak3 test case

* add another ORC stress test
2020-10-15 09:42:43 +02:00
Andreas Rumpf
8978112457 fixes a C code generator regression, no need to backport, only the 1.4 line is affected (#15569) 2020-10-14 13:58:36 +02:00
alaviss
d1af9587b8 terminal: fix fgColor/bgColor commands [backport] (#15554)
Since #8296, fgSetColor is no longer a global. These commands were
probably left out from the change as an oversight, so some tests have
been added to make sure this won't happen again.
2020-10-13 17:39:32 +01:00
cooldome
9668a1106d Fix 15543 (#15544)
* fix #15543

* fix spacing

* fix test

* simplify test for freebsd platform
2020-10-12 10:12:32 +01:00
Timothee Cour
3eac9b2344 os: add overload copyFile*(source, dest: string, isDir = false) (#15537)
* os: add overload copyFile*(source, dest: string, isDir = false)
* renamed to copyFileToDir
2020-10-11 20:43:01 +02:00
Timothee Cour
8a5f550491 followup after #15529 and #15534 (#15536) 2020-10-10 07:05:27 +02:00
Andreas Rumpf
d430216288 fixes #15532 (#15534) 2020-10-09 16:18:36 +02:00
Timothee Cour
8fb57d7451 close #13081 (#15529)
* close #13081

* fixup
2020-10-09 08:56:09 +02:00
cooldome
fe187719ab fix #15516 (#15518) 2020-10-08 09:12:03 +02:00
Andreas Rumpf
3b901d1e36 docgen: improve alignment of comments (still not perfect) (#15506)
* docgen: improve alignment of comments (still not perfect)

* fix error message text in `tunknown_named_parameter`

Co-authored-by: narimiran <narimiran@disroot.org>
2020-10-07 14:39:13 +02:00
Andreas Rumpf
0426a4d85a fixes #15508 (#15509) 2020-10-07 14:38:25 +02:00
Andreas Rumpf
51e3e0c7c4 implements https://github.com/nim-lang/RFCs/issues/260 (#15505)
* implements https://github.com/nim-lang/RFCs/issues/260

* added a test case
2020-10-07 00:09:28 +02:00
Paul Tan
fa84121421 effects: exclude swap() from "indirect calls" assumption (#15504)
swap() will never call any procs passed to it, and so it can be safely
excluded from the "assume indirect calls are taken" effects tracking
rule.
2020-10-06 18:05:31 +02:00
IDF
9560e49e8f New hint for unused exceptions in .raises (#15492)
* New hint for unused exceptions in .raises

* Fix effects test

* Further adapt teffects1.nim
2020-10-06 16:49:30 +02:00
Andreas Rumpf
92163fa330 implements https://github.com/nim-lang/RFCs/issues/258 (#15503)
* implements https://github.com/nim-lang/RFCs/issues/258

* don't be too strict with custom pragma blocks

* cast pragmas: documentation

* added most missing inference query procs to effecttraits.nim
2020-10-06 16:47:15 +02:00
Andreas Rumpf
4e438f9096 const view types; fixes some cases from https://github.com/nim-lang/Nim/issues/15428 (#15488) 2020-10-05 18:31:46 +02:00
flywind
af9cc2882f use func in uri module (#15486) 2020-10-05 17:04:08 +02:00
Euan
cc4c546f8f Fix #15493 - disable TLS emulation for NetBSD (#15494)
TLS emulation was already disabled for FreeBSD due to the same issue.
2020-10-05 12:00:06 +02:00
alaviss
fc973b2c0c renderer: use the biggest integer type for masking literals (#15482)
On 32-bit system the mask would have a size of 32-bit, which is smaller
than the BiggestInt (usually 64-bit) it was masked against.

For some reason this only affect 32-bit Windows but not 32-bit Linux.
Might just be a difference in how gcc handle out of bound shifts for
Windows and Linux.
2020-10-04 00:39:56 +02:00
Andreas Rumpf
1f4b9cebd4 Added std/effecttraits.nim (#15462) 2020-10-02 17:22:31 +02:00
Andreas Rumpf
aa1d7fe1e9 closureiters: fixes #15243 (#15454) [backport:1.2]
* fixes #15243 [backport:1.2]
2020-10-02 12:38:16 +02:00
Euan
f785174c60 Ref #14094 - disable hot code reloading tests on NetBSD (#15458) 2020-10-02 11:17:31 +02:00
Euan
b4fe0c8862 Fix #15452 - ip protocol not defined on NetBSD (#15453) 2020-10-01 22:15:34 +02:00
c-blake
26d656e73e Add first draft of new osproc.readLines (#15429)
* Add first draft of new osproc.readLines

* Add test for new osproc.readLines

* Rename test to start w/t to run; Also add newline to output

* Suppress hint messages.

* Output should match this time.

* Shoulda picked a program with simpler syntax than ..lol

* Address https://github.com/nim-lang/Nim/pull/15429#issuecomment-701890898
and https://github.com/nim-lang/Nim/pull/15429#issuecomment-701985976 by
factoring `readLines` into `iterator lines` and a wrapper `proc`.

* Address https://github.com/nim-lang/Nim/pull/15429#issuecomment-702127289
and also add a `ReadIOEffect` tag to the iterator (called by the wrapper..
so it should need no separate tag, if I understand correctly).
2020-10-01 18:06:38 +02:00
cooldome
531ed2dc36 fix #15405. deepcopy arc (#15410)
* fix #15405
* fix tests
* deepcopy for ARC has to be enabled via --deepcopy:on

Co-authored-by: Araq <rumpf_a@web.de>
2020-10-01 17:39:48 +02:00
Andreas Rumpf
ab405c936e views: yet another bugfix (#15447)
* views: yet another bugfix

* views: extended the spec

* views: take into account potential hidden mutations via proc calls
2020-10-01 15:04:36 +02:00
Andreas Rumpf
2b91845f1d refactoring, fixes yet another strictFuncs regression (#15446) 2020-10-01 11:16:04 +02:00
Andreas Rumpf
b703f02ad2 added missing .noalias support for object fields (#15445) 2020-10-01 09:46:50 +02:00
Andreas Rumpf
86d7b63e2a better support for view types (#15436)
* you can put borrows into tables

* enforces mutating views only mutate mutable data
2020-09-30 20:44:18 +02:00
Andreas Rumpf
4058801607 spec for view types (#15424)
* spec for view types
* spec additions
* refactoring; there are two different kinds of views
* refactorings and spec additions
* enforce that view types are initialized
* enforce borrowing from the first formal parameter
* enforce lifetimes for borrowing of locals
* typo in the manual
* clarify in the implementation what a borrow operation really is
2020-09-29 23:42:38 +02:00
Andreas Rumpf
50b6f6996a .noalias annotation; frontend support (#15419)
* .noalias annotation; frontend support

* added .noalias support to Nim; implements https://github.com/nim-lang/RFCs/issues/204
2020-09-28 13:51:39 +02:00
Andreas Rumpf
f1ac01459c produce runtime type information for reified openArrays (#15415)
* produce runtime type information for reified openArrays

* added a test case
2020-09-27 20:44:22 +02:00
Andreas Rumpf
57b7841c18 better support for slices as views (#15414)
* moved view tests to tests/views
* refactoring
* more refactorings
* better support for system.toOpenArray for first class view types
2020-09-27 09:20:10 +02:00
Andreas Rumpf
e6616115e6 cursor inference: makes combparser work; refactorings (#15411)
* cursor inference: makes combparser work; refactorings
2020-09-26 13:11:35 +02:00
Andreas Rumpf
e9fa486493 fixes #14983 (#15320)
* fixes #14983

* allow bootstrapping with 0.20

* added a test case for the new system.add with a sink parameter

* make npeg green again
2020-09-25 08:49:21 +02:00
cooldome
68ec7a018b Revert "fix #15035 (#15236)" (#15408)
This reverts commit f8c48fc186.
2020-09-24 22:21:14 +02:00
Andreas Rumpf
4ec5cbac0d fixes #15361 (#15401)
* fixes #15361; better cursor inference
2020-09-24 15:41:45 +02:00
flywind
e85c5ad379 fix #15333 (#15336) 2020-09-24 08:54:13 +02:00
cooldome
f21a49b2c4 Fix #15389 (#15390)
* allow result symbol reuse

* try different approach

* Revert "try different approach"

This reverts commit abcfb6b759.
2020-09-24 00:07:30 +01:00
Clyybber
4b9eea2fcc Fix forward declarations in shadow scope contexts (#15386)
* Fix forward declarations in shadow scope contexts

* Add testcase for #15385

* Less empty lines

* Fix tests

* Inline isShadowScope

* Add original testcase (with reduced amount of iterations)

* Add testcase without forward decl
2020-09-22 18:24:13 +02:00
Andreas Rumpf
1fae66e4df better nativestacktrace support; refs #15284; backport [1.2] (#15384)
* nimStackTraceOverride: enable stack traces in exceptions

This is a two-step stack trace collection scheme, because re-raised
exceptions will collect multiple stack traces but use them rarely, when
printing info about an uncaught exception, so it makes sense to only do
the cheap stack unwinding all the time and the relatively expensive
debugging information collection on-demand.

`asyncfutures` implements its own `$` proc for printing
`seq[StackTraceEntry]`, so we have to add the debugging info there, just
like we do for the private `$` proc in `system/excpt`.

* cleaned up PR #15284

Co-authored-by: Ștefan Talpalaru <stefantalpalaru@yahoo.com>
2020-09-22 13:03:24 +02:00
Clyybber
d67c5cb751 Add strutils.indentation and make unindent use it (#15264)
* Add strutils.indentation and make unindent use it

* Code style

* Fix bootstrapping

* Improve wording

* Fix test

* Introduce without breaking change

* Fix

* Reduce diff

* Fix docs link

* Add since annotation

* Update changelog
2020-09-22 10:43:12 +02:00
flywind
40a868bccc add testcase for #6060 (#15366)
* add testcase for #6060

* Remove overspecific testament spec

Co-authored-by: Clyybber <darkmine956@gmail.com>
2020-09-21 13:37:14 +02:00
flywind
6c83eb48c2 add testcase for #7165 (#15368)
* add testcase for #7165

* Remove overspecific testament spec

Co-authored-by: Clyybber <darkmine956@gmail.com>
2020-09-21 13:32:05 +02:00
Andreas Rumpf
c2434d939e fixes #15360 [backport:1.2] (#15378) 2020-09-21 12:35:23 +02:00