-
-
Notifications
You must be signed in to change notification settings - Fork 650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to force the use of colors in the terminal? #54
Comments
The reason there are no colors is because of this runtime check - the point is to skip the ANSI color codes (which are textual characters) when the program is not outputting to a normal terminal - like when writing to a file. There are cases where this detection fails and reports that the process is not running in a TTY even if it is - this might happen when the current process is executed from a parent process and stdout is redirected or something similar - this happens with the ninja build system. So something similar is happening in your case - if you don't want to pass that flag each time you could supply your own main (by using the does this help? |
Yes. Thank you for the time. And nice frameworks yours. While Catch is taking about 21 seconds to build and run simple example, yours takes about 2.8 seconds to run the same tests.
|
note that the code you have used from the doctest example contains stuff you might not need - like for example the 3 other defaults and the 1 override. |
./main --force-colors=true
works
Thanks, the |
Defining DOCTEST_CONFIG_COLORS_ANSI is not working, only using
./main --force-colors=true
worksMy project source code files are like these:
doctest_main.cpp
If here on
doctest_main.cpp
or everywhere else I tried, I defined theDOCTEST_CONFIG_COLORS_ANSI
, it does nothing. It keeps not showing any colors. The only way to force color is to call the main application as./main --force-colors=true
.doctest_tests.cpp
project_sources_with_tests.cpp
debug.h
I am running the project through a Sublime Text build system -> shell script -> Makefile:
project.sublime-project
make_run.sh
FIRST_COMMAND_ARGUMENT=$1 if [[ $FIRST_COMMAND_ARGUMENT == "main" ]] then make clean make elif [[ $FIRST_COMMAND_ARGUMENT == "veryclean" ]] then make $FIRST_COMMAND_ARGUMENT make else make clean make $FIRST_COMMAND_ARGUMENT fi wait $!
Makefile
The text was updated successfully, but these errors were encountered: