mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
notcurses-tester: accept -l to enable all logging
This commit is contained in:
parent
dc87bd7c79
commit
e29701cac3
@ -8,7 +8,7 @@ notcurses-tester - Notcurses unit testing
|
||||
|
||||
# SYNOPSIS
|
||||
|
||||
**notcurses-tester** [**-p datadir**]
|
||||
**notcurses-tester** [**-p datadir**] [**-l**]
|
||||
|
||||
# DESCRIPTION
|
||||
|
||||
@ -18,7 +18,12 @@ if these are in an irregular location, supply **-p**.
|
||||
|
||||
# OPTIONS
|
||||
|
||||
**-p** ***path***: Look in the specified ***path*** for data files.
|
||||
|
||||
**-l**: Enable all possible diagnostics/logging.
|
||||
|
||||
# NOTES
|
||||
|
||||
Valid **TERM** and **LANG** environment variables are necessary for
|
||||
**notcurses-tester**'s correct operation.
|
||||
|
||||
|
@ -140,6 +140,8 @@ highcontrast(uint32_t bchannel){
|
||||
}
|
||||
|
||||
// wants coordinates within the sprixel, not absolute
|
||||
// FIXME if plane is not wholly on-screen, probably need to toss plane,
|
||||
// at least for this rendering cycle
|
||||
static void
|
||||
paint_sprixel(const ncplane* p, const nccell* vis, struct crender* crender,
|
||||
int y, int x){
|
||||
|
@ -12,13 +12,14 @@
|
||||
#include <filesystem>
|
||||
#include <langinfo.h>
|
||||
|
||||
static const char* datadir = NOTCURSES_SHARE;
|
||||
const char* datadir = NOTCURSES_SHARE;
|
||||
ncloglevel_e loglevel = NCLOGLEVEL_SILENT;
|
||||
|
||||
auto testing_notcurses() -> struct notcurses* {
|
||||
notcurses_options nopts{};
|
||||
// FIXME get loglevel from command line. enabling it by default leads to
|
||||
// get loglevel from command line. enabling it by default leads to
|
||||
// more confusion than useful information, so leave it off by default.
|
||||
//nopts.loglevel = NCLOGLEVEL_TRACE;
|
||||
nopts.loglevel = loglevel;
|
||||
nopts.flags = NCOPTION_SUPPRESS_BANNERS | NCOPTION_NO_ALTERNATE_SCREEN;
|
||||
auto nc = notcurses_init(&nopts, nullptr);
|
||||
return nc;
|
||||
@ -39,6 +40,8 @@ handle_opts(const char** argv){
|
||||
inarg = false;
|
||||
}else if(strcmp(*argv, "-p") == 0){
|
||||
inarg = true;
|
||||
}else if(strcmp(*argv, "-l") == 0){
|
||||
loglevel = NCLOGLEVEL_TRACE;
|
||||
}
|
||||
++argv;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user