Commit Graph

25 Commits (99abcb5f0754fd946f3ed97beb08d4b26693d8e2)

Author SHA1 Message Date
nick black d4959eab13
fd unit tests: kill deadlock #1100 4 years ago
nick black e1e6c6a272
fd tests: use lock guards #1100 4 years ago
nick black 227738a8e5
SubprocAndFds tests: tighten up locking 4 years ago
nick black 3457ffb59f
FdsAndSubprocs test: use ncplane_putnstr(s) #778 4 years ago
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 f927af00f2
tester: pass NCOPTION_NO_QUIT_SIGHANDLERS 4 years ago
nick black b49d1ad838
rewrite all unit tests to use testing_notcurses() #718 4 years ago
nick black b2dcc50606
notcurses_options: fold bools into flags 4 years ago
nick black 0766007a77
tester: kill off inhibit_alternate_screen #651 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
nick black 6edc6f098f
streamline unit test common initialization 4 years ago
nick black 1c394dc103 modernize c++ according to clang-tidy-11 4 years ago
nick black e2a94817e7 tests: lots of NULL->nullptr 4 years ago
nick black 43a685be1e
ncsubproc: update unit tests for exit propagation #554 4 years ago
nick black c8322e6cb1
ncfdplane: on non-following planes, break out on 0 read 4 years ago
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.
4 years ago
nick black c9088ff37b
subproc unit test rename 4 years ago
nick black 294e8fd90a
subproc tests: pass outofline_cancelled through as curry 4 years ago
nick black 5a017574f6
ncsubproc tests: don't rely on /etc/ files 4 years ago
nick black 34629688d9
interpret NULL second argument to *_init() as stdout 4 years ago
nick black 3e853f6635
ncsubproc: map new pipe onto stdio #310 4 years ago
nick black 04f90fa1ea
ncsubproc: launch processes, make pipes
link to LWN article in History section of README.md.
4 years ago
nick black 6304bc73e3
tester: better terminal restoration #240 4 years ago
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
4 years ago