mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 01:29:05 -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
|
# SYNOPSIS
|
||||||
|
|
||||||
**notcurses-tester** [**-p datadir**]
|
**notcurses-tester** [**-p datadir**] [**-l**]
|
||||||
|
|
||||||
# DESCRIPTION
|
# DESCRIPTION
|
||||||
|
|
||||||
@ -18,7 +18,12 @@ if these are in an irregular location, supply **-p**.
|
|||||||
|
|
||||||
# OPTIONS
|
# OPTIONS
|
||||||
|
|
||||||
|
**-p** ***path***: Look in the specified ***path*** for data files.
|
||||||
|
|
||||||
|
**-l**: Enable all possible diagnostics/logging.
|
||||||
|
|
||||||
# NOTES
|
# NOTES
|
||||||
|
|
||||||
Valid **TERM** and **LANG** environment variables are necessary for
|
Valid **TERM** and **LANG** environment variables are necessary for
|
||||||
**notcurses-tester**'s correct operation.
|
**notcurses-tester**'s correct operation.
|
||||||
|
|
||||||
|
@ -140,6 +140,8 @@ highcontrast(uint32_t bchannel){
|
|||||||
}
|
}
|
||||||
|
|
||||||
// wants coordinates within the sprixel, not absolute
|
// 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
|
static void
|
||||||
paint_sprixel(const ncplane* p, const nccell* vis, struct crender* crender,
|
paint_sprixel(const ncplane* p, const nccell* vis, struct crender* crender,
|
||||||
int y, int x){
|
int y, int x){
|
||||||
|
@ -12,13 +12,14 @@
|
|||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <langinfo.h>
|
#include <langinfo.h>
|
||||||
|
|
||||||
static const char* datadir = NOTCURSES_SHARE;
|
const char* datadir = NOTCURSES_SHARE;
|
||||||
|
ncloglevel_e loglevel = NCLOGLEVEL_SILENT;
|
||||||
|
|
||||||
auto testing_notcurses() -> struct notcurses* {
|
auto testing_notcurses() -> struct notcurses* {
|
||||||
notcurses_options nopts{};
|
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.
|
// 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;
|
nopts.flags = NCOPTION_SUPPRESS_BANNERS | NCOPTION_NO_ALTERNATE_SCREEN;
|
||||||
auto nc = notcurses_init(&nopts, nullptr);
|
auto nc = notcurses_init(&nopts, nullptr);
|
||||||
return nc;
|
return nc;
|
||||||
@ -39,6 +40,8 @@ handle_opts(const char** argv){
|
|||||||
inarg = false;
|
inarg = false;
|
||||||
}else if(strcmp(*argv, "-p") == 0){
|
}else if(strcmp(*argv, "-p") == 0){
|
||||||
inarg = true;
|
inarg = true;
|
||||||
|
}else if(strcmp(*argv, "-l") == 0){
|
||||||
|
loglevel = NCLOGLEVEL_TRACE;
|
||||||
}
|
}
|
||||||
++argv;
|
++argv;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user