< Summary - calculator library documentation coverage (Linux)

Information
Class: /home/runner/work/cpp-cmake-ctest-template/cpp-cmake-ctest-template/src/calculatorapp/src/calculatorapp.cpp
Assembly: Default
File(s): /home/runner/work/cpp-cmake-ctest-template/cpp-cmake-ctest-template/src/calculatorapp/src/calculatorapp.cpp
Line coverage
50%
Covered lines: 1
Uncovered lines: 1
Coverable lines: 2
Total lines: 35
Line coverage: 50%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100 09/30/2026 - 03:05:56 Line coverage: 50% (1/2) Total lines: 35

File(s)

/home/runner/work/cpp-cmake-ctest-template/cpp-cmake-ctest-template/src/calculatorapp/src/calculatorapp.cpp

#LineLine coverage
 11/**
 2 * @file calculatorapp.cpp
 3 * @brief A simple program to demonstrate the usage of the calculator library.
 4 *
 5 * Reads one infix expression from standard input, parses and evaluates it
 6 * with Coruh::Calculator::ExpressionParser (library code, unit tested under
 7 * src/tests/calculator), and prints the result. All expression parsing logic
 8 * lives in the calculator library, not here, so it can be unit tested.
 9 */
 10
 11// Standard Libraries
 12#include <iostream>
 13#include <stdexcept>
 14#include <string>
 15
 16#include "../../calculator/header/expressionParser.h"
 17
 18using namespace Coruh::Calculator;
 19
 020int main() {
 21    std::string infix;
 22
 23    std::cout << "Enter an infix expression: ";
 24    std::getline(std::cin, infix);
 25
 26    try {
 27        double result = ExpressionParser::evaluateInfix(infix);
 28        std::cout << "Result: " << result << std::endl;
 29    } catch(const std::invalid_argument& e) {
 30        std::cerr << "Error: " << e.what() << std::endl;
 31        return 1;
 32    }
 33
 34    return 0;
 35}

Methods/Properties