From: Olga Arkhangelskaia <arkholga@tarantool.org>
To: tarantool-patches@dev.tarantool.org
Cc: alexander.turenko@tarantool.org
Subject: [Tarantool-patches] [PATCH 1/2] test: add libisatty to test local console
Date: Wed, 10 Jun 2020 12:43:53 +0300 [thread overview]
Message-ID: <20200610094354.31831-2-arkholga@tarantool.org> (raw)
In-Reply-To: <20200610094354.31831-1-arkholga@tarantool.org>
From: Olga <arkholga@tarantool.org>
Local console is impossible to test within pipe, tatantool -i.
isatty lib was added to overcome isatty check and test local console.
Hack by Alexandr Turenko.
---
test/CMakeLists.txt | 8 ++++++++
test/isatty.c | 5 +++++
2 files changed, 13 insertions(+)
create mode 100644 test/isatty.c
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 9b5df7dc5..7894e1651 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -67,3 +67,11 @@ endif()
# Disable connector_c for 1.6
#add_subdirectory(connector_c)
+
+# Build a library with isatty() that always returns 1.
+#
+# It is needed to test the local tarantool console. Consider an
+# example:
+#
+# echo 42 | LD_PRELOAD=test/libisatty.so ./src/tarantool
+add_library(isatty SHARED isatty.c)
diff --git a/test/isatty.c b/test/isatty.c
new file mode 100644
index 000000000..f716d2903
--- /dev/null
+++ b/test/isatty.c
@@ -0,0 +1,5 @@
+int
+isatty(int fd)
+{
+ return 1;
+}
--
2.20.1 (Apple Git-117)
next prev parent reply other threads:[~2020-06-10 9:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-10 9:43 [Tarantool-patches] [PATCH v2 0/2] console: support of backslash Olga Arkhangelskaia
2020-06-10 9:43 ` Olga Arkhangelskaia [this message]
2020-06-11 16:47 ` [Tarantool-patches] [PATCH 1/2] test: add libisatty to test local console Igor Munkin
2020-06-10 9:43 ` [Tarantool-patches] [PATCH 2/2] console: add line carrying backslash Olga Arkhangelskaia
2020-06-11 16:48 ` Igor Munkin
2020-06-16 14:39 ` Alexander Turenko
2020-06-11 16:49 ` [Tarantool-patches] [PATCH v2 0/2] console: support of backslash Igor Munkin
2020-07-08 18:42 ` Alexander Turenko
2020-07-09 6:01 ` Olga Arkhangelskaia
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200610094354.31831-2-arkholga@tarantool.org \
--to=arkholga@tarantool.org \
--cc=alexander.turenko@tarantool.org \
--cc=tarantool-patches@dev.tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH 1/2] test: add libisatty to test local console' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox