aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOskari Timperi <oskari.timperi@iki.fi>2018-04-12 18:20:29 +0300
committerOskari Timperi <oskari.timperi@iki.fi>2018-04-12 18:20:29 +0300
commit88cdf120de1bb3790fdfb31b501737c957a8b972 (patch)
tree5867eaeec6153744a1e88793829ba6488ff6a3f9
parent39d9dca5b72b07833252050849b1f4b1dda1cb5d (diff)
downloadnimpb-88cdf120de1bb3790fdfb31b501737c957a8b972.tar.gz
nimpb-88cdf120de1bb3790fdfb31b501737c957a8b972.zip
Add some development tasks to nimpb.nimble
-rw-r--r--nimpb.nimble16
1 files changed, 16 insertions, 0 deletions
diff --git a/nimpb.nimble b/nimpb.nimble
index 067245e..3fe9574 100644
--- a/nimpb.nimble
+++ b/nimpb.nimble
@@ -14,3 +14,19 @@ requires "nim >= 0.18.0"
# if a user already has the protoc compiler somewhere, in which case
# nimpb_protoc might be unnecessary.
requires "nimpb_protoc"
+
+import ospaths, strformat
+
+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"
+ exec &"./nimpb/compiler/nimpb_build -I{testDir} --out={testDir} {proto}"
+ exec &"nimble c {testDir}/conformance_nim.nim"
+ exec &"{testRunner} {testDir}/conformance_nim"
+
+task gen_descriptor, "Re-generate nimpb/compiler/descriptor_pb.nim":
+ var incdir = "../nimpb_protoc/src/nimpb_protocpkg/protobuf/include/google/protobuf"
+ var descriptor = incdir / "descriptor.proto"
+ var outdir = "nimpb/compiler"
+ exec &"./nimpb/compiler/nimpb_build -I{incdir} --out={outdir} {descriptor}"