summary refs log tree commit diff stats
path: root/tests/destructor
Commit message (Collapse)AuthorAgeFilesLines
* remove {.this.} pragma, deprecated since 0.19 (#20201)metagn2022-08-231-11/+9
| | | Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Add use of Windows Wide CRT API for env. vars (#20084)havardjohn2022-08-201-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add use of Windows Wide CRT API for env. vars Replaces use of CRT API `getenv` and `putenv` with respectively `_wgetenv` and `_wputenv`. Motivation is to reliably convert environment variables to UTF-8, and the wide API is best there, because it's reliably UTF-16. Changed the hack in `lib/std/private/win_setenv.nim` by switching the order of the Unicode and MBCS environment update; Unicode first, MBCS second. Because `_wgetenv`/`_wputenv` is now used, the Unicode environment will be initialized, so it should always be updated. Stop updating MBCS environment with the name of `getEnv`. It's not necessarily true that MBCS encoding and the `string` encoding is the same. Instead convert UTF-16 to current Windows code page with `wcstombs`, and use that string to update MBCS. Fixes regression in `6b3c77e` that caused `std/envvars.getEnv` or `std/os.getEnv` on Windows to return non-UTF-8 encoded strings. Add tests that test environment variables with Unicode characters in their name or value. * Fix test issues Fixes * `nim cpp` didn't compile the tests * Nimscript import of `tosenv.nim` from `test_nimscript.nims` failed with "cannot importc" * Fix missing error check on `wcstombs` * Fix ANSI testing errors * Separate ANSI-related testing to their own tests, and only executing them if running process has a specific code page * Setting locale with `setlocale` was not reliable and didn't work on certain machines * Add handling of a "no character representation" error in second `wcstombs` call * tests/newruntime_misc: Increment allocCount Increments overall allocations in `tnewruntime_misc` test. This is because `getEnv` now does an additional allocation: allocation of the UTF-16 string used as parameter to `c_wgetenv`. * Revert "tests/newruntime_misc: Increment allocCount" This reverts commit 4d4fe8bd3edb1bfc6d600f247af797c7552f5477. * tests/newruntime_misc: Increment allocCount on Windows Increments overall allocations in `tnewruntime_misc` test for Windows. This is because `getEnv` on Windows now does an additional allocation: allocation of the UTF-16 string used as parameter to `c_wgetenv`. * Refactor, adding suggestions from code review Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com> * Document, adding suggestions Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com> Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com> Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
* default threads on (#19368)flywind2022-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * default threads on * make rst gcsafe * ignore threads option for nimscript * threads off * use createShared for threads * test without threads * avr threds off * avr threads off * async threads off * threads off * fix ci * restore option * make CI pleased * fix ic tests * Update config.nims * add changelog * Update changelog.md Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* Fix global destructor injection for JS backend (#19797)quantimnot2022-05-231-1/+2
| | | | | | | | | | | | | | * Fix global destructor injection for JS backend * Moved global destructors injection before the final call to transform and generate JS code. It had previously been after and thus not no JS was generated for them. * Added some internal documentation of `jsgen`. * Enable a current destructor test to cover the JS backend as well. * Fixes the JS aspect of #17237. * Fixed global destructor injection order for JS backend Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
* deprecate unsafeAddr; extend addr (#19373)flywind2022-01-165-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | * deprecate unsafeAddr; extend addr addr is now available for all addressable locations, unsafeAddr is deprecated and become an alias for addr * follow @Vindaar's advice * change the signature of addr * unsafeAddr => addr (stdlib) * Update changelog.md * unsafeAddr => addr (tests) * Revert "unsafeAddr => addr (stdlib)" This reverts commit ab83c99c507048a8396e636bf22d55fdd84d7d1c. * doc changes; thanks to @konsumlamm Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* style usages part one (openarray => openArray) (#19321)flywind2022-01-041-1/+1
| | | | | * style usages (openArray) * revert doc changes
* Remove tracking of environment from osenv.nim v2 (#18575)Timothee Cour2021-07-291-1/+1
| | | | | | | | | | | | | * Remove unnecessary environment tracking * try to fix windows * fix delEnv * make putEnv work on windows even with empty values; improve tests: add tests, add js, vm testing * [skip ci] fix changelog Co-authored-by: Caden Haustein <code@brightlysalty.33mail.com>
* fixes #18130 (#18407)Andreas Rumpf2021-07-011-16/+71
|
* Add some tests (#18333)Antonis Geralis2021-06-231-2/+70
|
* document macros.unpackVarargs (#18106)Timothee Cour2021-05-311-0/+1
| | | | | | | * deprecate macros.unpackVarargs * un-deprecate unpackVarargs and add docs+runnableExamples * update examples + tests with varargs[typed]
* Remove confusing <//> (#17830)flywind2021-04-261-1/+6
|
* close #17636 (#17643)flywind2021-04-061-2/+2
|
* Fixes #17450 (#17477)Clyybber2021-03-231-1/+12
| | | | | * Fixes #17450 * Add missing test output
* Revert "Fixes #17450 (#17474)" (#17476)Clyybber2021-03-231-12/+1
| | | This reverts commit 5f0c52048970cb7449937bd19191638c9e9f0c8f.
* Fixes #17450 (#17474)Clyybber2021-03-231-1/+12
| | | | | * Fixes #17450 * Add missing test output
* Revert "Revert "close #16607 add testcase (#17317)" (#17336)" (#17347)Clyybber2021-03-121-0/+24
| | | This reverts commit 3ce27511adac12785b51ecc33dc9d2a2fcd2f0b8.
* Revert "close #16607 add testcase (#17317)" (#17336)Clyybber2021-03-111-24/+0
| | | This reverts commit 1655103d83433aa3d4c607c7477281d137d7c794.
* close #9440 add testcase (#17316)flywind2021-03-091-0/+52
|
* close #16607 add testcase (#17317)flywind2021-03-091-0/+24
|
* deprecate newruntime (#17245)flywind2021-03-049-9/+9
| | | | | | * deprecate newruntime * tests * Update compiler/commands.nim
* fixes #17198, DFA failure on large case stmts (#17210)Saem Ghani2021-03-021-0/+32
| | | | | | This alters the DFA control flow graph generation for case statments. Gotos are now generated as a chained link, this ensures that evaluation of variant branches collapses as early as possible, without hitting the 2k call limit.
* close #5342 add testcase (#17230)flywind2021-03-021-0/+23
| | | | | | | | | * remove unnecessary when statement * remove outdated codes * close #5342 add testcase * update the example
* remove all uses of condsyms symbols defined prior to bootstrap nim 0.20.0 ↵Timothee Cour2021-02-171-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#16918) * nimNoArrayToCstringConversion deadcode * nimbabel deadcode * nimHasalignOf deadcode * nimvarargstyped deadcode * nimhygiene deadcode * nimNewTypedesc deadcode * nimlocks deadcode * nimHasCppDefine deadcode * nimHasRunnableExamples deadcode * nimHasNilChecks deadcode * nimSymKind deadcode * minor macros refactoring * nimVmEqIdent deadcode * nimNoNil deadcode * nimNoZeroTerminator deadcode * nimHasSymOwnerInMacro deadcode * nimVmExportFixed deadcode * nimNewRuntime deadcode * nimAshr deadcode * nimUncheckedArrayTyp deadcode * nimHasTypeof deadcode * nimErrorProcCanHaveBody deadcode * nimHasHotCodeReloading deadcode * nimHasSignatureHashInMacro deadcode * nimHasDefault deadcode * nimMacrosSizealignof deadcode
* don't introduce 'dispose', use '=dispose', fixes #17003 [backport:1.4] (#17062)Andreas Rumpf2021-02-171-1/+1
|
* use doAssert in tests (#16486)flywind2020-12-281-8/+8
|
* fixes #16365 [backport] (#16381)Andreas Rumpf2020-12-171-1/+31
|
* testament: error instead of silently ignore invalid targets; remove ↵Timothee Cour2020-12-142-2/+2
| | | | | | | | | | | pointless alias target vs targets; document matrix; DRY (#16343) * testament: error instead of silently ignore invalid targets * s/target/targets/ * fix test; refs #16344 * address comments * Update testament/specs.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* testament spec: remove errmsg alias of errormsg (#16188)Timothee Cour2020-11-291-1/+1
|
* make megatest consistent with unjoined tests wrt newlines, honor newlines in ↵Timothee Cour2020-11-281-1/+1
| | | | | | | output spec (#16151) * fix megatest newlines * still allow missing trailing newline for now but in a more strict way than before
* fix #15825 (#15894)cooldome2020-11-091-0/+11
| | | | | * fix #15825 * better fix
* Add testcase for #14601 (#15677)Clyybber2020-10-221-1/+45
|
* renamed '=' to '=copy' [backport:1.2] (#15585)Andreas Rumpf2020-10-155-5/+5
| | | | | | | | | * 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>
* fixes #14983 (#15320)Andreas Rumpf2020-09-251-1/+14
| | | | | | | | | * fixes #14983 * allow bootstrapping with 0.20 * added a test case for the new system.add with a sink parameter * make npeg green again
* fixes #15361 (#15401)Andreas Rumpf2020-09-242-7/+10
| | | * fixes #15361; better cursor inference
* disable sink inference, only enable it for the stdlib. Reason: better source ↵Andreas Rumpf2020-07-281-0/+1
| | | | code compatibility (#15105)
* An optimizer for ARC (#14962)Andreas Rumpf2020-07-153-7/+15
| | | | | | | | | | | | | | | | | | | | * WIP: an optimizer for ARC * do not optimize away destructors in 'finally' if unstructured control flow is involved * optimized the optimizer * minor code cleanup * first steps to .cursor inference * cursor inference: big steps to a working solution * baby steps * better .cursor inference * new feature: expandArc for easy inspection of the AST after ARC transformations * added topt_cursor test * adapt tests * cleanups, make tests green * optimize common traversal patterns * moved test case * fixes .cursor inference so that npeg compiles once again * cursor inference: more bugfixes Co-authored-by: Clyybber <darkmine956@gmail.com>
* injectdestructors fixes and refactor (#14964)Clyybber2020-07-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | * injectdestructors fixes and refactor * Tiny cleanup * Refactor and expand testcase * Closes #14902 by adding testcase * Better naming * Fix test failures * Misc cleanup * Add testcase for #14968 * Better approach; expand testcases * Optimizations and fixes * Add testcase * typo * Tiny cleanup
* fixes #14925 (#14947)Andreas Rumpf2020-07-091-1/+8
|
* progressAraq2020-07-081-1/+1
|
* scoped memory management (#14790)Andreas Rumpf2020-07-041-19/+19
| | | | | | | * fixes the regressions * closes #13936 * scope based memory management implemented * enabled tcontrolflow.nim test case * final cleanups
* Fix #14647 (#14776)Clyybber2020-06-281-1/+7
| | | | | | | | | * Fix #14647 * Correct fix * Typo and add test * For real now :p
* Add testcases for #11811 and #14315 (#14726)Clyybber2020-06-191-1/+11
| | | | | * Add testcase for #11811 * Add testcase for #14315
* Fix #14568 (#14583)Clyybber2020-06-071-0/+1
| | | | | | | * Fix #14568 * Add testcase * Fix bogus test * Adapt other failing tests * Declarations are always first writes
* fix #14421 items uses lent T (#14447)Timothee Cour2020-05-297-7/+7
| | | | | * fix #14421 items uses lent T for seq + openArray * add -d:nimWorkaround14447 * fix test
* ARC/ORC: optimize s.setLen(0) to match the old runtime's behaviour (#14423)Andreas Rumpf2020-05-211-1/+1
|
* Small improvements for string and char repr with gc:arc (#14400)Clyybber2020-05-201-1/+1
| | | | | * Small improvements for string and char repr with gc:arc * Fix test
* fix #14294 (#14301)cooldome2020-05-111-1/+25
| | | | | | | * fix #14294 * fix orc as well Co-authored-by: cooldome <ariabushenko@bk.ru>
* fix #14217 (#14218)cooldome2020-05-051-0/+26
| | | | | * fix #14217 Co-authored-by: cooldome <ariabushenko@bk.ru>
* fixes #14159 [backport:1.2]Araq2020-05-021-0/+33
|
* fixes #14054 [backport:1.2] (#14061)Andreas Rumpf2020-04-301-1/+1
| | | | | | | | | * fixes #14054 * make tests green again * more tests are green * maybe now