From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web11.104164.1683542977681307214 for ; Mon, 08 May 2023 03:49:38 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=JZYMFvWH; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: gua.guo@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683542977; x=1715078977; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=eLWHCHZWgcUz76GHSoCpS8KJmG0px7eXMUnOevvnsDk=; b=JZYMFvWHHYEOihsGGRWzvtb6H+s/+DMTP/cUe0JMVqm/7aGj1M3S9P36 7YhE690R9Zrsf4iI2SoCxLfU+/R5na6e86LdsIOTPDiMtQRdQ0T2Swue5 xt1KQ8tA1kgOYMjzLO3gyGfhR+sDl2KI8TyiRhVqLlS4pzKQ/dd2Pouaj FCKkVB8sPHtjgEWjaSoYZLXISFc7Oyvj0TPvDVH2AWK3jcPBLoza+/upB 0cXhkKmn9Ztxo5zGhTIaNYLi1mEz9CndSh+ZnnudYhfucWDnJX7Siivu3 r/dYkv62ds4qEolTd318G0ZHo/M71HGVpgWsb03Jw2Oq9nP8yFxGD8Trf A==; X-IronPort-AV: E=McAfee;i="6600,9927,10703"; a="329235960" X-IronPort-AV: E=Sophos;i="5.99,258,1677571200"; d="scan'208";a="329235960" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2023 03:49:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10703"; a="698485905" X-IronPort-AV: E=Sophos;i="5.99,258,1677571200"; d="scan'208";a="698485905" Received: from gguo-desk.gar.corp.intel.com ([10.5.215.23]) by orsmga002.jf.intel.com with ESMTP; 08 May 2023 03:49:35 -0700 From: "Guo, Gua" To: devel@edk2.groups.io Cc: Gua Guo , Michael D Kinney , Sean Brogan , Michael Kubacki Subject: [PATCH v1] BaseTools/Plugin: Too many execute file will be failure Date: Mon, 8 May 2023 18:49:29 +0800 Message-Id: <20230508104929.604-1-gua.guo@intel.com> X-Mailer: git-send-email 2.39.2.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Gua Guo Windows command prompt have 8191 character limitation, enhance it to make command too long can be resloved. Change-Id: I7f1d8d46274f1c0104572d47253d499900effe76 Cc: Michael D Kinney Cc: Sean Brogan Cc: Michael Kubacki Signed-off-by: Gua Guo --- .../HostBasedUnitTestRunner.py | 31 ++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunn= er.py b/BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.py index d993de9412..05bb6da50a 100644 --- a/BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.py +++ b/BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.py @@ -209,13 +209,25 @@ class HostBasedUnitTestRunner(IUefiBuildPlugin): coverageFile =3D ""=0D for testFile in testList:=0D ret =3D RunCmd("OpenCppCoverage", f"--source {workspace} --exp= ort_type binary:{testFile}.cov -- {testFile}")=0D - coverageFile +=3D " --input_coverage=3D" + testFile + ".cov"=0D + if ret !=3D 0:=0D + logging.error("UnitTest Coverage: Failed to collect covera= ge data.")=0D + return 1=0D +=0D + coverageFile =3D f" --input_coverage=3D{testFile}.cov"=0D + if (os.path.isfile(f"{os.path.join(buildOutputBase, 'coverage.= cov')}")):=0D + coverageFile +=3D f" --input_coverage=3D{os.path.join(buil= dOutputBase, 'coverage.cov')}"=0D + ret =3D RunCmd("OpenCppCoverage", f"--export_type binary:{os.p= ath.join(buildOutputBase, 'coverage.cov')} --working_dir=3D{workspace}Build= {coverageFile}")=0D if ret !=3D 0:=0D logging.error("UnitTest Coverage: Failed to collect covera= ge data.")=0D return 1=0D =0D # Generate and XML file if requested.by each package=0D - ret =3D RunCmd("OpenCppCoverage", f"--export_type cobertura:{os.pa= th.join(buildOutputBase, 'coverage.xml')} --working_dir=3D{workspace}Build = {coverageFile}")=0D + ret =3D RunCmd(=0D + "OpenCppCoverage",=0D + f"--export_type cobertura:{os.path.join(buildOutputBase, 'cove= rage.xml')} " +=0D + f"--working_dir=3D{workspace}Build " +=0D + f"--input_coverage=3D{os.path.join(buildOutputBase, 'coverage.= cov')}"=0D + )=0D if ret !=3D 0:=0D logging.error("UnitTest Coverage: Failed to generate cobertura= format xml in single package.")=0D return 1=0D @@ -224,9 +236,20 @@ class HostBasedUnitTestRunner(IUefiBuildPlugin): testCoverageList =3D glob.glob(os.path.join(workspace, "Build", "*= *","*Test*.exe.cov"), recursive=3DTrue)=0D coverageFile =3D ""=0D for testCoverage in testCoverageList:=0D - coverageFile +=3D " --input_coverage=3D" + testCoverage=0D + coverageFile =3D f" --input_coverage=3D{testCoverage}"=0D + if (os.path.isfile(f"{workspace}Build/coverage.cov")):=0D + coverageFile +=3D f" --input_coverage=3D{workspace}Build/c= overage.cov"=0D + ret =3D RunCmd("OpenCppCoverage", f"--export_type binary:{work= space}Build/coverage.cov --working_dir=3D{workspace}Build {coverageFile}")= =0D + if ret !=3D 0:=0D + logging.error("UnitTest Coverage: Failed to collect covera= ge data.")=0D + return 1=0D =0D - ret =3D RunCmd("OpenCppCoverage", f"--export_type cobertura:{works= pace}Build/coverage.xml --working_dir=3D{workspace}Build {coverageFile}")=0D + ret =3D RunCmd(=0D + "OpenCppCoverage",=0D + f"--export_type cobertura:{workspace}Build/coverage.xml " +=0D + f"--working_dir=3D{workspace}Build " +=0D + f"--input_coverage=3D{workspace}Build/coverage.cov"=0D + )=0D if ret !=3D 0:=0D logging.error("UnitTest Coverage: Failed to generate cobertura= format xml.")=0D return 1=0D --=20 2.39.2.windows.1