comparison src/capnproto-0.6.0/c++/samples/test.sh @ 62:0994c39f1e94

Cap'n Proto v0.6 + build for OSX
author Chris Cannam <cannam@all-day-breakfast.com>
date Mon, 22 May 2017 10:01:37 +0100
parents
children
comparison
equal deleted inserted replaced
61:d101c4099725 62:0994c39f1e94
1 #! /usr/bin/env bash
2 #
3 # Quick script that compiles and runs the samples, then cleans up.
4 # Used for release testing.
5
6 set -exuo pipefail
7
8 capnpc -oc++ addressbook.capnp
9 c++ -std=c++11 -Wall addressbook.c++ addressbook.capnp.c++ \
10 $(pkg-config --cflags --libs capnp) -o addressbook
11 ./addressbook write | ./addressbook read
12 ./addressbook dwrite | ./addressbook dread
13 rm addressbook addressbook.capnp.c++ addressbook.capnp.h
14
15 capnpc -oc++ calculator.capnp
16 c++ -std=c++11 -Wall calculator-client.c++ calculator.capnp.c++ \
17 $(pkg-config --cflags --libs capnp-rpc) -o calculator-client
18 c++ -std=c++11 -Wall calculator-server.c++ calculator.capnp.c++ \
19 $(pkg-config --cflags --libs capnp-rpc) -o calculator-server
20 rm -f /tmp/capnp-calculator-example-$$
21 ./calculator-server unix:/tmp/capnp-calculator-example-$$ &
22 sleep 0.1
23 ./calculator-client unix:/tmp/capnp-calculator-example-$$
24 kill %+
25 wait %+ || true
26 rm calculator-client calculator-server calculator.capnp.c++ calculator.capnp.h /tmp/capnp-calculator-example-$$