From owner-freebsd-testing@freebsd.org Wed Feb 27 18:05:48 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 A06541500CD2 for ; Wed, 27 Feb 2019 18:05:48 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (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 94FD788FF6 for ; Wed, 27 Feb 2019 18:05:47 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf1-f50.google.com with SMTP id v185so1773619lfa.11 for ; Wed, 27 Feb 2019 10:05:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=i9+ZdWl0fnA5ii8cf4DOb64WB7JBfrzlJsEzLrhc7Ag=; b=KlnfKl4xu176LO+ksIveq/VHff6BbjqRZvKDK2UVRvGecxW0orFh3zw73pis1HkzPF dbFZHtGNa2RFHASoY3mbeZoBYkt8XglE1FFMbDBnLO1kMzzLCuO317hYk2FEnfqMhfzF ZjhGl9kTleJT07bvbt7M8nWr1Yy93dO3dmfocdXuOpTaEbvA46yYhfbPf74UzqK0Z8x2 5Ns9Dbhkzlius67rtcLlxXqvICPVlegDovijCK2Wt+MrFKfMKI9cz+m8AI9bMuwNHO7B YHl/K9FlgIbmg25WmH/6SJvTgGqqHW082r7xZWnrG8NwwwFCbbPw1M23/ZVM9UTGDfrN DAGw== X-Gm-Message-State: AHQUAuaaUv3J29zWYbhqdZ3S5qIDMuzzOi87XmGoBNTVcoBSO7g1wD0S q2wMOcDTXkDyyieM740W14GJwrkJlgf7MKZyuOk0qg== X-Google-Smtp-Source: AHgI3Ib4Dz5hHy5wQZKdHmHXgiQmbLikB79ktggZs/1LPDswzGzNsV2PjNQ4XQBJfGt/mN6CRVJi8OMXPBa+S6PJaks= X-Received: by 2002:a19:4948:: with SMTP id l8mr1770263lfj.156.1551290353321; Wed, 27 Feb 2019 09:59:13 -0800 (PST) MIME-Version: 1.0 From: Alan Somers Date: Wed, 27 Feb 2019 10:59:01 -0700 Message-ID: Subject: atf-c++ vs GoogleTest vs share/mk To: "freebsd-testing@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 94FD788FF6 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.167.50 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-4.03 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-testing@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_TRACE(0.00)[0:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.85)[-0.845,0]; RCVD_IN_DNSWL_NONE(0.00)[50.167.85.209.list.dnswl.org : 127.0.5.0]; TO_DN_EQ_ADDR_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; IP_SCORE(-1.18)[ipnet: 209.85.128.0/17(-3.81), asn: 15169(-2.02), country: US(-0.07)]; TO_DOM_EQ_FROM_DOM(0.00)[] 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 18:05:48 -0000 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's. 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. Googletest would probably work fine, but I would sorely miss ATF's test case isolation features. 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? -Alan