put std/threads under the umbrella of nimPreviewSlimSystem (#20711)

* put `std/threads` under the umbrella of `nimPreviewSlimSystem`

* add changelog

* fixes tests

* fixes tests again

* fixes tests
This commit is contained in:
ringabout
2022-10-31 13:36:50 +08:00
committed by GitHub
parent fb2ec8d192
commit e1ddd2d524
13 changed files with 33 additions and 19 deletions

View File

@@ -7,7 +7,10 @@ discard """
import std/envvars
from std/sequtils import toSeq
import stdtest/testutils
import std/assertions
import std/[assertions]
when not defined(js):
import std/threads
# "LATIN CAPITAL LETTER AE" in UTF-8 (0xc386)
const unicodeUtf8 = "\xc3\x86"

View File

@@ -5,7 +5,7 @@ discard """
"""
import os, net, nativesockets, asyncdispatch
import std/[assertions]
import std/[assertions, threads]
## Test for net.dial

View File

@@ -7,7 +7,9 @@ discard """
import std/os
from std/sequtils import toSeq
import stdtest/testutils
import std/assertions
when defined(nimPreviewSlimSystem):
import std/[assertions]
# "LATIN CAPITAL LETTER AE" in UTF-8 (0xc386)
const unicodeUtf8 = "\xc3\x86"
@@ -55,6 +57,8 @@ when defined(windows):
proc c_getenv(env: cstring): cstring {.importc: "getenv", header: "<stdlib.h>".}
when not defined(js) and not defined(nimscript):
when defined(nimPreviewSlimSystem):
import std/threads
block: # bug #18533
var thr: Thread[void]
proc threadFunc {.thread.} = putEnv("foo", "fooVal2")

View File

@@ -4,7 +4,7 @@ discard """
disabled: "openbsd"
"""
# disabled: pending bug #15713
import std/[net, nativesockets, assertions]
import std/[net, nativesockets, assertions, threads]
when defined(posix): import os, posix
else: