view src/capnproto-git-20161025/c++/samples/test.sh @ 83:ae30d91d2ffe

Replace these with versions built using an older toolset (so as to avoid ABI compatibilities when linking on Ubuntu 14.04 for packaging purposes)
author Chris Cannam
date Fri, 07 Feb 2020 11:51:13 +0000
parents 9530b331f8c1
children
line wrap: on
line source
#! /usr/bin/env bash
#
# Quick script that compiles and runs the samples, then cleans up.
# Used for release testing.

set -exuo pipefail

capnpc -oc++ addressbook.capnp
c++ -std=c++11 -Wall addressbook.c++ addressbook.capnp.c++ \
    $(pkg-config --cflags --libs capnp) -o addressbook
./addressbook write | ./addressbook read
./addressbook dwrite | ./addressbook dread
rm addressbook addressbook.capnp.c++ addressbook.capnp.h

capnpc -oc++ calculator.capnp
c++ -std=c++11 -Wall calculator-client.c++ calculator.capnp.c++ \
    $(pkg-config --cflags --libs capnp-rpc) -o calculator-client
c++ -std=c++11 -Wall calculator-server.c++ calculator.capnp.c++ \
    $(pkg-config --cflags --libs capnp-rpc) -o calculator-server
rm -f /tmp/capnp-calculator-example-$$
./calculator-server unix:/tmp/capnp-calculator-example-$$ &
sleep 0.1
./calculator-client unix:/tmp/capnp-calculator-example-$$
kill %+
wait %+ || true
rm calculator-client calculator-server calculator.capnp.c++ calculator.capnp.h /tmp/capnp-calculator-example-$$