From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.117]) by mx.groups.io with SMTP id smtpd.web12.6187.1601001999022426125 for ; Thu, 24 Sep 2020 19:46:39 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=W6OUwqhm; spf=pass (domain: microsoft.com, ip: 40.107.220.117, mailfrom: bret.barkelew@microsoft.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XYZEaSdt/LC1bHBRIggJFhW8WINCKDTVt6WGd+7qqjD7L+beMvAEf+r7DaHlyl0Gjgn6EAZ33Qkx9MWS/YnCnRhvA/vC85iEm5OeSkXwFNgsfDPLIEZ5J2c3ZxjweMxx4c+hSTv4v64D0TXHdDR46aMh7xcqtYfYLDK1LzCw+oUEiAQw7EnSW3lS/ncjcyR6aXHimxQGNO44Q6PVHf9d+6idy2ANwKR2dWVPYeq2+ydpOMdAruXcyu9WSIbEatmchwhwRT2pf7dgoqt+IXBEiZC0EFqhlNvQcdXg7WDIlKx43LxaEm2pM1ekzHycDHAdpvfpf2jWbUzUgqC+Uu1wLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Dm5FYSC6eG2i+5RfQKjmN5FTUZ35GpSxn6fkVZ+AgyQ=; b=M0Z4ODKRJHsVMgyqxB0+gpmxV+q9Wr/vf+WnF1AnifBSWo7KCcqKoFrYG7EOLi+Soq0t5mCwZztGnanm6vxKLiSU3NDUtaijfPsqD3QyTuwF9mhslWPhAxxCxKqbjiLBtB0HyViT0bf93IcU30Y3b0F/EoqtrMy9zb3TeMeRHM11+3CL5FA7A5a5hf0W4yoNN3j+Mk59CW6eWoc1WWEKkR3hjJYtDEEwgYsf9eMk0iYSmDizXEnhaAch0Db3M9NWrgMqi3X3vOxKakLTeZ4lxi5JdztTx5ZiyjKFsTRqUZMFJRCFqUaVSaJl8w4As795IFtn2iIutgo+TmQuXYVubA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Dm5FYSC6eG2i+5RfQKjmN5FTUZ35GpSxn6fkVZ+AgyQ=; b=W6OUwqhmstfB/fBU8BuNBwaU8pOdnF1bAARbAtpJ6dzQfdDpU4aq+2urB51/umhrEEg79ieqYj6mAk5jZslvxmiWMGKNSCRbtorIDlwWnDA14XRt6twpMavk7UQT1VEtPYQSEqXkg3206quL1OMZB89ZjQvD9Gnua1+GjR5zUhY= Received: from MW4PR21MB1857.namprd21.prod.outlook.com (2603:10b6:303:74::12) by MWHPR21MB0173.namprd21.prod.outlook.com (2603:10b6:300:78::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.4; Fri, 25 Sep 2020 02:46:37 +0000 Received: from MW4PR21MB1857.namprd21.prod.outlook.com ([fe80::2967:7434:51bb:e234]) by MW4PR21MB1857.namprd21.prod.outlook.com ([fe80::2967:7434:51bb:e234%4]) with mapi id 15.20.3433.018; Fri, 25 Sep 2020 02:46:37 +0000 From: "Bret Barkelew" To: "devel@edk2.groups.io" , Ken Taylor Subject: Re: ECC: Won't somebody PLEASE think of the... test structures. Thread-Topic: ECC: Won't somebody PLEASE think of the... test structures. Thread-Index: AQHWktooEicGg8j40UW1Z0xLUDeoV6l4lrAQgAAJNUqAAAZkPg== Date: Fri, 25 Sep 2020 02:46:37 +0000 Message-ID: References: ,<29096719f8d541c3aa25f9738a61b1d3@SCL-EXCHMB-13.phoenix.com>, In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2020-09-25T02:23:04.7095791Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Privileged authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=microsoft.com; x-originating-ip: [174.21.140.128] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: c6dea8f2-0a5c-4bce-0433-08d860fd3929 x-ms-traffictypediagnostic: MWHPR21MB0173: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: fUL3fT+R8Fkon/JDRPyOJLscbVYH28YH5xw+ircpTJnp09TAzyXzRqIAWx/EMHMr89AjGaY0MZmClhj+oZLH+vJ6Sg0SrD/7kSY8cNlxNzjzhPpqSAojjZXiB8wYCY1Pk/99EgW7Ox73OeH+46po/AEcgflHjG8z1BICn2ULLFbmh1/Rl3PtTCB9K97KuoksDkxKa73nSYJe6O4jkztMaQuV229gWE7FcnkaRkXS/jONS5Nc2ZP6AzTiocFIlPsyFgrWqbYesjHNi0WdAnzmKWVpIb6tY+1tDJEj2BZFkPIstnRKh0MHl4XycVKLMMs8ojSa0Uv43LHGMByzqb1AokabEgiID8kVZmJg8dui/ugzRXk4F0ORG+FBkj72JSD9dkM/y2sHyg3pB2CFN/iXNLgDvzxPTTCpRlX2Xm4QMFQ7Ko26IJpuN+HFKFjjmiYJ+RJ6FDgxWL5WixEzM1gjXw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR21MB1857.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(376002)(366004)(346002)(396003)(136003)(26005)(76236003)(53546011)(86362001)(8676002)(9686003)(82950400001)(8936002)(2906002)(82960400001)(99936003)(478600001)(110136005)(83380400001)(10290500003)(2940100002)(66556008)(166002)(5660300002)(7696005)(55016002)(71200400001)(8990500004)(66476007)(52536014)(66946007)(186003)(66616009)(6506007)(66446008)(64756008)(33656002)(316002)(76116006);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: Mpv8sTVZDu6/fGAn60lQxCJQ5GSKbDfyBTYlSqi1ny3w/hYUgGplqdSkCFUNb3kImQKRV35UhsIC/9dlopLjqYkS/79kk41Me/6GaoDRGNSrJObYog+Fo5RXCDbhaW8LoIXzqNRiQZTOYgKxEM2sZb39zHHV1KAdtqLsP7ZLvdhxGFo3SllNX+VhKRZKsl3vxQzDAMMfxd1FiD7AB3PeX+Y+edrCKbMKoYGIn93waOBO1jvFpu9XxNOA0IEL1fLyBlQIusFyjhBeIDgzp6jMShSff/28vuFGcOcRSjjBmMfhwUFrDj5i5kpLRo3dQ5IHZF221Y+lWhW2UmphiIIKqv8obR7gOOlmVSWfoOA9SqVfHngFkXPmYlwy1cLux+Z6b6/QKSGFlUIewz0TBEwFqJWCWWY3297N7uatep5aBzNzpqeeNz3NVongS7u5DeAfBryTtK66AfDCiGuk+jFFVXPCBsPxj+RXtBr6azhSQ/MYsEUPpjO0izT7R+Y9zlImEd6v9eb0wgwZfRsgeIjy1EeJt5WaoJ5NtKOAhs40/saKOvVHNQz4M4bR82TzeOVt9unjHk1aYIsatDXSEy7Aqy/1uFQBXZrmlkXIsrjBe2RU4N+LHbH1A+eT/VD/XjQ8O6zmSoskpFB3ErDYXdcblg== x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR21MB1857.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c6dea8f2-0a5c-4bce-0433-08d860fd3929 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Sep 2020 02:46:37.3592 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: mGP0z95A2dUI434Vew+0iDj6xPZW7D6Va3bMHe+rV67IP9aTmPlAdjIY12JlklIY3V+tyltueDDd1ys9bFlhJQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR21MB0173 X-Groupsio-MsgNum: 65602 Content-Language: en-US Content-Type: multipart/related; boundary="_004_MW4PR21MB1857F9094C5D32010B657515EF360MW4PR21MB1857namp_"; type="multipart/alternative" --_004_MW4PR21MB1857F9094C5D32010B657515EF360MW4PR21MB1857namp_ Content-Type: multipart/alternative; boundary="_000_MW4PR21MB1857F9094C5D32010B657515EF360MW4PR21MB1857namp_" --_000_MW4PR21MB1857F9094C5D32010B657515EF360MW4PR21MB1857namp_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable One of the things we=92re really trying to do here is make a strong case fo= r contributing good tests, so I want them to be both: * Good citizens of code hygiene, and * Good examples of real-world, non-trivial tests (I actually used the = new UnitTestFrameworkPkg and test-driven design while writing VarPol way ba= ck when) So I=92m happy [for some definitions of =91happy=92] to reform and reflow = these as needed, but I=92m getting the suspicion that there are walls I=92m= going to hit. I also don=92t want test writing to be so onerous as to prevent contributo= rs for writing them. For example: I=92m not going to docstring every test c= ase. The test case name and framework strings should be clear enough to exp= lain what the case is doing (otherwise it=92s not a good test case). - Bret From: Bret Barkelew via groups.io Sent: Thursday, September 24, 2020 7:26 PM To: Ken Taylor; devel@edk2.groups.io Subject: [EXTERNAL] Re: [edk2-devel] ECC: Won't somebody PLEASE think of t= he... test structures. So for context, this is a new host-based test that should only run within = a platform OS, so intrinsics aren=92t the big deal that they would be in FW= code. But we do need to figure out how to simultaneously adhere to the coding co= nvention while enabling test authoring. Or we chose to not enforce quite as many things for tests. I=92d prefer the first. - Bret From: Ken Taylor Sent: Thursday, September 24, 2020 6:57 PM To: devel@edk2.groups.io; Bret Barkelew Subject: [EXTERNAL] RE: ECC: Won't somebody PLEASE think of the... test st= ructures. If the structure is a non-static local variable, most compilers will silen= tly inject an intrinsic call to memcpy in function initialization. This le= ads to an intermittent linker error. If the compiler you use automatically supports an intrinsic memcpy in the = given architecture or optimizes out the memcpy, it will build for you and y= ou won=92t know you need to link to an intrinsic support library in order t= o build cross platform. This leads to code that builds for you, but not fo= r me. Regards, -Ken. From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Bret= Barkelew via groups.io Sent: Thursday, September 24, 2020 6:23 PM To: devel@edk2.groups.io Subject: [edk2-devel] ECC: Won't somebody PLEASE think of the... test stru= ctures. ERROR - EFI coding style error ERROR - *Error code: 5007 ERROR - *There should be no initialization of a variable as part of its de= claration ERROR - *file: //home/corthon/_uefi/edk2_qemu_ci/edk2/MdeModulePkg/Library= /VariablePolicyLib/VariablePolicyUnitTest/VariablePolicyUnitTest.c ERROR - *Line number: 333 ERROR - *Variable Name: MatchCheckPolicy EccCheck no likey: SIMPLE_VARIABLE_POLICY_ENTRY ValidationPolicy =3D { { VARIABLE_POLICY_ENTRY_REVISION, sizeof(VARIABLE_POLICY_ENTRY) + sizeof(TEST_VAR_1_NAME), sizeof(VARIABLE_POLICY_ENTRY), TEST_GUID_1, TEST_POLICY_MIN_SIZE_NULL, TEST_POLICY_MAX_SIZE_NULL, TEST_POLICY_ATTRIBUTES_NULL, TEST_POLICY_ATTRIBUTES_NULL, VARIABLE_POLICY_TYPE_NO_LOCK }, TEST_VAR_1_NAME }; But you can=92t init this structure separately without addressing each fie= ld. Can a brother get an override? - Bret --_000_MW4PR21MB1857F9094C5D32010B657515EF360MW4PR21MB1857namp_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable

One of the things we=92re really trying to do here = is make a strong case for contributing good tests, so I want them to be bot= h:

  • Good citizens of code hygiene, and
  • Good example= s of real-world, non-trivial tests (I actually used the new UnitTestFramewo= rkPkg and test-driven design while writing VarPol way back when)=

 

So I=92m happy [for some definitions of =91happy=92= ] to reform and reflow these as needed, but I=92m getting the suspicion tha= t there are walls I=92m going to hit.

 

I also don=92t want test writing to be so onerous a= s to prevent contributors for writing them. For example: I=92m not going to= docstring every test case. The test case name and framework strings should= be clear enough to explain what the case is doing (otherwise it=92s not a good test case).

 

- Bret

 

From: Bret Barkelew via gr= oups.io
Sent: Thursday, September 24, 2020 7:26 PM
To: Ken Taylor; devel@edk2.groups.io
Subject: [EXTERNAL] Re: [edk2-devel] ECC: Won't somebody PLEASE thi= nk of the... test structures.

 

So for context, this is a new host-based test that = should only run within a platform OS, so intrinsics aren=92t the big deal t= hat they would be in FW code.

 

But we do need to figure out how to simultaneously = adhere to the coding convention while enabling test authoring.

Or we chose to not enforce quite as many things for= tests.

 

I=92d prefer the first.

 

- Bret

 

From: Ken Taylor
Sent: Thursday, September 24, 2020 6:57 PM
To: devel@edk2.groups.io; Bret Barkelew
Subject: [EXTERNAL] RE: ECC: Won't somebody PLEASE think of the... = test structures.

 

If the structure is a= non-static local variable, most compilers will silently inject an intrinsi= c call to memcpy in function initialization.  This leads to an intermi= ttent linker error.

 

If the compiler you u= se automatically supports an intrinsic memcpy in the given architecture or = optimizes out the memcpy, it will build for you and you won=92t know you ne= ed to link to an intrinsic support library in order to build cross platform.  This leads to code that builds fo= r you, but not for me.

 

Regards,

-Ken.

 

From: devel@edk2.groups.io [mailto:de= vel@edk2.groups.io] On Behalf Of Bret Barkelew via groups.io
Sent: Thursday, September 24, 2020 6:23 PM
To: devel@edk2.groups.io
Subject: [edk2-devel] ECC: Won't somebody PLEASE think of the... te= st structures.

 

ERROR - EFI coding style error

ERROR - *Error code: 5007

ERROR - *There should be no initialization of a var= iable as part of its declaration

ERROR - *file: //home/corthon/_uefi/edk2_qemu_ci/ed= k2/MdeModulePkg/Library/VariablePolicyLib/VariablePolicyUnitTest/VariablePo= licyUnitTest.c

ERROR - *Line number: 333

ERROR - *Variable Name: MatchCheckPolicy=

 

EccCheck no likey:

SIMPLE_VARIABLE_POLICY_ENTRY   Validation= Policy =3D {

    {

      VARIABLE_POLICY_ENTR= Y_REVISION,

      sizeof(VARIABLE_POLI= CY_ENTRY) + sizeof(TEST_VAR_1_NAME),

      sizeof(VARIABLE_POLI= CY_ENTRY),

      TEST_GUID_1,

      TEST_POLICY_MIN_SIZE= _NULL,

      TEST_POLICY_MAX_SIZE= _NULL,

      TEST_POLICY_ATTRIBUT= ES_NULL,

      TEST_POLICY_ATTRIBUT= ES_NULL,

      VARIABLE_POLICY_TYPE= _NO_LOCK

    },

    TEST_VAR_1_NAME

  };

 

But you can=92t init this structure separately with= out addressing each field.

Can a brother get an override?

 

- Bret

 

 

 

--_000_MW4PR21MB1857F9094C5D32010B657515EF360MW4PR21MB1857namp_-- --_004_MW4PR21MB1857F9094C5D32010B657515EF360MW4PR21MB1857namp_ Content-Type: image/png; name="1AD9288314A1415D86C3547B724C354A.png" Content-Description: 1AD9288314A1415D86C3547B724C354A.png Content-Disposition: inline; filename="1AD9288314A1415D86C3547B724C354A.png"; size=140; creation-date="Fri, 25 Sep 2020 02:46:36 GMT"; modification-date="Fri, 25 Sep 2020 02:46:36 GMT" Content-ID: Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAAsQAAAABCAYAAADZ77itAAAAAXNSR0IArs4c6QAAAARnQU1BAACx jwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAhSURBVEhL7cMBDQAACAMg+5cygQkeRoMIG9WT VVXVn7MHYi5moJeByLMAAAAASUVORK5CYII= --_004_MW4PR21MB1857F9094C5D32010B657515EF360MW4PR21MB1857namp_--