Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 31 additions & 12 deletions tools/developer/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function set_cmake {
#cmake -DPOSTGRESQL_BIN=${PGBIN} -DDOC_USE_BOOTSTRAP=ON -DWITH_DOC=ON -DBUILD_DOXY=ON -DBUILD_LATEX=ON -DCMAKE_BUILD_TYPE=Debug -DES=ON -DPROJECT_DEBUG=ON ..

# building languages -DES=ON -DJA=ON -DZH_HANS=ON -DDE=ON -DKO=ON
#cmake -DPOSTGRESQL_BIN=${PGBIN} -DDOC_USE_BOOTSTRAP=ON -DWITH_DOC=ON -DBUILD_DOXY=ON -DBUILD_LATEX=ON -DES=ON -DCMAKE_BUILD_TYPE=Debug ..
#cmake -DPOSTGRESQL_BIN=${PGBIN} -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DDOC_USE_BOOTSTRAP=ON -DWITH_DOC=ON -DBUILD_DOXY=ON -DBUILD_LATEX=ON -DES=ON -DCMAKE_BUILD_TYPE=Debug ..

# check link in documentation
#cmake -DPOSTGRESQL_BIN=${PGBIN} -DDOC_USE_BOOTSTRAP=ON -DWITH_DOC=ON -DES=ON -DLINKCHECK=ON -DCMAKE_BUILD_TYPE=Release ..
Expand Down Expand Up @@ -105,14 +105,15 @@ function set_compiler {
echo ------------------------------------

if [ -n "$1" ]; then
update-alternatives --set gcc "/usr/bin/gcc-$1"
sudo update-alternatives --set gcc "/usr/bin/gcc-$1"
sudo update-alternatives --set g++ "/usr/bin/g++-$1"
fi
}

function build_doc {
pushd build > /dev/null || exit 1
#rm -rf doc/* ; rm -rf locale/*/*/*.mo
rm -rf doc/*
#rm -rf doc/*
make doc
#example on how to only build spanish html
#make html-es
Expand All @@ -123,6 +124,18 @@ function build_doc {
popd > /dev/null || exit 1
}

function check {
pushd build > /dev/null || exit 1
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .
cppcheck --project=compile_commands.json -q
popd > /dev/null || exit 1
}

function tidy_with_clang {
.github/scripts/tidy-vs-commit.sh upstream/develop
sleep 1
}

function build {
pushd build > /dev/null || exit 1
set_cmake
Expand All @@ -141,25 +154,31 @@ function test_compile {
build

echo --------------------------------------------
echo Execute tap_directories
echo Execute documentation queries
echo --------------------------------------------
for d in ${TAP_DIRS}
for d in ${QUERIES_DIRS}
do
time bash taptest.sh "${d}" "-p ${PGPORT}"
#tools/testers/doc_queries_generator.pl -alg "docqueries/${d}" -documentation -pgport "${PGPORT}"
tools/testers/doc_queries_generator.pl -alg "docqueries/${d}" -level WARNING -pgport "${PGPORT}"
#tools/testers/doc_queries_generator.pl -alg "docqueries/${d}" -pgport "${PGPORT}"
done

echo --------------------------------------------
echo Execute documentation queries
echo Execute tap_directories
echo --------------------------------------------
for d in ${QUERIES_DIRS}
for d in ${TAP_DIRS}
do
#tools/testers/doc_queries_generator.pl -alg "docqueries/${d}" -documentation -pgport "${PGPORT}"
#tools/testers/doc_queries_generator.pl -alg "docqueries/${d}" -debug1 -pgport "${PGPORT}"
tools/testers/doc_queries_generator.pl -alg "docqueries/${d}" -pgport "${PGPORT}"
time bash taptest.sh "${d}" "-p ${PGPORT}"
done

build_doc
tap_test
tools/testers/doc_queries_generator.pl -pgport $PGPORT
#exit 0


tidy_with_clang
check
build_doc
tap_test
action_tests
}
Expand Down
59 changes: 28 additions & 31 deletions tools/developer/taptest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,26 @@ if [[ -z $1 ]]; then
exit 1;
fi

# run from root of repository
if ! DIR=$(git rev-parse --show-toplevel 2>/dev/null); then
echo "Error: Must be run from within the git repository" >&2
exit 1
fi
pushd "${DIR}" > /dev/null || exit 1

DIR="$1"
shift
PGFLAGS=$*
VERSION=$(grep -Po '(?<=project\(PGROUTING VERSION )[^;]+' CMakeLists.txt)

echo "dir ${DIR}"
echo "pgflags ${PGFLAGS}"
QUIET="-v"
QUIET="-q"

PGPORT="5432"
PGUSER="${PGUSER:-$USER}"

PGDATABASE="___pgr___test___"
PGRVERSION="3.6.1 3.6.0 3.5.1 3.5.0 3.2.0 3.1.3 3.0.6"
PGRVERSION="3.7.2"
Expand All @@ -46,49 +56,36 @@ do
pushd tools/testers/
echo "--------------------------"
echo " Running with version ${v}"
echo " test ${DIR}"
echo "--------------------------"
sleep 3

dropdb --if-exists "${PGFLAGS}" "${PGDATABASE}"
createdb "${PGFLAGS}" "${PGDATABASE}"

psql "$PGFLAGS" -d "$PGDATABASE" -X -q --set client_min_messages=WARNING --set ON_ERROR_STOP=1 --pset pager=off \
-c "CREATE EXTENSION IF NOT EXISTS pgtap; CREATE EXTENSION IF NOT EXISTS pgrouting WITH VERSION '${v}' CASCADE;"

bash setup_db.sh "${PGPORT}" "${PGDATABASE}" "${PGUSER}" "${v}"
echo "--------------------------"
echo " Installed version"
echo "--------------------------"
psql "${PGFLAGS}" -d "$PGDATABASE" -c "SELECT * FROM pgr_full_version();"
#psql "${PGFLAGS}" -d "$PGDATABASE" -c "SET client_min_messages TO DEBUG3; ALTER EXTENSION pgrouting UPDATE TO '3.7.0';"
echo "--------------------------"
echo " update version"
echo "--------------------------"
psql "${PGFLAGS}" -d "$PGDATABASE" -c "SELECT * FROM pgr_full_version();"
popd

psql "${PGFLAGS}" -d "$PGDATABASE" -X -q --set client_min_messages=WARNING --set ON_ERROR_STOP=1 --pset pager=off \
-f sampledata.sql \
-f solomon_100_rc101.data.sql \
-f innerQuery.sql \
-f innerQuery_old.sql \
-f inner_styles.sql \
-f old_inner_styles.sql \
-f no_crash_test.sql \
-f alphaShapeTester.sql \
-f general_pgtap_tests.sql \
-f no_crash_general.sql \
-f dijkstra_pgtap_tests.sql \
-f flow_pgtap_tests.sql \
-f trsp_tests.sql \
-f spanningtree.sql \
-f types_check.sql \
-f via_compare.sql \
-f astar_pgtap_tests.sql \
-f compare_dijkstra.sql \
-f allpairs_tests.sql \
-f contraction_tapfuncs.sql\
-f tsp_pgtap_tests.sql
if [[ "${v}" != "${VERSION}" ]]
then
# run tests on old version
pg_prove "$QUIET" --normalize --directives --recurse "${PGFLAGS}" -d "${PGDATABASE}" "pgtap/${DIR}"

# update to this version
echo "--------------------------"
echo " update version"
echo "--------------------------"
psql "${PGFLAGS}" -d "$PGDATABASE" -c "SET client_min_messages TO DEBUG3; ALTER EXTENSION pgrouting UPDATE TO '${VERSION}';"
fi

# run this version's test
psql "${PGFLAGS}" -d "$PGDATABASE" -c "SELECT * FROM pgr_full_version();"


popd
pg_prove "$QUIET" --normalize --directives --recurse "${PGFLAGS}" -d "${PGDATABASE}" "pgtap/${DIR}"
#dropdb --if-exists "${PGFLAGS}" "${PGDATABASE}"
done
5 changes: 3 additions & 2 deletions tools/testers/doc_queries_generator.pl
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ sub Usage {
elsif ($a =~ /^-c/i) {
$clean = 1;
}
elsif ($a =~ /^-l$/i) {
$LEVEL = $psql = shift @ARGV || Usage();
elsif ($a =~ /^-l(evel)?/i) {
$LEVEL = shift @ARGV || Usage();
print "The level $LEVEL\n";
}
elsif ($a =~ /^-v/i) {
$VERBOSE = 1;
Expand Down
Loading