Merge pull request #6023 from OPM/error-as-warnings-flag-6018

Error as warnings flag 6018
This commit is contained in:
Kristian Bendiksen
2020-06-04 13:40:52 +02:00
committed by GitHub
30 changed files with 121015 additions and 121953 deletions
@@ -32,6 +32,14 @@ jobs:
vcpkg-triplet: x64-linux, vcpkg-triplet: x64-linux,
cmake-toolchain: 'vcpkg/scripts/buildsystems/vcpkg.cmake' cmake-toolchain: 'vcpkg/scripts/buildsystems/vcpkg.cmake'
} }
- {
name: "Ubuntu 20.04",
os: ubuntu-20.04,
cc: "gcc", cxx: "g++",
vcpkg-response-file: vcpkg_x64-linux.txt,
vcpkg-triplet: x64-linux,
cmake-toolchain: 'vcpkg/scripts/buildsystems/vcpkg.cmake'
}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v1 uses: actions/checkout@v1
@@ -141,6 +149,7 @@ jobs:
-D CMAKE_BUILD_TYPE=$ENV{BUILD_TYPE} -D CMAKE_BUILD_TYPE=$ENV{BUILD_TYPE}
-D GSL_ENABLE=true -D GSL_ENABLE=true
-D RESINSIGHT_INCLUDE_APPLICATION_UNIT_TESTS=true -D RESINSIGHT_INCLUDE_APPLICATION_UNIT_TESTS=true
-D RESINSIGHT_TREAT_WARNINGS_AS_ERRORS=true
-D RESINSIGHT_ENABLE_GRPC=true -D RESINSIGHT_ENABLE_GRPC=true
-D RESINSIGHT_GRPC_PYTHON_EXECUTABLE=python -D RESINSIGHT_GRPC_PYTHON_EXECUTABLE=python
-D VCPKG_TARGET_TRIPLET=${{ matrix.config.vcpkg-triplet }} -D VCPKG_TARGET_TRIPLET=${{ matrix.config.vcpkg-triplet }}
+2 -2
View File
@@ -59,7 +59,7 @@ jobs:
uses: lukka/run-cmake@v1 uses: lukka/run-cmake@v1
with: with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeAppendedArgs: '-DGSL_ENABLE=true -DRESINSIGHT_ENABLE_GRPC=true -DRESINSIGHT_GRPC_PYTHON_EXECUTABLE=python -DRESINSIGHT_ENABLE_PRECOMPILED_HEADERS=true -DRESINSIGHT_ENABLE_UNITY_BUILD=true -DRESINSIGHT_INCLUDE_APPLICATION_UNIT_TESTS=true' cmakeAppendedArgs: '-DGSL_ENABLE=true -DRESINSIGHT_ENABLE_GRPC=true -DRESINSIGHT_GRPC_PYTHON_EXECUTABLE=python -DRESINSIGHT_ENABLE_PRECOMPILED_HEADERS=true -DRESINSIGHT_ENABLE_UNITY_BUILD=true -DRESINSIGHT_TREAT_WARNINGS_AS_ERRORS=true -DRESINSIGHT_INCLUDE_APPLICATION_UNIT_TESTS=true'
buildDirectory: ${{ github.workspace }}/cmakebuild buildDirectory: ${{ github.workspace }}/cmakebuild
buildWithCMakeArgs: '--config Release --target package' buildWithCMakeArgs: '--config Release --target package'
useVcpkgToolchainFile: true useVcpkgToolchainFile: true
@@ -92,4 +92,4 @@ jobs:
path: ${{ runner.workspace }}/ResInsight/cmakebuild/packages path: ${{ runner.workspace }}/ResInsight/cmakebuild/packages
@@ -1376,7 +1376,7 @@ int RiaApplication::launchUnitTests()
QString filterText = RiaPreferences::current()->gtestFilter(); QString filterText = RiaPreferences::current()->gtestFilter();
if ( !filterText.isEmpty() ) if ( !filterText.isEmpty() )
{ {
::testing::GTEST_FLAG( filter ) = filterText.toLatin1(); ::testing::GTEST_FLAG( filter ) = filterText.toStdString();
// Example on filter syntax // Example on filter syntax
//::testing::GTEST_FLAG( filter ) = "*RifCaseRealizationParametersReaderTest*"; //::testing::GTEST_FLAG( filter ) = "*RifCaseRealizationParametersReaderTest*";
+2 -1
View File
@@ -22,6 +22,7 @@ find_package( OpenGL )
option(RESINSIGHT_ENABLE_GRPC "Enable the gRPC scripting framework" OFF) option(RESINSIGHT_ENABLE_GRPC "Enable the gRPC scripting framework" OFF)
option(RESINSIGHT_GRPC_BUNDLE_PYTHON_MODULE "Bundle the gRPC python modules into the install folder" OFF) option(RESINSIGHT_GRPC_BUNDLE_PYTHON_MODULE "Bundle the gRPC python modules into the install folder" OFF)
option(RESINSIGHT_TREAT_WARNINGS_AS_ERRORS "Treat warnings as errors (stops build)" OFF)
find_package(Qt5 COMPONENTS Core QUIET) find_package(Qt5 COMPONENTS Core QUIET)
@@ -393,7 +394,7 @@ endif()
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set_target_properties(ResInsight PROPERTIES COMPILE_FLAGS "-Wall -Wno-unused-parameter -Wno-reorder -Wno-parentheses -Wno-switch") set_target_properties(ResInsight PROPERTIES COMPILE_FLAGS "-Wall -Wno-unused-parameter -Wno-reorder -Wno-parentheses -Wno-switch")
# Treat warnings as errors on new gcc versions # Treat warnings as errors on new gcc versions
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.2) if (RESINSIGHT_TREAT_WARNINGS_AS_ERRORS)
set_target_properties(ResInsight PROPERTIES COMPILE_FLAGS "-Wall -Wno-unused-parameter -Wno-reorder -Wno-parentheses -Wno-switch -Werror") set_target_properties(ResInsight PROPERTIES COMPILE_FLAGS "-Wall -Wno-unused-parameter -Wno-reorder -Wno-parentheses -Wno-switch -Werror")
endif() endif()
endif() endif()
@@ -106,25 +106,25 @@ TEST( DISABLED_HDFTests, BasicFileRead )
} // end of try block } // end of try block
catch ( H5::FileIException error ) // catch failure caused by the H5File operations catch ( H5::FileIException& error ) // catch failure caused by the H5File operations
{ {
std::cout << error.getCDetailMsg(); std::cout << error.getCDetailMsg();
} }
catch ( H5::DataSetIException error ) // catch failure caused by the DataSet operations catch ( H5::DataSetIException& error ) // catch failure caused by the DataSet operations
{ {
std::cout << error.getCDetailMsg(); std::cout << error.getCDetailMsg();
} }
catch ( H5::DataSpaceIException error ) // catch failure caused by the DataSpace operations catch ( H5::DataSpaceIException& error ) // catch failure caused by the DataSpace operations
{ {
std::cout << error.getCDetailMsg(); std::cout << error.getCDetailMsg();
} }
catch ( H5::DataTypeIException error ) // catch failure caused by the DataSpace operations catch ( H5::DataTypeIException& error ) // catch failure caused by the DataSpace operations
{ {
std::cout << error.getCDetailMsg(); std::cout << error.getCDetailMsg();
} }
} }
#endif // USE_HDF5 #endif // USE_HDF5
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -28,14 +28,6 @@ void caf::FilePath::setPath(const QString& filePath)
m_filePath = filePath; m_filePath = filePath;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void caf::FilePath::operator=(const FilePath& other)
{
m_filePath = other.m_filePath;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -19,7 +19,6 @@ public:
QString path() const; QString path() const;
void setPath(const QString& valueText); void setPath(const QString& valueText);
void operator=(const FilePath& other);
bool operator==(const FilePath& other) const; bool operator==(const FilePath& other) const;
private: private:
@@ -414,12 +414,12 @@ TEST(BaseTest, PdmChildArrayFieldHandle)
InheritedDemoObj* ihd1 = new InheritedDemoObj; InheritedDemoObj* ihd1 = new InheritedDemoObj;
caf::PdmChildArrayFieldHandle* listField = &(ihd1->m_childArrayField); caf::PdmChildArrayFieldHandle* listField = &(ihd1->m_childArrayField);
EXPECT_EQ(0, listField->size()); EXPECT_EQ(0u, listField->size());
EXPECT_TRUE(listField->hasSameFieldCountForAllObjects()); EXPECT_TRUE(listField->hasSameFieldCountForAllObjects());
EXPECT_TRUE(listField->empty()); EXPECT_TRUE(listField->empty());
listField->insertAt(0, s0); listField->insertAt(0, s0);
EXPECT_EQ(1, listField->size()); EXPECT_EQ(1u, listField->size());
EXPECT_TRUE(listField->hasSameFieldCountForAllObjects()); EXPECT_TRUE(listField->hasSameFieldCountForAllObjects());
EXPECT_FALSE(listField->empty()); EXPECT_FALSE(listField->empty());
@@ -427,17 +427,17 @@ TEST(BaseTest, PdmChildArrayFieldHandle)
ihd1->m_childArrayField.push_back(s2); ihd1->m_childArrayField.push_back(s2);
ihd1->m_childArrayField.push_back(s3); ihd1->m_childArrayField.push_back(s3);
EXPECT_EQ(4, listField->size()); EXPECT_EQ(4u, listField->size());
EXPECT_TRUE(listField->hasSameFieldCountForAllObjects()); EXPECT_TRUE(listField->hasSameFieldCountForAllObjects());
EXPECT_FALSE(listField->empty()); EXPECT_FALSE(listField->empty());
listField->erase(0); listField->erase(0);
EXPECT_EQ(3, listField->size()); EXPECT_EQ(3u, listField->size());
EXPECT_TRUE(listField->hasSameFieldCountForAllObjects()); EXPECT_TRUE(listField->hasSameFieldCountForAllObjects());
EXPECT_FALSE(listField->empty()); EXPECT_FALSE(listField->empty());
listField->deleteAllChildObjects(); listField->deleteAllChildObjects();
EXPECT_EQ(0, listField->size()); EXPECT_EQ(0u, listField->size());
EXPECT_TRUE(listField->hasSameFieldCountForAllObjects()); EXPECT_TRUE(listField->hasSameFieldCountForAllObjects());
EXPECT_TRUE(listField->empty()); EXPECT_TRUE(listField->empty());
} }
@@ -535,7 +535,7 @@ TEST(BaseTest, PdmPtrField)
{ {
std::vector<caf::PdmObjectHandle*> objects; std::vector<caf::PdmObjectHandle*> objects;
ihd1->m_ptrField.ptrReferencedObjects(&objects); ihd1->m_ptrField.ptrReferencedObjects(&objects);
EXPECT_EQ(1, objects.size()); EXPECT_EQ(1u, objects.size());
EXPECT_EQ(ihd2, objects[0]); EXPECT_EQ(ihd2, objects[0]);
} }
@@ -547,21 +547,21 @@ TEST(BaseTest, PdmPtrField)
{ {
std::vector<caf::PdmFieldHandle*> ptrFields; std::vector<caf::PdmFieldHandle*> ptrFields;
ihd2->referringPtrFields(ptrFields); ihd2->referringPtrFields(ptrFields);
EXPECT_EQ(1, ptrFields.size()); EXPECT_EQ(1u, ptrFields.size());
EXPECT_EQ(&(ihd1->m_ptrField), ptrFields[0]); EXPECT_EQ(&(ihd1->m_ptrField), ptrFields[0]);
} }
{ {
std::vector<caf::PdmObjectHandle*> objects; std::vector<caf::PdmObjectHandle*> objects;
ihd2->objectsWithReferringPtrFields(objects); ihd2->objectsWithReferringPtrFields(objects);
EXPECT_EQ(1, objects.size()); EXPECT_EQ(1u, objects.size());
EXPECT_EQ(ihd1, objects[0]); EXPECT_EQ(ihd1, objects[0]);
} }
{ {
std::vector<InheritedDemoObj*> reffingDemoObjects; std::vector<InheritedDemoObj*> reffingDemoObjects;
ihd2->objectsWithReferringPtrFieldsOfType(reffingDemoObjects); ihd2->objectsWithReferringPtrFieldsOfType(reffingDemoObjects);
EXPECT_EQ(1, reffingDemoObjects.size()); EXPECT_EQ(1u, reffingDemoObjects.size());
} }
delete ihd1; delete ihd1;
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -327,7 +327,7 @@ TEST(BaseTest, ChildArrayFieldSerializing)
{ {
InheritedDemoObj* ihd1 = new InheritedDemoObj; InheritedDemoObj* ihd1 = new InheritedDemoObj;
ASSERT_EQ(0, ihd1->m_childArrayField.size()); ASSERT_EQ(0u, ihd1->m_childArrayField.size());
QXmlStreamReader xmlStream(serializedString); QXmlStreamReader xmlStream(serializedString);
@@ -385,7 +385,7 @@ TEST(BaseTest, FilePathSerializing)
ihd1->readObjectFromXmlString(serializedString, caf::PdmDefaultObjectFactory::instance()); ihd1->readObjectFromXmlString(serializedString, caf::PdmDefaultObjectFactory::instance());
EXPECT_EQ(2, ihd1->m_multipleFilePath.v().size()); EXPECT_EQ(2u, ihd1->m_multipleFilePath.v().size());
EXPECT_EQ(newVal.toStdString(), ihd1->m_singleFilePath().path().toStdString()); EXPECT_EQ(newVal.toStdString(), ihd1->m_singleFilePath().path().toStdString());
delete ihd1; delete ihd1;
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -463,9 +463,8 @@ TEST(BaseTest, PdmChildArrayField)
} }
#endif #endif
template <> void PrintTo(const QString& val, std::ostream* os) {
inline void GTestStreamToHelper<QString>(std::ostream* os, const QString& val) { *os << val.toLatin1().data();
*os << val.toLatin1().data();
} }
@@ -889,12 +888,12 @@ TEST(BaseTest, PdmChildArrayFieldHandle)
InheritedDemoObj* ihd1 = new InheritedDemoObj; InheritedDemoObj* ihd1 = new InheritedDemoObj;
caf::PdmChildArrayFieldHandle* listField = &(ihd1->m_simpleObjectsField); caf::PdmChildArrayFieldHandle* listField = &(ihd1->m_simpleObjectsField);
EXPECT_EQ(0, listField->size()); EXPECT_EQ(0u, listField->size());
EXPECT_TRUE(listField->hasSameFieldCountForAllObjects()); EXPECT_TRUE(listField->hasSameFieldCountForAllObjects());
EXPECT_TRUE(listField->empty()); EXPECT_TRUE(listField->empty());
ihd1->m_simpleObjectsField.push_back(new SimpleObj); ihd1->m_simpleObjectsField.push_back(new SimpleObj);
EXPECT_EQ(1, listField->size()); EXPECT_EQ(1u, listField->size());
EXPECT_TRUE(listField->hasSameFieldCountForAllObjects()); EXPECT_TRUE(listField->hasSameFieldCountForAllObjects());
EXPECT_FALSE(listField->empty()); EXPECT_FALSE(listField->empty());
@@ -902,17 +901,17 @@ TEST(BaseTest, PdmChildArrayFieldHandle)
ihd1->m_simpleObjectsField.push_back(s2); ihd1->m_simpleObjectsField.push_back(s2);
ihd1->m_simpleObjectsField.push_back(s3); ihd1->m_simpleObjectsField.push_back(s3);
EXPECT_EQ(4, listField->size()); EXPECT_EQ(4u, listField->size());
EXPECT_TRUE(listField->hasSameFieldCountForAllObjects()); EXPECT_TRUE(listField->hasSameFieldCountForAllObjects());
EXPECT_FALSE(listField->empty()); EXPECT_FALSE(listField->empty());
listField->erase(0); listField->erase(0);
EXPECT_EQ(3, listField->size()); EXPECT_EQ(3u, listField->size());
EXPECT_TRUE(listField->hasSameFieldCountForAllObjects()); EXPECT_TRUE(listField->hasSameFieldCountForAllObjects());
EXPECT_FALSE(listField->empty()); EXPECT_FALSE(listField->empty());
listField->deleteAllChildObjects(); listField->deleteAllChildObjects();
EXPECT_EQ(0, listField->size()); EXPECT_EQ(0u, listField->size());
EXPECT_TRUE(listField->hasSameFieldCountForAllObjects()); EXPECT_TRUE(listField->hasSameFieldCountForAllObjects());
EXPECT_TRUE(listField->empty()); EXPECT_TRUE(listField->empty());
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+4744 -2038
View File
File diff suppressed because it is too large Load Diff
+5836 -10560
View File
File diff suppressed because it is too large Load Diff
+5725 -2411
View File
File diff suppressed because it is too large Load Diff
+6545 -9739
View File
File diff suppressed because it is too large Load Diff