From owner-freebsd-testing@freebsd.org Wed Feb 27 19:46:15 2019 Return-Path: Delivered-To: freebsd-testing@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49A0215030B8 for ; Wed, 27 Feb 2019 19:46:15 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35E538CA35; Wed, 27 Feb 2019 19:46:14 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x42c.google.com with SMTP id d25so8495300pfn.8; Wed, 27 Feb 2019 11:46:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=6GXDeQd3OSc/f8qyJrn6gf8cNbPfgQRtWekPysF7lBM=; b=e7OScNnZ+dxJU5UXt0/+fF0tSs/ocQ9ahdd3147TE7XGDNP1INvgZgmabNpqlGreWG z2NibKv7ku2AbM1rgh5ZbwZ2oKSHHjYxaxJYmJba1tzqDWpnk0k0u6ssx6R0knDFD+Yk 29UZj3dDdzjJvPO8PmbOytLLcNLGW1Vn4l1k53MfVlyOB9M1hqqL98YITFWqfTee2YeE Y9hZTFXIfr7rBxDU4LXwqpWWgYfb0rcrENlItSBigDrXIyL4ij8bAb4dNJ3RnOGDi5+h gU5juknveiZV6Yx5hX7xrxeCiGekvtrSQSvec89b+Ttzcqqy2xhJeDZo4ILkH44BIKDJ XCvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=6GXDeQd3OSc/f8qyJrn6gf8cNbPfgQRtWekPysF7lBM=; b=ZwzCFklwtQd7iHnJo4d4qwy/D1KpaiQ+oXgOmSrWdJ8opYFeek1nQaHhv3QcVJISqB KcakAaccaBuS5+IDLtpIP3ti2w05YYsjp4F1Wyd2Cwa0CaTU2ykK5Ny6hIu/RhRt9/Zz qJt3pQM6PDOy/+Nwim6irORT7X4BK9JE7iFrGqYBomo7dXE7qH4vQKJx/mNUHscRkeFi CYgRSeSBPbPcbvB1esnHhPIpcuS2SDEJbI0yldUudLR2pw3//v+/jrIUBMniPycw5UdO 0Tmi/wA8bW9+nrNwBZ0OON7zZS4R+Ut7tbPILIVL8dFwIa+5/dcg4Fd3pZQy9YLTwD1s wAVQ== X-Gm-Message-State: AHQUAuamL1gvZQxIJ0jkuX9BL/GxXj/vzwagODj1q3EXsrmpzuIk3Ry0 goKeWKF2u7QcSskFXHuye1DcKo62 X-Google-Smtp-Source: AHgI3IbIkHl6M77uP8qqqk9WH0DrUurQB2QOEkjamcBYZV1o6xVez5AwkAhrcSp81GwJtYrGwwP26Q== X-Received: by 2002:a62:b502:: with SMTP id y2mr3354388pfe.212.1551296772688; Wed, 27 Feb 2019 11:46:12 -0800 (PST) Received: from [172.17.7.154] (163-64-212-66.spl.org. [66.212.64.163]) by smtp.gmail.com with ESMTPSA id m64sm41140612pfi.149.2019.02.27.11.46.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Feb 2019 11:46:12 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: atf-c++ vs GoogleTest vs share/mk From: Enji Cooper In-Reply-To: Date: Wed, 27 Feb 2019 11:46:11 -0800 Cc: "freebsd-testing@freebsd.org" , Ed Maste , Julio Merino , "Jonathan T. Looney" Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Alan Somers X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: 35E538CA35 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=e7OScNnZ; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::42c as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com X-Spamd-Result: default: False [-6.20 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MV_CASE(0.50)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(-2.71)[ip: (-8.77), ipnet: 2607:f8b0::/32(-2.69), asn: 15169(-2.02), country: US(-0.07)]; RCVD_IN_DNSWL_NONE(0.00)[c.2.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-testing@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Testing on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2019 19:46:15 -0000 > On Feb 27, 2019, at 9:59 AM, Alan Somers wrote: >=20 > So it turns out to be impossible to use GoogleMock with atf-c++. The > problem is that atf-c++'s only way to report a test failure is > ATF_FAIL, which immediately terminates the program on failure. That > conflicts with the way that GoogleMock uses pthreads, which is to > report a failure while a pthread mutex is locked. atf-c++ has many > other shortcomings, too. It lacks the ATF_CHECK_* macros, and its > syntax is surprisingly inconsistent with atf-c=E2=80=99s. Yes, I=E2=80=99ve brought that up before in the past. This is part of = the reason why I want to abandon/kill off atf-c++ in favor of something = more functionally complete, i.e., googletest > So I tried writing a C++ program that uses atf-c instead. But the > Makefiles in share/mk make that a frustrating proposition. They don't > want C++ programs to link to atf-c, and they don't want atf-c programs > to be built in C++ mode. Well=E2=80=A6 yeah. This makes sense. > Googletest would probably work fine, but I would sorely miss ATF's > test case isolation features. In what ways? Using plain tests builds in some level of isolation, but = it=E2=80=99s not perfect, and this is the direction I=E2=80=99m taking = Googletest for a first iteration. > So what should I do? Should I fix atf-c++? That would entail > basically copying over everything from atf-c, which would be a lot of > work. Or should I hack atf.test.mk to allow C++ programs to use > atf-c? That would be ugly, but easier. Or should I just switch to > Googletest, and live with its fragile cleanup handlers? Using Googletest with Googlemock is the way that I intend to have things = work. Adding ATF into the mix as another layer seems like the ultimate = path to pain, since ATF=E2=80=99s libraries require full stack = management in order to do things like handle sandboxing, etc, and = Googlemock does some clever things with C++ that seems like they would = conflict with ATF=E2=80=99s goals. I=E2=80=99ll work on closing out the first iteration of = googletest.test.mk by the end of the week and work on getting the code = committed to ^/head. In parallel, I=E2=80=99ll focus on adding = googletest driver support to kyua (I have part of it done, but there are = still some missing pieces around test listing and results parsing), = which is the next required phase in order to make googletest function = more flexibly with kyua. Thanks, -Enji PS I appreciate the reminder about documenting my work and my goals on = the wiki. I=E2=80=99ll do that now.=