Commit 5e4d9cea authored by Harris's avatar Harris Committed by Harris Hancock

super-test.sh: Factor out test running commands

parent a8c462ed
...@@ -7,6 +7,19 @@ doit() { ...@@ -7,6 +7,19 @@ doit() {
"$@" "$@"
} }
function test_samples() {
echo "@@@@ ./addressbook (in various configurations)"
./addressbook write | ./addressbook read
./addressbook dwrite | ./addressbook dread
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 -f /tmp/capnp-calculator-example-$$
}
QUICK= QUICK=
PARALLEL=$(nproc 2>/dev/null || echo 1) PARALLEL=$(nproc 2>/dev/null || echo 1)
...@@ -228,15 +241,7 @@ while [ $# -gt 0 ]; do ...@@ -228,15 +241,7 @@ while [ $# -gt 0 ]; do
-DCAPNPC_FLAGS=--no-standard-import -DCAPNPC_IMPORT_DIRS="$WORKSPACE/inst/include" -DCAPNPC_FLAGS=--no-standard-import -DCAPNPC_IMPORT_DIRS="$WORKSPACE/inst/include"
doit make -j$PARALLEL doit make -j$PARALLEL
echo "@@@@ ./addressbook (in various configurations)" test_samples
./addressbook write | ./addressbook read
./addressbook dwrite | ./addressbook dread
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
echo "=========================================================================" echo "========================================================================="
echo "Cap'n Proto ($CONFIGURATION) installs a working CMake config package." echo "Cap'n Proto ($CONFIGURATION) installs a working CMake config package."
...@@ -375,23 +380,16 @@ cd samples ...@@ -375,23 +380,16 @@ cd samples
doit capnp compile -oc++ addressbook.capnp -I"$STAGING"/include --no-standard-import doit capnp compile -oc++ addressbook.capnp -I"$STAGING"/include --no-standard-import
doit ${CXX:-g++} -std=c++11 addressbook.c++ addressbook.capnp.c++ -o addressbook \ doit ${CXX:-g++} -std=c++11 addressbook.c++ addressbook.capnp.c++ -o addressbook \
$CXXFLAGS $(pkg-config --cflags --libs capnp) $CXXFLAGS $(pkg-config --cflags --libs capnp)
echo "@@@@ ./addressbook (in various configurations)"
./addressbook write | ./addressbook read
./addressbook dwrite | ./addressbook dread
rm addressbook addressbook.capnp.c++ addressbook.capnp.h
doit capnp compile -oc++ calculator.capnp -I"$STAGING"/include --no-standard-import doit capnp compile -oc++ calculator.capnp -I"$STAGING"/include --no-standard-import
doit ${CXX:-g++} -std=c++11 calculator-client.c++ calculator.capnp.c++ -o calculator-client \ doit ${CXX:-g++} -std=c++11 calculator-client.c++ calculator.capnp.c++ -o calculator-client \
$CXXFLAGS $(pkg-config --cflags --libs capnp-rpc) $CXXFLAGS $(pkg-config --cflags --libs capnp-rpc)
doit ${CXX:-g++} -std=c++11 calculator-server.c++ calculator.capnp.c++ -o calculator-server \ doit ${CXX:-g++} -std=c++11 calculator-server.c++ calculator.capnp.c++ -o calculator-server \
$CXXFLAGS $(pkg-config --cflags --libs capnp-rpc) $CXXFLAGS $(pkg-config --cflags --libs capnp-rpc)
rm -f /tmp/capnp-calculator-example-$$
./calculator-server unix:/tmp/capnp-calculator-example-$$ & test_samples
sleep 0.1 rm addressbook addressbook.capnp.c++ addressbook.capnp.h
./calculator-client unix:/tmp/capnp-calculator-example-$$ rm calculator-client calculator-server calculator.capnp.c++ calculator.capnp.h
kill %+
wait %+ || true
rm calculator-client calculator-server calculator.capnp.c++ calculator.capnp.h /tmp/capnp-calculator-example-$$
cd .. cd ..
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment