Skip to content

Commit

Permalink
[cmake] -v on failing notcurses-input runs
Browse files Browse the repository at this point in the history
  • Loading branch information
dankamongmen committed Jan 8, 2022
1 parent 925982b commit 6997c1f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
19 changes: 8 additions & 11 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,14 @@ steps:
- cd build
- cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_STATIC=off -DUSE_GPM=on -DUSE_QRCODEGEN=on -DDFSG_BUILD=on
- make -j2
- ./notcurses-input < /dev/null
- env NOTCURSES_LOGLEVEL=7 ./notcurses-input < notcurses-input
- ./notcurses-input < notcurses-input
#- ./notcurses-info
#- ctest --output-on-failure
#- make install
#- ldconfig
#- cd ../cffi
#- LDFLAGS=-L/usr/local/lib CFLAGS=-I/usr/local/include python3 setup.py sdist build install
#- env LD_LIBRARY_PATH=/usr/local/lib ./notcurses-pydemo > /dev/null
#- env LD_LIBRARY_PATH=/usr/local/lib ./ncdirect-pydemo > /dev/null
- ./notcurses-info
- ctest --output-on-failure
- make install
- ldconfig
- cd ../cffi
- LDFLAGS=-L/usr/local/lib CFLAGS=-I/usr/local/include python3 setup.py sdist build install
- env LD_LIBRARY_PATH=/usr/local/lib ./notcurses-pydemo > /dev/null
- env LD_LIBRARY_PATH=/usr/local/lib ./ncdirect-pydemo > /dev/null
---
kind: pipeline
type: docker
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -874,12 +874,12 @@ add_test(
# provide an empty source
add_test(
NAME input-devnull
COMMAND sh -c "./notcurses-input < /dev/null"
COMMAND sh -c "./notcurses-input -v < /dev/null"
)
# provide a binary file
add_test(
NAME input-binary
COMMAND sh -c "./notcurses-input < notcurses-input"
COMMAND sh -c "./notcurses-input -v < notcurses-input"
)
# provide an ASCII file
add_test(
Expand Down
5 changes: 0 additions & 5 deletions src/lib/in.c
Original file line number Diff line number Diff line change
Expand Up @@ -2381,9 +2381,7 @@ internal_get(inputctx* ictx, const struct timespec* ts, ncinput* ni){
return (uint32_t)-1;
}
pthread_mutex_lock(&ictx->ilock);
fprintf(stderr, "IVALID: %u EOF: %u IREAD: %u\n", ictx->ivalid, ictx->stdineof, ictx->iread);
while(!ictx->ivalid){
fprintf(stderr, "WHILE IVALID: %u EOF: %u IREAD: %u\n", ictx->ivalid, ictx->stdineof, ictx->iread);
if(ictx->stdineof){
pthread_mutex_unlock(&ictx->ilock);
logwarn("read eof on stdin");
Expand All @@ -2394,9 +2392,7 @@ fprintf(stderr, "WHILE IVALID: %u EOF: %u IREAD: %u\n", ictx->ivalid, ictx->stdi
return NCKEY_EOF;
}
if(ts == NULL){
fprintf(stderr, "WAITING\n");
pthread_cond_wait(&ictx->icond, &ictx->ilock);
fprintf(stderr, "DONE WAITING\n");
}else{
int r = pthread_cond_timedwait(&ictx->icond, &ictx->ilock, ts);
if(r == ETIMEDOUT){
Expand All @@ -2416,7 +2412,6 @@ fprintf(stderr, "DONE WAITING\n");
}
}
id = ictx->inputs[ictx->iread].id;
fprintf(stderr, "GOT ID 0x%08x IREAD: %u\n", id, ictx->iread);
if(ni){
memcpy(ni, &ictx->inputs[ictx->iread], sizeof(*ni));
if(notcurses_ucs32_to_utf8(&ni->id, 1, (unsigned char*)ni->utf8, sizeof(ni->utf8)) < 0){
Expand Down

0 comments on commit 6997c1f

Please sign in to comment.