Merge pull request #1 from jangko/fix_ci

fixes appveyor.yml
This commit is contained in:
andri lim 2018-11-02 22:06:50 +07:00 committed by GitHub
commit 66d13402c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 25 deletions

View File

@ -80,18 +80,18 @@ install:
)
- git clone --depth 1 https://github.com/google/snappy
build_script:
- cd snappy
- mkdir build
- cd build
- cmake .. -G "MinGW Makefiles"
- cmake .. -G "MinGW Makefiles" -DCMAKE_IGNORE_PATH="C:/Program Files/Git/usr/bin"
- mingw32-make
- copy libsnappy.a C:\projects\%APPVEYOR_PROJECT_SLUG%\tests
- copy libsnappy.a C:\projects\snappy\tests
- cd C:\projects\%APPVEYOR_PROJECT_SLUG%
- nimble install -y > nul
test_script:
- nimble test

View File

@ -40,7 +40,7 @@ script:
- mkdir build
- cd build && cmake ../ && make
- cd ../..
- cp snappy/build/libsnappy.a tests/libsnappy.a
- cp snappy/build/libsnappy.a ./tests/
- nimble install -y > /dev/null
- nimble test

View File

@ -8,5 +8,5 @@ skipDirs = @["tests"]
requires: "nim >= 0.19.0"
task test, "Run all tests":
exec "nim c tests/test"
exec "nim c -d:release tests/test"
exec "nim c --passL:\"-lsnappy -L./tests -lstdc++\" -r tests/test"
exec "nim c --passL:\"-lsnappy -L./tests -lstdc++\" -d:release -r tests/test"

View File

@ -2,10 +2,6 @@ import
snappy, os, unittest,
terminal, strutils, randgen
{.passL: "-lsnappy".}
{.passL: "-L.".}
{.passL: "-lstdc++".}
proc snappy_compress(input: cstring, input_length: csize, compressed: cstring, compressed_length: var csize): cint {.importc, cdecl.}
proc snappy_uncompress(compressed: cstring, compressed_length: csize, uncompressed: cstring, uncompressed_length: var csize): cint {.importc, cdecl.}
proc snappy_max_compressed_length(source_length: csize): csize {.importc, cdecl.}
@ -100,22 +96,23 @@ template toBytes(s: string): auto =
toOpenArrayByte(s, 0, s.len-1)
suite "snappy":
let dataDir = getAppDir() & DirSep & testDataDir
test "basic roundtrip test":
check roundTrip("empty", empty)
check roundTrip("oneZero", oneZero)
check roundTrip("data_html", testDataDir & "html")
check roundTrip("data_urls", testDataDir & "urls.10K")
check roundTrip("data_jpg", testDataDir & "fireworks.jpeg")
check roundTrip("data_pdf", testDataDir & "paper-100k.pdf")
check roundTrip("data_html4", testDataDir & "html_x_4")
check roundTrip("data_txt1", testDataDir & "alice29.txt")
check roundTrip("data_txt2", testDataDir & "asyoulik.txt")
check roundTrip("data_txt3", testDataDir & "lcet10.txt")
check roundTrip("data_txt4", testDataDir & "plrabn12.txt")
check roundTrip("data_pb", testDataDir & "geo.protodata")
check roundTrip("data_gaviota", testDataDir & "kppkn.gtb")
check roundTrip("data_golden", testDataDir & "Mark.Twain-Tom.Sawyer.txt")
check roundTripRev("data_golden_rev", testDataDir & "Mark.Twain-Tom.Sawyer.txt.rawsnappy")
check roundTrip("data_html", dataDir & "html")
check roundTrip("data_urls", dataDir & "urls.10K")
check roundTrip("data_jpg", dataDir & "fireworks.jpeg")
check roundTrip("data_pdf", dataDir & "paper-100k.pdf")
check roundTrip("data_html4", dataDir & "html_x_4")
check roundTrip("data_txt1", dataDir & "alice29.txt")
check roundTrip("data_txt2", dataDir & "asyoulik.txt")
check roundTrip("data_txt3", dataDir & "lcet10.txt")
check roundTrip("data_txt4", dataDir & "plrabn12.txt")
check roundTrip("data_pb", dataDir & "geo.protodata")
check roundTrip("data_gaviota", dataDir & "kppkn.gtb")
check roundTrip("data_golden", dataDir & "Mark.Twain-Tom.Sawyer.txt")
check roundTripRev("data_golden_rev", dataDir & "Mark.Twain-Tom.Sawyer.txt.rawsnappy")
test "misc test":
for i in 1..32: