nim-leveldb/tests/test.nim

40 lines
846 B
Nim
Raw Normal View History

2020-02-23 22:03:47 +08:00
import unittest, options, os, osproc, sequtils, strutils
2024-05-13 14:08:17 +02:00
import leveldbstatic as leveldb
import leveldbstatic/raw
2019-11-09 15:52:46 +08:00
suite "checking":
test "A!":
echo "A!"
when sizeof(int) == 8:
echo "int = 8"
else:
echo "int is not 8"
when defined(fdatasync):
echo "yes fdatasync"
else:
echo "no fdatasync"
when defined(F_FULLFSYNC):
echo "yes full"
else:
echo "no full"
when defined(O_CLOEXEC):
echo "yes oclo"
else:
echo "no oclo"
static:
proc doesCompile(cfile: string): bool =
# static:
let rv = gorgeEx("gcc " & cfile)
echo rv[0]
return rv[1] == 0
echo "compileme.c: " & $doesCompile("compileme.c")
echo "compileme2.c: " & $doesCompile("compileme2.c")
echo "compileme3.c: " & $doesCompile("compileme3.c")
2020-02-23 21:37:54 +08:00