parent
66c16920a6
commit
aba51f1d29
|
@ -43,7 +43,7 @@ jobs:
|
|||
|
||||
name: '${{ matrix.target.os }}-${{ matrix.target.cpu }} (Nim ${{ matrix.branch }})'
|
||||
runs-on: ${{ matrix.builder }}
|
||||
continue-on-error: ${{ matrix.branch == 'version-1-6' || matrix.branch == 'devel' }}
|
||||
continue-on-error: ${{ matrix.branch == 'devel' }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
nimcache
|
||||
nimcache/
|
||||
*.exe
|
||||
nimble.develop
|
||||
nimble.paths
|
||||
/build/
|
||||
|
|
13
stew.nimble
13
stew.nimble
|
@ -4,7 +4,7 @@ packageName = "stew"
|
|||
version = "0.1.0"
|
||||
author = "Status Research & Development GmbH"
|
||||
description = "Backports, standard library candidates and small utilities that don't yet deserve their own repository"
|
||||
license = "Apache License 2.0"
|
||||
license = "MIT or Apache License 2.0"
|
||||
skipDirs = @["tests"]
|
||||
|
||||
requires "nim >= 1.2.0",
|
||||
|
@ -19,7 +19,7 @@ let styleCheckStyle = if (NimMajor, NimMinor) < (1, 6): "hint" else: "error"
|
|||
let cfg =
|
||||
" --styleCheck:usages --styleCheck:" & styleCheckStyle &
|
||||
(if verbose: "" else: " --verbosity:0 --hints:off") &
|
||||
" --skipParentCfg --skipUserCfg"
|
||||
" --skipParentCfg --skipUserCfg --outdir:build --nimcache:build/nimcache -f"
|
||||
|
||||
proc build(args, path: string) =
|
||||
exec nimc & " " & lang & " " & cfg & " " & flags & " " & args & " " & path
|
||||
|
@ -29,7 +29,8 @@ proc run(args, path: string) =
|
|||
|
||||
task test, "Run all tests":
|
||||
build "", "tests/test_helper"
|
||||
run "--threads:off", "tests/all_tests"
|
||||
run "--threads:on -d:nimTypeNames", "tests/all_tests"
|
||||
run "--threads:on -d:noIntrinsicsBitOpts -d:noIntrinsicsEndians",
|
||||
"tests/all_tests"
|
||||
for args in [
|
||||
"--threads:off",
|
||||
"--threads:on -d:nimTypeNames",
|
||||
"--threads:on -d:noIntrinsicsBitOpts -d:noIntrinsicsEndians"
|
||||
]: run args, "tests/all_tests"
|
||||
|
|
|
@ -10,6 +10,8 @@ import unittest2
|
|||
import std/[osproc, strutils]
|
||||
import ../stew/io2
|
||||
|
||||
from os import getAppDir
|
||||
|
||||
when defined(posix):
|
||||
from std/posix import EAGAIN
|
||||
|
||||
|
@ -540,31 +542,27 @@ suite "OS Input/Output procedures test suite":
|
|||
|
||||
proc lockTest(path: string, flags: set[OpenFlags],
|
||||
lockType: LockType): IoResult[array[3, TestResult]] =
|
||||
const HelperPath =
|
||||
when defined(windows):
|
||||
"test_helper "
|
||||
else:
|
||||
"tests/test_helper "
|
||||
let helperPath = getAppDir() & "/test_helper "
|
||||
let
|
||||
handle = ? openFile(path, flags)
|
||||
lock = ? lockFile(handle, lockType)
|
||||
let res1 =
|
||||
try:
|
||||
execCmdEx(HelperPath & path)
|
||||
execCmdEx(helperPath & path)
|
||||
except CatchableError as exc:
|
||||
echo "Exception happens [", $exc.name, "]: ", $exc.msg
|
||||
("", -1)
|
||||
? unlockFile(lock)
|
||||
let res2 =
|
||||
try:
|
||||
execCmdEx(HelperPath & path)
|
||||
execCmdEx(helperPath & path)
|
||||
except CatchableError as exc:
|
||||
echo "Exception happens [", $exc.name, "]: ", $exc.msg
|
||||
("", -1)
|
||||
? closeFile(handle)
|
||||
let res3 =
|
||||
try:
|
||||
execCmdEx(HelperPath & path)
|
||||
execCmdEx(helperPath & path)
|
||||
except CatchableError as exc:
|
||||
echo "Exception happens [", $exc.name, "]: ", $exc.msg
|
||||
("", -1)
|
||||
|
|
Loading…
Reference in New Issue