From owner-freebsd-hackers@freebsd.org Sun Apr 18 08:17:15 2021 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CAD985DFD26 for ; Sun, 18 Apr 2021 08:17:15 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FNN8p16yQz4sjK; Sun, 18 Apr 2021 08:17:13 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (v-critter.freebsd.dk [192.168.55.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by phk.freebsd.dk (Postfix) with ESMTPS id 472B78928F; Sun, 18 Apr 2021 08:17:06 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.16.1/8.16.1) with ESMTPS id 13I8H5hV076860 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 18 Apr 2021 08:17:06 GMT (envelope-from phk@critter.freebsd.dk) Received: (from phk@localhost) by critter.freebsd.dk (8.16.1/8.16.1/Submit) id 13I8H33q076857; Sun, 18 Apr 2021 08:17:03 GMT (envelope-from phk) To: Enji Cooper cc: Gleb Popov , Yoshihiro Ota , freebsd-hackers Subject: Re: How do I write test cases for interactive commands? In-reply-to: From: "Poul-Henning Kamp" References: <20210414190252.69d4bb503fafc73ca1721eb2@j.email.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <76855.1618733822.1@critter.freebsd.dk> Content-Transfer-Encoding: quoted-printable Date: Sun, 18 Apr 2021 08:17:03 +0000 Message-ID: <76856.1618733823@critter.freebsd.dk> X-Rspamd-Queue-Id: 4FNN8p16yQz4sjK X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of phk@critter.freebsd.dk designates 130.225.244.222 as permitted sender) smtp.mailfrom=phk@critter.freebsd.dk X-Spamd-Result: default: False [-1.99 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[phk]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.dk]; RBL_DBL_DONT_QUERY_IPS(0.00)[130.225.244.222:from]; SPAMHAUS_ZRD(0.00)[130.225.244.222:from:127.0.2.255]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.989]; RBL_SENDERSCORE_FAIL(0.00)[130.225.244.222:server fail]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[phk@phk.freebsd.dk,phk@critter.freebsd.dk]; SUBJECT_ENDS_QUESTION(1.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:1835, ipnet:130.225.0.0/16, country:EU]; MIME_TRACE(0.00)[0:+]; FROM_NEQ_ENVFROM(0.00)[phk@phk.freebsd.dk,phk@critter.freebsd.dk]; MAILMAN_DEST(0.00)[freebsd-hackers] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Technical discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Apr 2021 08:17:15 -0000 -------- Enji Cooper writes: > > Take a look at LLVM testing infrastructure and specifically the = > llvm-lit > > tool. > > Does their test infrastructure leverage GoogleTest? If so, then the bulk= = > majority of the work would just be integrating it into Kyua. > Cheers, > -Enji Given that pretty much any software to come out of Google is usually pretty overweight, in particular on dependencies: In the V(arnish)Test tool we built a facility for interactive and curses-based tests using teken, (which we got from FreeBSD): https://github.com/vtest/VTest The code for that sub-part lives in: https://github.com/vtest/VTest/blob/master/src/vtc_process.c Here is a typical test-case using it: https://github.com/varnishcache/varnish-cache/blob/master/bin/varnishtest= /tests/u00008.vtc The verbose output from that test can be seen here: http://phk.freebsd.dk/misc/u00008.txt V(arnish)Test is a modular program, and if you leave out all the HTTP related modules, and substitute 'sbuf' for 'vsb', and "TAILQ" for "VT= AILQ" it would fit nicely into FreeBSD. -- = Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe = Never attribute to malice what can adequately be explained by incompetence= .