Giter Club home page Giter Club logo

ytc's Introduction

YTC

Actions Status License: MIT

YTC (a Yaml Template Class example) is an yaml-cpp example project. The main goal of this project is to show a possible strategy to convert user data types using yaml-cpp.

This project build with following tools:

How to try it out

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

To build YTC you need the following requirements:

  • A C++ compiler such as Gcc >= 7.0.0, Clang >= 5.0.0 or Apple Clang >= 10.0.0
  • CMake 3.11 or later
  • Conan decentralized package manager with a client-server architecture

To enable test coverage reports you need the following requirements:

  • lcov
  • genhtml

For project dependencies list see conanfile.txt bundled with this project.

If you're using Ubuntu, you can install the required packages this way:

sudo apt install gcc cmake build-essential

On macOS you most likely have a compiler so you'll need only cmake:

brew install cmake

Please note that specific versions of libraries and programs at the time of reading this guide may vary. The following dependencies is recommended install using pip:

  • conan

They can be installed using pip as follows:

pip install -r requirements.txt

Building

First you'll need clone the project and fetch its modules:

git clone https://github.com/sergeyklay/ytc
cd ytc

Then build project as follows:

cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug
cmake --build build

Running the tests

Tests expect YTC_TESTS_ROOT environment variable to use fixtures. This variable should point to the tests directory root. Set this variable and run the tests as follows:

export YTC_TESTS_ROOT=$(pwd)/tests
cmake --build build --target check

Generate HTML code coverage report

Follow these steps:

  1. Configure with code coverage instrumentation enabled -DCODE_COVERAGE=ON
  2. Build project
  3. Execute the tests to generate the coverage data
  4. Generate and customize reports as follows:
# Create lcov report
lcov --directory build --capture --output-file ./build/coverage.info

# Filter out extra files
lcov \
    --remove ./build/coverage.info \
    '/usr/*'                       \
    "${HOME}"'/.conan/*'           \
    '*/tests/*'                    \
    --output-file ./build/coverage.info

# Output coverage data for debugging (Optional)
lcov --list ./build/coverage.info

# Create a directory to store HTML report 
mkdir ./build/coverage

# Generate HTML report
genhtml ./build/coverage.info --output-directory ./build/coverage

Further Reading

License

This project is licensed under the MIT License - see the LICENSE file for details.

ytc's People

Contributors

sergeyklay avatar snyk-bot avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

lrodriguez15

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.