Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Skip test on travis
  • Loading branch information
nyalldawson committed Dec 8, 2020
1 parent c053724 commit 2182db8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tests/src/analysis/testqgsprocessingalgs.cpp
Expand Up @@ -423,6 +423,11 @@ void TestQgsProcessingAlgs::packageAlg()

void TestQgsProcessingAlgs::exportToSpreadsheetXlsx()
{
if ( QgsTest::isTravis() )
{
QSKIP( "XLSX driver not working on Travis" );
}

QString outputPath = QDir::tempPath() + "/spreadsheet.xlsx";
exportToSpreadsheet( outputPath );
}
Expand Down Expand Up @@ -548,11 +553,11 @@ void TestQgsProcessingAlgs::exportToSpreadsheet( const QString &outputPath )
QVERIFY( !results.value( QStringLiteral( "OUTPUT" ) ).toString().isEmpty() );
std::unique_ptr< QgsVectorLayer > pointLayer = qgis::make_unique< QgsVectorLayer >( outputPath + "|layername=points", "points", "ogr" );
QVERIFY( pointLayer->isValid() );
QCOMPARE( pointLayer->fields().at( 0 ).name(), QStringLiteral( "Class" ) );
QCOMPARE( pointLayer->featureCount(), mPointsLayer->featureCount() );
pointLayer.reset();
std::unique_ptr< QgsVectorLayer > polygonLayer = qgis::make_unique< QgsVectorLayer >( outputPath + "|layername=polygons", "polygons", "ogr" );
QVERIFY( polygonLayer->isValid() );
QCOMPARE( polygonLayer->fields().at( 0 ).name(), QStringLiteral( "Name" ) );
QCOMPARE( polygonLayer->featureCount(), mPolygonLayer->featureCount() );
polygonLayer.reset();

std::unique_ptr<QgsVectorLayer> rectangles = qgis::make_unique<QgsVectorLayer>( QStringLiteral( TEST_DATA_DIR ) + "/rectangles.shp",
Expand All @@ -567,7 +572,7 @@ void TestQgsProcessingAlgs::exportToSpreadsheet( const QString &outputPath )
QVERIFY( !results2.value( QStringLiteral( "OUTPUT" ) ).toString().isEmpty() );
std::unique_ptr< QgsVectorLayer > rectanglesPackagedLayer = qgis::make_unique< QgsVectorLayer >( outputPath + "|layername=rectangles", "points", "ogr" );
QVERIFY( rectanglesPackagedLayer->isValid() );
QCOMPARE( rectanglesPackagedLayer->fields().at( 0 ).name(), QStringLiteral( "id" ) );
QCOMPARE( rectanglesPackagedLayer->featureCount(), rectangles->featureCount() );
rectanglesPackagedLayer.reset();

pointLayer = qgis::make_unique< QgsVectorLayer >( outputPath + "|layername=points", "points", "ogr" );
Expand All @@ -582,7 +587,7 @@ void TestQgsProcessingAlgs::exportToSpreadsheet( const QString &outputPath )
QVERIFY( !results3.value( QStringLiteral( "OUTPUT" ) ).toString().isEmpty() );
rectanglesPackagedLayer = qgis::make_unique< QgsVectorLayer >( outputPath + "|layername=rectangles", "points", "ogr" );
QVERIFY( rectanglesPackagedLayer->isValid() );
QCOMPARE( rectanglesPackagedLayer->fields().at( 0 ).name(), QStringLiteral( "id" ) );
QCOMPARE( rectanglesPackagedLayer->featureCount(), rectangles->featureCount() );

pointLayer = qgis::make_unique< QgsVectorLayer >( outputPath + "|layername=points", "points", "ogr" );
QVERIFY( !pointLayer->isValid() ); // It's gone -- the xlsx was recreated with a single layer
Expand Down

0 comments on commit 2182db8

Please sign in to comment.