osrm-backend/test/create_pbf_test_data.sh
Michael Krasnyk 68019a1fb2 Squashed 'third_party/protozero/' content from commit d5d8debf1
git-subtree-dir: third_party/protozero
git-subtree-split: d5d8debf1b17c6bb652395957b76cde7787e5377
2018-04-19 22:03:49 +03:00

29 lines
606 B
Bash
Executable File

#!/bin/sh
#
# create_pbf_test_data.sh [TESTCASE]
#
# This script creates the test data for the given test case in protobuf format
# using the testcase.proto description and the testcase.cpp code.
#
# If called without a test case it will iterate over all test cases generating
# all data.
#
set -e
if [ -z "$1" ]; then
for dir in t/*; do
$0 $dir
done
fi
echo "Generating $1..."
cd $1
if [ -f testcase.proto ]; then
protoc --cpp_out=. testcase.proto
$CXX -std=c++11 -I../../include -o testcase testcase.cpp testcase.pb.cc -lprotobuf-lite -pthread
./testcase
fi
cd ../..