comparison src/capnproto-git-20161025/c++/samples/test.sh @ 48:9530b331f8c1

Add Cap'n Proto source
author Chris Cannam <cannam@all-day-breakfast.com>
date Tue, 25 Oct 2016 11:17:01 +0100
parents
children
comparison
equal deleted inserted replaced
47:d93140aac40b 48:9530b331f8c1
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-$$