[SmokeTest] Add SIGINT and SIGSEGV handling
[platform/core/appfw/wgt-backend.git] / src / unit_tests / smoke_utils.cc
index 24f92b3..2ef8402 100644 (file)
@@ -75,6 +75,11 @@ const char kPreloadApps[] = "/usr/apps";
 const char kPreloadManifestDir[] = "/usr/share/packages";
 const char kPreloadIcons[] = "/usr/share/icons";
 
+testing::Environment *env = nullptr;
+void signalHandler(int signum) {
+  env->TearDown();
+  exit(signum);
+}
 
 ci::RequestMode ParseRequestMode(int argc,  char** argv) {
   bo::options_description desc("Available options");
@@ -817,6 +822,7 @@ void UninstallAllAppsInDirectory(bf::path dir, bool is_preload) {
 }
 
 void UninstallAllSmokeApps(ci::RequestMode request_mode) {
+  std::cout << "Uninstalling all smoke apps" << std::endl;
   if (getuid() == 0 && request_mode == ci::RequestMode::GLOBAL) {
     bf::path root_path = kPreloadApps;
     UninstallAllAppsInDirectory(root_path, true);