## Compiler flags, depending on the build type #################################
+MESSAGE(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
SET(CMAKE_C_FLAGS_PROFILING "-g -O0 -pg")
SET(CMAKE_CXX_FLAGS_PROFILING "-g -std=c++0x -O0 -pg")
SET(CMAKE_C_FLAGS_DEBUG "-g -O0 -ggdb")
SET(CMAKE_CXX_FLAGS_CCOV "-g -std=c++0x -O2 --coverage")
ADD_DEFINITIONS("-fPIC") # Position Independent Code
-ADD_DEFINITIONS("-Werror") # Make all warnings into errors.
+ADD_DEFINITIONS("-Werror") # Make all warnings into errors
ADD_DEFINITIONS("-Wall") # Generate all warnings
ADD_DEFINITIONS("-Wextra") # Generate even more extra warnings
+ADD_DEFINITIONS("-pedantic") # Be pedantic
+ADD_DEFINITIONS("-pedantic-errors") # Make pedantic warnings into errors
## Subdirectories ##############################################################
INSTALL(FILES ${CMAKE_BINARY_DIR}/security-containers.pc
DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
-INSTALL(FILES ${SERVER_FOLDER}/config/.daemon.json
+INSTALL(FILES ${SERVER_FOLDER}/config/daemon.json
DESTINATION /etc/security-containers/config/)
INSTALL(FILES ${SERVER_FOLDER}/config/libvirt-config/xminimal.xml
%files
%attr(755,root,root) %{_bindir}/security-containers-server
-%config %attr(644,root,root) /etc/security-containers/config/.daemon.json
+%config %attr(644,root,root) /etc/security-containers/config/daemon.json
%config %attr(400,root,root) /etc/security-containers/config/libvirt-config/*.xml
%prep
%build
%cmake . -DVERSION=%{version} \
- -DCMAKE_BUILD_TYPE=%{?build_type:%build_type}%{!?build_type:RELEASE} \
- -DCMAKE_VERBOSE_MAKEFILE=ON
-make %{?jobs:-j%jobs}
+ -DCMAKE_BUILD_TYPE=%{?build_type:%build_type}%{!?build_type:RELEASE}
+make -k %{?jobs:-j%jobs}
%install
%make_install
writeSubObj(obj, name, #name);
/**
- @breief Override this abstract class to enable reading/writing a class members from/to JSON
+ @brief Override this abstract class to enable reading/writing a class members from/to JSON
format. Use the macros above to define config class. For example:
struct Foo : public ConfigurationBase
/**
* Parse config object from a string.
* This method throws ConfigException when fails.
- * @param string JSON string to be parsed
+ * @param str JSON string to be parsed
*/
void parseStr(const std::string& str);
/**
* Write cofig object to a file (in JSON format).
* This method throws ConfigException when fails.
- * @return path Target file path
+ * @param path Target file path
*/
void saveToFile(const std::string& path) const;
*/
struct ServerException: public std::runtime_error {
ServerException(const std::string& mess = "Security Containers Server Exception"):
- std::runtime_error(mess) {};
+ std::runtime_error(mess) {}
};
/**
*/
struct ConnectionException: public ServerException {
ConnectionException(const std::string& mess = "Security Containers Connection Exception"):
- ServerException(mess) {};
+ ServerException(mess) {}
};
/**
*/
struct DomainOperationException: public ServerException {
DomainOperationException(const std::string& mess = "Security Containers Domain Operation Exception"):
- ServerException(mess) {};
+ ServerException(mess) {}
};
/**
*/
struct ConfigException: public ServerException {
ConfigException(const std::string& mess = "Security Containers Configuration Exception"):
- ServerException(mess) {};
+ ServerException(mess) {}
};
}
LOGE("Failed to open connection to lxc://");
throw ConnectionException();
}
-};
+}
void Container::disconnect()
LOGE("Error during unconnecting from libvirt");
};
mVir = NULL;
-};
+}
void Container::start()
LOGE("Failed to start the container");
throw DomainOperationException();
}
-};
+}
void Container::stop()
LOGE("Error during domain stopping");
throw DomainOperationException();
}
-};
+}
void Container::shutdown()
LOGE("Error during domain defining");
throw DomainOperationException();
}
-};
+}
void Container::undefine()
}
mDom = NULL;
-};
+}
void Container::suspend()
return state;
}
-} // namespace security_containers
\ No newline at end of file
+} // namespace security_containers
*/
-#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE Main
-#include <boost/test/unit_test.hpp>
+#include "ut.hpp"
* @brief Unit test of ConfigurationBase
*/
+#include "ut.hpp"
#include "scs-configuration.hpp"
-#define BOOST_TEST_DYN_LINK
-#include <boost/test/unit_test.hpp>
-
using namespace security_containers;
BOOST_AUTO_TEST_SUITE(ConfigSuite)
* @brief Unit tests of the Container class
*/
+#include "ut.hpp"
#include "scs-container.hpp"
#include "scs-exception.hpp"
#include <memory>
-#define BOOST_TEST_DYN_LINK
-#include <boost/test/unit_test.hpp>
-
BOOST_AUTO_TEST_SUITE(ContainerSuite)
--- /dev/null
+/*
+ * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Bumjin Im <bj.im@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+/**
+ * @file ut.hpp
+ * @author Piotr Bartosiewicz (p.bartosiewi@partner.samsung.com)
+ * @brief Common unit tests include file
+ */
+
+#ifndef SECURITY_CONTAINERS_UT_HPP
+#define SECURITY_CONTAINERS_UT_HPP
+
+#define BOOST_TEST_DYN_LINK
+#include <boost/test/unit_test.hpp>
+
+#endif //SECURITY_CONTAINERS_UT_HPP