Giter Site home page Giter Site logo

aos_core_iam_cpp's Introduction

ci codecov

Identity and Access Manager(IAM)

Prepare build environment

sudo apt install lcov libsofthsm2 libsystemd-dev
pip install conan

Build for host

To make a build for host please run:

./host_build.sh

It installs all external dependencies to conan, creates ./build directory and builds the manager with unit tests and coverage calculation target.

It is also possible to customize the build using different cmake options:

cd ${BUILD_DIR}
conan install ../conan/ --output-folder . --settings=build_type=Debug --build=missing
cmake .. -DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmake -DWITH_TEST=ON -DCMAKE_BUILD_TYPE=Debug

Cmake options:

Option Description
WITH_TEST creates unit tests target
WITH_COVERAGE creates coverage calculation target
WITH_DOC creates documentation target

Options should be set to ON or OFF value.

Cmake variables:

Variable Description
CMAKE_BUILD_TYPE Release, Debug, RelWithDebInfo, MinSizeRel
CMAKE_INSTALL_PREFIX overrides default install path

Run unit tests

Build and run:

./host_build.sh
cd ${BUILD_DIR}
make test

Check coverage

lcov utility shall be installed on your host to run this target:

sudo apt install lcov

Build and run:

./host_build.sh
cd ${BUILD_DIR}
make coverage

The overall coverage rate will be displayed at the end of the coverage target output:

...
Overall coverage rate:
  lines......: 94.7% (72 of 76 lines)
  functions..: 100.0% (39 of 39 functions)

Detailed coverage information can be find by viewing ./coverage/index.html file in your browser.

Generate documentation

doxygen package should be installed before generation the documentations:

sudo apt install doxygen

host_build.sh tool doesn't generate documentation. User should run the following commands to do that:

cd ${BUILD_DIR}
conan install ../conan/ --output-folder . --settings=build_type=Debug --build=missing
cmake .. -DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmake -DWITH_DOC=ON
make doc

The result documentation is located in ${BUILD_DIR}/doc folder. And it can be viewed by opening ./doc/html/index.html file in your browser.

Install libraries

The default install path can be overridden by setting CMAKE_INSTALL_PREFIX variable.

Configure example with user defined install prefix:

cd ${BUILD_DIR}
conan install ../conan/ --output-folder . --settings=build_type=Release --build=missing
cmake .. -DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmake -DCMAKE_INSTALL_PREFIX=/my/location

Install:

cd ${BUILD_DIR}
make  install

Development tools

The following tools are used for code formatting and analyzing:

Tool Description Configuration Link
clang-format used for source code formatting .clang-format https://clang.llvm.org/docs/ClangFormat.html
cmake-format used for formatting cmake files .cmake-format https://github.com/cheshirekow/cmake_format
cppcheck used for static code analyzing https://cppcheck.sourceforge.io/

aos_core_iam_cpp's People

Contributors

al1img avatar mlohvynenko avatar mykola-kobets-epam avatar klogg avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.