diff options
| author | Ganesh Viswanathan <dev@genotrance.com> | 2020-04-29 00:07:15 -0500 |
|---|---|---|
| committer | Ganesh Viswanathan <dev@genotrance.com> | 2020-04-29 00:07:15 -0500 |
| commit | 9a93417ae21ddd11037505f58ad793aebea8644a (patch) | |
| tree | 653272315531526f92d30e64cca4321db3e474ca /tests | |
| parent | 492eba8f22c6fb0070274590490f2977e357de2a (diff) | |
| download | nimterop-9a93417ae21ddd11037505f58ad793aebea8644a.tar.gz nimterop-9a93417ae21ddd11037505f58ad793aebea8644a.zip | |
Fix timeit for legacy, reduce Windows test matrix
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/getheader.nims | 10 | ||||
| -rw-r--r-- | tests/timeit.nim | 13 | ||||
| -rw-r--r-- | tests/tmath.nim | 2 | ||||
| -rw-r--r-- | tests/tnimterop_c.nim | 2 | ||||
| -rw-r--r-- | tests/tpcre.nim | 2 | ||||
| -rw-r--r-- | tests/zlib.nim | 2 |
6 files changed, 19 insertions, 12 deletions
diff --git a/tests/getheader.nims b/tests/getheader.nims index 72407f9..2e6530f 100644 --- a/tests/getheader.nims +++ b/tests/getheader.nims @@ -35,6 +35,11 @@ when defined(posix): testCall(cmd & " -d:lzmaGit -d:lzmaSetVer=v5.2.0" & lrcmd, lexp & "5.2.0", 0) testCall(cmd & " -d:lzmaGit -d:lzmaStatic -d:lzmaSetVer=v5.2.0" & lrcmd, lexp & "5.2.0", 0, delete = false) + # dl - remove from Windows to save some time + testCall(cmd & " -d:lzmaDL" & lrcmd, "Need version", 1) + testCall(cmd & " -d:lzmaDL -d:lzmaSetVer=5.2.4" & lrcmd, lexp & "5.2.4", 0) + testCall(cmd & " -d:lzmaDL -d:lzmaStatic -d:lzmaSetVer=5.2.4" & lrcmd, lexp & "5.2.4", 0, delete = false) + # git testCall(cmd & " -d:envTest" & zrcmd, zexp, 0) testCall(cmd & " -d:envTestStatic" & zrcmd, zexp, 0, delete = false) @@ -44,10 +49,5 @@ testCall(cmd & " -d:zlibGit -d:zlibSetVer=v1.2.10" & zrcmd, zexp & "1.2.10", 0) testCall(cmd & " -d:zlibGit -d:zlibStatic -d:zlibSetVer=v1.2.10" & zrcmd, zexp & "1.2.10", 0, delete = false) # dl -testCall(cmd & " -d:lzmaDL" & lrcmd, "Need version", 1) -testCall(cmd & " -d:lzmaDL -d:lzmaSetVer=5.2.4" & lrcmd, lexp & "5.2.4", 0) -testCall(cmd & " -d:lzmaDL -d:lzmaStatic -d:lzmaSetVer=5.2.4" & lrcmd, lexp & "5.2.4", 0, delete = false) - -# dl testCall(cmd & " -d:zlibDL -d:zlibSetVer=1.2.11" & zrcmd, zexp & "1.2.11", 0) testCall(cmd & " -d:zlibDL -d:zlibStatic -d:zlibSetVer=1.2.11" & zrcmd, zexp & "1.2.11", 0, delete = false) diff --git a/tests/timeit.nim b/tests/timeit.nim index b52eae5..b448191 100644 --- a/tests/timeit.nim +++ b/tests/timeit.nim @@ -1,4 +1,11 @@ -import std/monotimes, os, osproc, sequtils, strformat, strutils, times +import os, osproc, sequtils, strformat, strutils, times + +when (NimMajor, NimMinor) >= (1, 0): + import std/monotimes + + template getTime(): MonoTime = getMonoTime() +else: + template getTime(): float = epochTime() when isMainModule: var params = commandLineParams() @@ -9,9 +16,9 @@ when isMainModule: let - start = getMonoTime() + start = getTime() ret = execCmd(cmd) - endt = getMonoTime() + endt = getTime() outf = getAppDir() / "timeit.txt" outd = if fileExists(outf): readFile(outf) else: "" diff --git a/tests/tmath.nim b/tests/tmath.nim index b8477c1..6c7999a 100644 --- a/tests/tmath.nim +++ b/tests/tmath.nim @@ -7,7 +7,7 @@ cOverride: mingw_ldbl_type_t = object mingw_dbl_type_t = object -when defined(windows): +when defined(Windows): cOverride: type complex = object diff --git a/tests/tnimterop_c.nim b/tests/tnimterop_c.nim index 0360225..8428489 100644 --- a/tests/tnimterop_c.nim +++ b/tests/tnimterop_c.nim @@ -45,7 +45,7 @@ check TEST_STR == "hello world" when defined(osx): check OSDEF == 10 -elif defined(windows): +elif defined(Windows): check OSDEF == 20 else: check OSDEF == 30 diff --git a/tests/tpcre.nim b/tests/tpcre.nim index c8e8059..4a426c4 100644 --- a/tests/tpcre.nim +++ b/tests/tpcre.nim @@ -14,7 +14,7 @@ static: const dynpcre = - when defined(windows): + when defined(Windows): when defined(cpu64): "pcre64.dll" else: diff --git a/tests/zlib.nim b/tests/zlib.nim index ce26c9a..09a6df2 100644 --- a/tests/zlib.nim +++ b/tests/zlib.nim @@ -15,7 +15,7 @@ proc zlibPreBuild(outdir, path: string) = # Delete default Makefile if mf.readFile().contains("configure first"): mf.rmFile() - when defined(windows): + when defined(Windows): # Fix static lib name on Windows setCmakeLibName(outdir, "zlibstatic", prefix = "lib", oname = "zlib", suffix = ".a") |
