capnproto

FORK: Cap'n Proto serialization/RPC system - core tools and C++ library
git clone https://git.neptards.moe/neptards/capnproto.git
Log | Files | Refs | README | LICENSE

test.sh (1023B)


      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++14 -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++14 -Wall calculator-client.c++ calculator.capnp.c++ \
     17     $(pkg-config --cflags --libs capnp-rpc) -o calculator-client
     18 c++ -std=c++14 -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-$$