All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <sean.j.christopherson@intel.com>
To: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Cc: linux-sgx@vger.kernel.org, Cedric Xing <cedric.xing@intel.com>,
	Andy Lutomirski <luto@kernel.org>
Subject: Re: [PATCH for_v2? v2 08/14] selftests/harness: Move operator macros to their own header file
Date: Mon, 21 Oct 2019 20:20:07 -0700	[thread overview]
Message-ID: <20191022032007.GB32147@linux.intel.com> (raw)
In-Reply-To: <20191021110823.GB7398@linux.intel.com>

On Mon, Oct 21, 2019 at 02:08:23PM +0300, Jarkko Sakkinen wrote:
> On Thu, Oct 17, 2019 at 11:13:09AM -0700, Sean Christopherson wrote:
> > On Thu, Oct 17, 2019 at 07:53:56PM +0300, Jarkko Sakkinen wrote:
> > > On Wed, Oct 16, 2019 at 08:03:34PM -0700, Sean Christopherson wrote:
> > > > Move the operator macros, ASSERT_* and EXTEND_*, to a standalone header
> > > > so that they can be reused by other selftests without pulling in the
> > > > full harness framework, which is cumbersome to use for testing features
> > > > that require a substantial amount of setup, need callbacks, etc...
> > > > 
> > > > Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
> > > 
> > > Is it possible to just use a "dull" selftest and not go into this before
> > > the code is upstreamed? If yes, lets go with that.
> > 
> > It's certainly possible, but the code is verbose and ugly (IMO), which
> > means it will be harder for other to review.
> 
> Ok, I'll try to explain in more verbose terms how I see this.
> 
> Not all selftests use the harness and I'm not yet confident that SGX has
> to. Unfortunately, ugly is for me something that I cannot put metrics
> on. Also, often "ugly" is actually better than layering because it is
> more transparent.
> 
> The test is comprised of simple POSIX calls that everyone knows whereas
> using kselftest harness requires learning new framework. Less macros
> makes code also easier to debug and pair compare to dissembly when
> required. I've done the latter at least a few times.
> 
> It will also add a requirement for code reviewers who are simply looking
> for a code example how SGX works also to learn the harness. In the scope
> of the patch set the selftest serves as a such example.

Eh, if SGX were actually using any of the harness stuff, sure, but I'd
hope most reviewers intuitively understand what ASSERT_EQ does.

  reply	other threads:[~2019-10-22  3:20 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-17  3:03 [PATCH for_v2? v2 00/14] selftests/x86/sgx: Improve tests Sean Christopherson
2019-10-17  3:03 ` [PATCH for_v2? v2 01/14] selftests/x86/sgx: Fix a benign linker warning Sean Christopherson
2019-10-17  3:03 ` [PATCH for_v2? v2 02/14] selftests/x86/sgx: Use getauxval() to retrieve the vDSO base address Sean Christopherson
2019-10-17  3:03 ` [PATCH for_v2? v2 03/14] selftests/x86/sgx: Sanitize the types for sgx_vdso_call()'s input params Sean Christopherson
2019-10-17  3:03 ` [PATCH for_v2? v2 04/14] selftests/x86/sgx: Mark helper functions as static Sean Christopherson
2019-10-17  3:03 ` [PATCH for_v2? v2 05/14] selftests/x86/sgx: Move vDSO setup to a helper function Sean Christopherson
2019-10-17  3:03 ` [PATCH for_v2? v2 06/14] selftests/x86/sgx: Move individual tests into helper functions Sean Christopherson
2019-10-17  3:03 ` [PATCH for_v2? v2 07/14] selftests/x86/sgx: Use standard helper function to signal pass/fail Sean Christopherson
2019-10-17  3:03 ` [PATCH for_v2? v2 08/14] selftests/harness: Move operator macros to their own header file Sean Christopherson
2019-10-17 16:53   ` Jarkko Sakkinen
2019-10-17 18:13     ` Sean Christopherson
2019-10-21 11:08       ` Jarkko Sakkinen
2019-10-22  3:20         ` Sean Christopherson [this message]
2019-10-17  3:03 ` [PATCH for_v2? v2 09/14] selftests/x86/sgx: Use kselftest operators to check test results Sean Christopherson
2019-10-17  3:03 ` [PATCH for_v2? v2 10/14] selftests/x86/sgx: Handle setup failures via kselftest assertions Sean Christopherson
2019-10-17  3:03 ` [PATCH for_v2? v2 11/14] selftests/x86/sgx: Add a check on the vDSO exception reporting mechanism Sean Christopherson
2019-10-17  3:03 ` [PATCH for_v2? v2 12/14] selftests/x86/sgx: Add test of vDSO with basic exit handler Sean Christopherson
2019-10-17  3:03 ` [PATCH for_v2? v2 13/14] selftests/x86/sgx: Add check to verify exit handler stack alignment Sean Christopherson
2019-10-17  3:03 ` [PATCH for_v2? v2 14/14] selftests/x86/sgx: Add test for exception behavior with exit handler Sean Christopherson
2019-10-18 10:12 ` [PATCH for_v2? v2 00/14] selftests/x86/sgx: Improve tests Jarkko Sakkinen
2019-10-18 10:20   ` Jarkko Sakkinen
2019-10-22 22:41     ` Sean Christopherson
2019-10-23 12:39       ` Jarkko Sakkinen
2019-10-26 14:08         ` Andy Lutomirski

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=20191022032007.GB32147@linux.intel.com \
    --to=sean.j.christopherson@intel.com \
    --cc=cedric.xing@intel.com \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=linux-sgx@vger.kernel.org \
    --cc=luto@kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.