Commit Graph

22 Commits

Author SHA1 Message Date
nick black
3457ffb59f
FdsAndSubprocs test: use ncplane_putnstr(s) #778 2020-07-09 03:27:41 -04:00
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
2020-07-02 18:03:52 -04:00
nick black
f927af00f2
tester: pass NCOPTION_NO_QUIT_SIGHANDLERS 2020-06-28 05:56:07 -04:00
nick black
b49d1ad838
rewrite all unit tests to use testing_notcurses() #718 2020-06-15 23:58:43 -04:00
nick black
b2dcc50606
notcurses_options: fold bools into flags 2020-06-07 05:08:46 -04:00
nick black
0766007a77
tester: kill off inhibit_alternate_screen #651 2020-05-29 02:30:57 -04:00
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.
2020-05-28 21:16:58 -04:00
nick black
8971bda0c2 ncpp: stop() resets _instance, add unit test #538 2020-05-24 03:34:46 -04:00
nick black
6edc6f098f
streamline unit test common initialization 2020-05-17 07:57:21 -04:00
nick black
1c394dc103 modernize c++ according to clang-tidy-11 2020-05-08 21:42:04 -04:00
nick black
e2a94817e7 tests: lots of NULL->nullptr 2020-05-08 21:42:04 -04:00
nick black
43a685be1e
ncsubproc: update unit tests for exit propagation #554 2020-05-06 19:53:59 -04:00
nick black
c8322e6cb1
ncfdplane: on non-following planes, break out on 0 read 2020-05-02 11:57:38 -04:00
nick black
a23efbb463
rigourize ncsubproc destruction
We need support three distinct paths for destruction of
ncsubprocs: (1) external call to ncsubproc_destroy() while
the subprocess is running, (2) external call to
ncsubproc_destroy() after the subprocess has terminated, and
(3) internal call to ncsubproc_destroy() without any external
call. To do this properly, we always waitid() on the subprocess
in our ncsubproc thread, and do not cancel said thread. This
guarantees that the subprocess has been reaped if the thread
has exited. We throw a pidfd_send_signal() into the thread
prior to the waitid(), because this is safe with pidfds. The
thread reclaims no resources otherwise. ncsubproc_destroy(),
instead, reclaims them, after joining the ncsubproc thread.
It sends SIGKILL before the join, which is once again safe
thanks to pidfds. Resolves #552.
2020-05-02 04:34:37 -04:00
nick black
c9088ff37b
subproc unit test rename 2020-05-02 03:49:16 -04:00
nick black
294e8fd90a
subproc tests: pass outofline_cancelled through as curry 2020-04-28 00:27:07 -04:00
nick black
5a017574f6
ncsubproc tests: don't rely on /etc/ files 2020-04-22 15:55:35 -04:00
nick black
34629688d9
interpret NULL second argument to *_init() as stdout 2020-04-22 12:53:56 -04:00
nick black
3e853f6635
ncsubproc: map new pipe onto stdio #310 2020-04-21 03:51:54 -04:00
nick black
04f90fa1ea
ncsubproc: launch processes, make pipes
link to LWN article in History section of README.md.
2020-04-21 03:33:04 -04:00
nick black
6304bc73e3
tester: better terminal restoration #240 2020-04-21 01:07:45 -04:00
Nick Black
fe8034b5e0
ncfdplane, fileroller PoC, ncfdplane unit tests, qrcodes #24 #514 (#524)
* first draft of ncsubproc spec
* qrcode first draft #24
* demo: add qrcode demo skeleton, entries #24
* qrcode demo #24
* fedora python build changes from @dcantrell
* ncplane_qrcode() works #24
* add some flash to the qrcode demo #24
* drone: use newest builders
* fix up rgb PoC
* drop jungle demo to 100Hz target
* add fd.c
* ncfd skeletons
* more ncfdplane #514
* ncfdp i/o loop
* ncfp: improve uinit test, write core
* firm up ncfdplane #514
* fileroller PoC #514
* ncplane: allow '\n' in stream when scrolling #523
2020-04-20 23:26:41 -04:00