clang-tidy: Enable cppcoreguidelines-explicit-virtual-functions

Adds override (introduced in C++11) to overridden virtual functions
and removes virtual from those functions as it is not required.

virtual on non base class implementations was used to help indicate
to the user that a function was virtual. C++ compilers did not use
the presence of this to signify an overridden function.

In C++11 override and final keywords were introduced to allow
overridden functions to be marked appropriately. Their presence
allows compilers to verify that an overridden function correctly
overrides a base class implementation.

This can be useful as compilers can generate a compile time error
when:
- The base class implementation function signature changes.
- The user has not created the override with the correct signature.

Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: I428f69c11b071a1a50e7f93f7bcc29c8300dcddb
diff --git a/.clang-tidy b/.clang-tidy
index a6c9805..07ab870 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -195,6 +195,7 @@
 clang-analyzer-webkit.RefCntblBaseVirtualDtor,
 cppcoreguidelines-avoid-goto,
 cppcoreguidelines-c-copy-assignment-signature,
+cppcoreguidelines-explicit-virtual-functions,
 cppcoreguidelines-narrowing-conversions,
 cppcoreguidelines-no-malloc,
 cppcoreguidelines-prefer-member-initializer,
diff --git a/src/activation.hpp b/src/activation.hpp
index f30ba9f..b7f9cbc 100644
--- a/src/activation.hpp
+++ b/src/activation.hpp
@@ -53,7 +53,7 @@
         enableRebootGuard();
     }
 
-    ~ActivationBlocksTransition()
+    ~ActivationBlocksTransition() override
     {
         disableRebootGuard();
     }
diff --git a/test/mocked_activation_listener.hpp b/test/mocked_activation_listener.hpp
index cbef46d..cb8c939 100644
--- a/test/mocked_activation_listener.hpp
+++ b/test/mocked_activation_listener.hpp
@@ -7,7 +7,7 @@
 class MockedActivationListener : public ActivationListener
 {
   public:
-    virtual ~MockedActivationListener() = default;
+    ~MockedActivationListener() override = default;
 
     MOCK_METHOD2(onUpdateDone, void(const std::string& versionId,
                                     const std::string& psuInventoryPath));
diff --git a/test/mocked_association_interface.hpp b/test/mocked_association_interface.hpp
index 0ad4796..ff25861 100644
--- a/test/mocked_association_interface.hpp
+++ b/test/mocked_association_interface.hpp
@@ -7,7 +7,7 @@
 class MockedAssociationInterface : public AssociationInterface
 {
   public:
-    virtual ~MockedAssociationInterface() = default;
+    ~MockedAssociationInterface() override = default;
 
     MOCK_METHOD1(createActiveAssociation, void(const std::string& path));
     MOCK_METHOD1(addFunctionalAssociation, void(const std::string& path));
diff --git a/test/mocked_utils.hpp b/test/mocked_utils.hpp
index 71a4f77..219e25f 100644
--- a/test/mocked_utils.hpp
+++ b/test/mocked_utils.hpp
@@ -8,7 +8,7 @@
 class MockedUtils : public UtilsInterface
 {
   public:
-    virtual ~MockedUtils() = default;
+    ~MockedUtils() override = default;
 
     MOCK_CONST_METHOD1(getPSUInventoryPath,
                        std::vector<std::string>(sdbusplus::bus_t& bus));
diff --git a/test/test_activation.cpp b/test/test_activation.cpp
index 2e93672..97b8ff3 100644
--- a/test/test_activation.cpp
+++ b/test/test_activation.cpp
@@ -33,7 +33,7 @@
             .WillByDefault(Return(any(PropertyType(std::string("TestModel")))));
         ON_CALL(mockedUtils, isAssociated(_, _)).WillByDefault(Return(false));
     }
-    ~TestActivation()
+    ~TestActivation() override
     {
         utils::freeUtils();
     }
diff --git a/test/test_item_updater.cpp b/test/test_item_updater.cpp
index 6a0a08e..db1db8e 100644
--- a/test/test_item_updater.cpp
+++ b/test/test_item_updater.cpp
@@ -31,7 +31,7 @@
             .WillByDefault(Return(any(PropertyType(true))));
     }
 
-    ~TestItemUpdater()
+    ~TestItemUpdater() override
     {
         utils::freeUtils();
     }
diff --git a/test/test_version.cpp b/test/test_version.cpp
index e0e8532..ad3a88f 100644
--- a/test/test_version.cpp
+++ b/test/test_version.cpp
@@ -35,7 +35,7 @@
             throw "Failed to create temp dir";
         }
     }
-    ~TestVersion()
+    ~TestVersion() override
     {
         fs::remove_all(tmpDir);
     }