diff options
| author | Oskari Timperi <oskari.timperi@iki.fi> | 2018-05-05 15:47:14 +0300 |
|---|---|---|
| committer | Oskari Timperi <oskari.timperi@iki.fi> | 2018-05-05 15:47:14 +0300 |
| commit | ce017ae7a7411ad681d9d863d3f803505b05ec6f (patch) | |
| tree | fd10004571d63cc85b7b29f21b0eaaa6d9bce0e2 | |
| parent | f59b722f99cd23c8899b880de09ede1625e3e638 (diff) | |
| download | nimpb-ce017ae7a7411ad681d9d863d3f803505b05ec6f.tar.gz nimpb-ce017ae7a7411ad681d9d863d3f803505b05ec6f.zip | |
Add nimble task for building conformance suite
| -rw-r--r-- | nimpb.nimble | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/nimpb.nimble b/nimpb.nimble index c009e67..e2a4168 100644 --- a/nimpb.nimble +++ b/nimpb.nimble @@ -3,7 +3,7 @@ author = "Oskari Timperi" description = "protobuf library for Nim" license = "MIT" -skipDirs = @["examples", "tests"] +skipDirs = @["examples", "tests", "protobuf-3.5.1"] bin = @["nimpb/compiler/nimpb_build"] @@ -17,10 +17,22 @@ requires "nimpb_protoc" import ospaths, strformat +task build_protobuf, "Download protobuf, build it and then build the conformance test suite": + if not fileExists("protobuf-all-3.5.1.zip"): + exec "wget https://github.com/google/protobuf/releases/download/v3.5.1/protobuf-all-3.5.1.zip" + if not dirExists("protobuf-3.5.1"): + exec "unzip protobuf-all-3.5.1.zip" + withDir "protobuf-3.5.1": + if not fileExists("Makefile"): + exec "./configure" + exec "make" + withDir "conformance": + exec "make" + task run_conformance_tests, "Run the conformance test suite": var testDir = "tests/conformance" var proto = testDir / "test_messages_proto3.proto" - var testRunner = "../protobuf-3.5.1/conformance/conformance-test-runner" + var testRunner = "./protobuf-3.5.1/conformance/conformance-test-runner" exec &"./nimpb/compiler/nimpb_build -I={testDir} --out={testDir} {proto}" exec &"./nimpb/compiler/nimpb_build -I={testDir} --out={testDir} {testDir}/conformance.proto" exec &"nimble c {testDir}/conformance_nim.nim" |
