• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nasa / trick / 27163231645

08 Jun 2026 07:56PM UTC coverage: 56.933% (-0.01%) from 56.944%
27163231645

push

github

web-flow
Clang format and perltidy configurations (#2011)

* Initial clang-format

* Update .clang-format

* Update .clang-format

* ci: Adopt style ci

* ci: single-file ci!

* ci: add perl formatting

* Update .clang-format for alignment and brace style

* ci: split test-reports off from CI to account for forks

* add 120 column limit and remove empty lines

* Update makeflag handling

* Add Ubuntu 26 testing

* Switch code-coverage to run on ubuntu-latest

* more fixes for flaky gh actions

* code-coverage: ignore errors

* Update test_client.hh

* Update .clang-format

* Update code-coverage flags

* more simplification

* Update Makefile

* Fix curl deps on rhel and flag setting

* Update ci.yml

* Update ci.yml

* Revert makefile changes

* Update Makefile

* update .gitignores

* Use rockylinux/rockylinux:8 image in CI

* Update Makefile

* Update Makefile.common

* Revert changes made to deal with flaky gh runners

* Always set GTEST_CXXSTD to c++17

* Update clang-format configuration options

* Update clang-format for alignment settings

* Add python format check

* Don't fail if changed files found

* Build and test even if style check fails

* Use ruff preview switch

* move trickops makefile gitignore from top level to directory level

* Update .clang-format

* Only code style

* Update .perltidyrc

* Update .clang-format

* Update .clang-format with input from trick team

* Create directory clang-formats for include sorting

* Update .clang-format

* Update .clang-format

* Insert newline at EOF

12975 of 22790 relevant lines covered (56.93%)

297286.91 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

96.97
/trick_source/sim_services/Message/MessageCout.cpp
1

2
#include "trick/MessageCout.hh"
3
#include "trick/message_type.h"
4

5
#include <sstream>
6

7
Trick::MessageCout::MessageCout() {
218✔
8
    /** By default, this subscriber is enabled when it is created. */
9
    enabled = 1 ;
218✔
10
    color = 1 ;
218✔
11
    name = "cout" ;
218✔
12
}
218✔
13

14
void Trick::MessageCout::update( unsigned int level , std::string header , std::string message ) {
34,155✔
15

16
    /** @par Design Details: */
17
    std::string color_code ;
68,310✔
18

19
    switch (level) {
34,155✔
20
        case MSG_NORMAL :
2,389✔
21
            color_code = "\033[00m" ; // normal
2,389✔
22
            break ;
2,389✔
23
        case MSG_INFO :
90✔
24
            color_code = "\033[32m" ; // green
90✔
25
            break ;
90✔
26
        case MSG_WARNING :
21✔
27
            color_code = "\033[33m" ; // yellow
21✔
28
            break ;
21✔
29
        case MSG_ERROR :
34✔
30
            color_code = "\033[31m" ; // red
34✔
31
            break ;
34✔
32
        case MSG_DEBUG :
357✔
33
            color_code = "\033[36m" ; // cyan
357✔
34
            break ;
357✔
35
        default :
31,264✔
36
            color_code = "\033[00m" ; // normal
31,264✔
37
            break ;
31,264✔
38
    }
39

40
    /** @li Prints the received message to the standard output stream. */
41
    if (enabled && level < 100 ) {
34,155✔
42

43
        // Building the final string in a temporary stream ensures an automic call to cout, which prevents
44
        // multithreaded sims from interleaving header and message elements.
45
        std::ostringstream oss;
34,155✔
46
        if ( color ) {
34,155✔
47
            oss << header << color_code << message << "\033[00m" ;
34,155✔
48
        } else {
49
            oss << header << message ;
×
50
        }
51
        std::cout << oss.str() << std::flush;
34,155✔
52
    }
53
}
34,155✔
54

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc