Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
test vector join: add PostgreSQL provider
  • Loading branch information
3nids committed Jan 20, 2016
1 parent c288311 commit 13ccf70
Show file tree
Hide file tree
Showing 8 changed files with 279 additions and 108 deletions.
5 changes: 3 additions & 2 deletions ci/travis/linux/before_script.sh
@@ -1,4 +1,5 @@
printf "[qgis_test]\nhost=localhost\ndbname=qgis_test\nuser=postgres" > ~/.pg_service.conf
psql -c 'CREATE DATABASE qgis_test;' -U postgres
psql -f $TRAVIS_BUILD_DIR/tests/testdata/provider/testdata.sql -U postgres -d qgis_test
psql -f $TRAVIS_BUILD_DIR/tests/testdata/provider/reltests.sql -U postgres -d qgis_test
psql -f $TRAVIS_BUILD_DIR/tests/testdata/provider/testdata_pg.sql -U postgres -d qgis_test
psql -f $TRAVIS_BUILD_DIR/tests/testdata/provider/testdata_pg_reltests.sql -U postgres -d qgis_test
psql -f $TRAVIS_BUILD_DIR/tests/testdata/provider/testdata_pg_vectorjoin.sql -U postgres -d qgis_test
2 changes: 2 additions & 0 deletions src/core/qgsvectorlayerjoinbuffer.cpp
Expand Up @@ -85,7 +85,9 @@ bool QgsVectorLayerJoinBuffer::addJoin( const QgsVectorJoinInfo& joinInfo )
// but then QgsProject makes sure to call createJoinCaches() which will do the connection.
// Unique connection makes sure we do not respond to one layer's update more times (in case of multiple join)
if ( QgsVectorLayer* vl = qobject_cast<QgsVectorLayer*>( QgsMapLayerRegistry::instance()->mapLayer( joinInfo.joinLayerId ) ) )
{
connect( vl, SIGNAL( updatedFields() ), this, SLOT( joinedLayerUpdatedFields() ), Qt::UniqueConnection );
}

emit joinedFieldsChanged();
return true;
Expand Down
7 changes: 7 additions & 0 deletions tests/src/core/CMakeLists.txt
Expand Up @@ -33,6 +33,13 @@ INCLUDE_DIRECTORIES(SYSTEM
ADD_DEFINITIONS(-DTEST_DATA_DIR="\\"${TEST_DATA_DIR}\\"")

ADD_DEFINITIONS(-DINSTALL_PREFIX="\\"${CMAKE_INSTALL_PREFIX}\\"")

# enable postgresql tests
SET (ENABLE_PGTEST FALSE CACHE BOOL "Enable PostgreSQL provider tests")
IF ( ENABLE_PGTEST )
ADD_DEFINITIONS( "-DENABLE_PGTEST" )
ENDIF ()

#############################################################
# libraries

Expand Down

0 comments on commit 13ccf70

Please sign in to comment.