Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add QGSTEST_NEED_PGTEST_DB macro in qgstest.h
Can be used by tests to declare their need for a qgis test db
and allows users to skip them by defining a QGIS_PGTEST_DB_SKIP
environment variable
  • Loading branch information
strk authored and nyalldawson committed Mar 6, 2023
1 parent 98841bd commit cfee2c3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/test/qgstest.h
Expand Up @@ -104,6 +104,11 @@
QCOMPARE( result.replace( QStringLiteral("ts=\" \" cs=\",\""), QStringLiteral("cs=\",\" ts=\" \"") ), expected ); \
}(void)(0)

// Start your PostgreSQL-backend connection requiring test with this macro
#define QGSTEST_NEED_PGTEST_DB() \
if ( getenv( "QGIS_PGTEST_DB_SKIP" ) ) \
QSKIP( "Test disabled due to QGIS_PGTEST_DB_SKIP env variable being set" );

/**
* Base class for tests.
*
Expand Down

0 comments on commit cfee2c3

Please sign in to comment.