Commit Graph

366 Commits (b4490dfc97b0657ceadd9058cd0d5614d3de9fbc)

Author SHA1 Message Date
Nick Black 415d4b813f
Tight work on unit testing, controlling tty vs output fd (#758)
* Some things go to the FILE* we're provided. Some can only go to a controlling terminal. Check to see if the FILE we're given is a TTY. If not, open up /dev/tty #752.
* term_emit(): fflush() can return EAGAIN. Loop on it to eliminate a rare error on shutdown that particularly affected unit tests (where we start and shut down Notcurses many times in a row).
* sgr poc: check return value of setlocale()
* drone: run all unit tests
* CMake: add some tests using PoCs
* ncneofetch: print even small palettes
4 years ago
nick black c0f12f4623
tester: pass INHIBIT_SETLOCALE|NO_ALTERNATE_SCREEN 4 years ago
nick black dd2b36ce0a
drone: set TERM on debian 4 years ago
nick black 33667df40e
drone: set TERM for fedora 4 years ago
Nick Black d5dca33e00 ncneofetch: don't print (null) for distro_pretty 4 years ago
Nick Black d52ced823c make Wide unit tests sensitive to local irregularities #741 4 years ago
nick black f927af00f2
tester: pass NCOPTION_NO_QUIT_SIGHANDLERS 4 years ago
nick black 354152b48b
Redefine CELL_ALPHA_ in their natural forms
CELL_ALPHA_OPAQUE et al were defined as 0..3, meaning
CELL_ALPHA_SHIFT had to be used to compare them to their
channel representations. Instead, define them in said
representation outright, eliminating the need to shift while
retaining arithmetic properties, and zero initialization for
CELL_ALPHA_OPAQUE. Eliminate CELL_ALPHA_SHIFT #738.
4 years ago
nick black 7ca5a7e82c
ncneofetch: create info plane #550 4 years ago
nick black 5b99ebc9fc
ncplane_puttext(): four more unit tests #691 4 years ago
nick black 6ff0bec2fa
ncplane_puttext: more unit tests, check for spcae before width #691 4 years ago
nick black cfe764bd57
ncplane_puttext() unit test + fix #691 4 years ago
nick black 97517d0473
ncplane_puttext: another test, another bug #691 4 years ago
nick black d1f8b9237d
ncplane_puttext: new unit test, fix breakage #691 4 years ago
nick black 2be041b1f4
Beef up ncplane_puttext() tests, fix a problem #691 4 years ago
nick black b49d1ad838
rewrite all unit tests to use testing_notcurses() #718 4 years ago
nick black a46dcc5fe4
tester: introduce testing_notcurses() #718 4 years ago
nick black 64c4a4be53
unit tests: require utf8 for quadblitter 4 years ago
nick black 8ff0d92ad7
testing-checklist: add LANG=C, needed for debuilder 4 years ago
nick black 59bf168e55
quadblitter: emit ▌, not ▋, you fool #667 4 years ago
nick black d710bb24b2 unit test for quadblitter #667 4 years ago
nick black d69d369304 fill out NCBLIT_2x1 Dualblitter unit test #667 4 years ago
nick black ab4243d9be quadblitter/dualblitter unit test bases 4 years ago
Nick Black 0084dbaa6d
qrcode generalization #699 (#713)
Add convenience function ncplane_home(). Add an ncblitter_e param
to ncplane_qrcode(), and split int maxversion into value-result
int* ymax and int* xmax. Write the actual sizes of the resulting
visual into these parameters. Update the qrcode demo. Add the
qrcode PoC. Update demos to ncplane_home(), where possible.

ncplane_qrcode() now takes an ncblitter_e and two value-result int*s
in the place of a single value int. The final size of the displayed qrcode
is written to *ymax and *xmax. If the code can't fit within the specified
dimensions, an error is returned. Standard rules for pluggable blitters
apply regarding fallback etc. #699
4 years ago
nick black 3936d1b528
adapt callers of ncvisual_geom() 4 years ago
nick black 70183ee283
Rewrite plot tests using C interface #703
The Plot unit tests were reaching directly into the objects,
which meant the implementations couldn't include anything
we didn't want public. This was annoying, so I've changed it.
This required adding ncdplot_sample() and ncuplot_sample(),
which we should have had anyway.
4 years ago
Nick Black 28431914a8
First go at ncplane_puttext() (#690)
Very simple take at ncplane_puttext(), a new function for linebroken text. Also some very basic unit tests. I doubt this works very well yet, but it handles the simplest cases #682. Added nclog(), internal function for logging. #520
4 years ago
nick black b2dcc50606
notcurses_options: fold bools into flags 4 years ago
nick black 2c417ddb0c
yield demo: punch up with polyfills 4 years ago
nick black b648868361
PolyfillOnGlyph unit test fix 4 years ago
nick black 633ef1f76c
add beginnings of yield demo 4 years ago
nick black d73c12be6f
ncvisual_from_plane: argument inversion error #678 4 years ago
nick black 75f458d69a
ncplane_yx: results are relative to bound plane 4 years ago
nick black 96a47de845
merge cell unit tests 4 years ago
nick black a863daf4f6
cell tests: accept short widths for wide chars #229 4 years ago
nick black 0cda775900
metric: use FE_TONEAREST instead of TOWARDZERO #615 4 years ago
nick black 4f5c8ef3d7 eagle/outro support for non-multimedia builds 4 years ago
nick black 2d3fef115e ncfadectx_setup(): remove timespec param #659 4 years ago
nick black fd2bb53f83 fade: more unit tests, verify abort on callback #659 4 years ago
nick black 3deeecdf2e fade: finish out proposed API, basic unit tests #659 4 years ago
nick black 3ff083b73f Fade API: move control of delays into callback 4 years ago
nick black 8793fcd876 c++ Visual: add from_plane constructor, test #654 4 years ago
nick black 6a9bbad91e
Visual C++ constructor test #538 4 years ago
nick black 0331ae4c4c
introduce NCVISUAL_OPTION_BLEND #652 4 years ago
nick black 33318254b2
absorb first ncvisual_decode into ncvisual_from_file() #655 4 years ago
nick black 89ffb6658e
CMake: improvements to testing usability
Replace USE_TESTS with BUILD_TESTING variable already exported by CTest.
Use the CMake 3.17 CMAKE_CTEST_ARGUMENTS to pass "-V" to ctest. #651
4 years ago
nick black 0766007a77
tester: kill off inhibit_alternate_screen #651 4 years ago
nick black e88bc5c04b
Metric tests: observe local customs #650 4 years ago
Nick Black ebcba82d4b
Fully general ncvisual layer (#647)
This represents an essentially complete rewrite of ncvisual and associated code. It had two major goals:

Improve the ncvisual API based off lessons learned, pursuant to the upcoming API freeze. In particular, I wanted to:

decouple ncvisuals from ncplanes. It should be possible to render a ncvisual to multiple planes, with different scaling each time. It should be possible to create an ncvisual without a plane, etc.
normalize the various ways of constructing an ncvisual -- file, memory, plane, etc.
Support multiple blitters, from 7-bit ASCII to Sixel. This required writing the blitters in several cases, and they're not yet in their final implementations (but the API is fine)
I have not yet unified Plots and Visuals, and might not, given that the Plot code works fine. We could at this point implement Plots in terms of Visuals, though -- the blitter backend range has been unified. Sixel is not yet implemented, though it is listed.

There is a new POC tool, blitter. It renders its arguments using all possible blitter+scaling combinations. Another new POC, resize, displays its argument, then resizes it to the screen size and displays that, explicitly making use of ncvisual_resize() rather than a scaling parameter to ncvisual_render().

This also eliminates some memory leaks and bugs we were seeing in trunk, and brings in Sixel scaffolding.

The C++ wrapper will also need patching back up; I cut most of it down while wrestling with this crap, urk.

Closes #638, #562, and #622.
4 years ago
nick black 8971bda0c2 ncpp: stop() resets _instance, add unit test #538 4 years ago