KBEC-00134 - UpdateSummary for Custom postp Matchers

UpdateSummary function for Custom Matchers

This updateSummary function supports certain custom matchers and provides a customized “summary” job result populator.
Supported matchers are:

  • aplus.matcher.txt

  • armcc.matcher.txt

  • cnvtool.matcher.txt

  • ectool.matcher.txt

  • fxcop.matcher.txt

  • msbuild.matcher.txt

  • ncover.matcher.txt

  • nunit.matcher.txt

  • perforce.matcher.txt

  • symbianOS.matcher.txt

    sub updateSummary() {
    	my $vBCompilesString = (defined $::gProperties{"VBCompiles"}) ? $::gProperties{"VBCompiles"} . " VB compiles\n" : "";
    	my $cSharpCompilesString = (defined $::gProperties{"CSharpCompiles"}) ? $::gProperties{"CSharpCompiles"} . " C# batches\n" : "";
    	my $licenseCompilesString = (defined $::gProperties{"LicenseCompiles"}) ? $::gProperties{"LicenseCompiles"} . " licenses compiled\n" : "";
    	my $compilesString = (defined $::gProperties{"compiles"}) ? $::gProperties{"compiles"} . " compiles\n" : "";
    	my $warningsString = (defined $::gProperties{"warnings"}) ? $::gProperties{"warnings"} . " warnings\n" : "";
    	my $errorsString = (defined $::gProperties{"errors"}) ? $::gProperties{"errors"} . " errors\n" : "";
    	my $targetsString = (defined $::gProperties{"targets"}) ? $::gProperties{"targets"} . " targets" : "";
    	my $targetsSkippedString = (defined $::gProperties{"targetsSkipped"}) ? " (" . $::gProperties{"targetsSkipped"} . " skipped)\n" : "\n";
    	my $projectsString = (defined $::gProperties{"projects"}) ? $::gProperties{"projects"} . " projects\n" : "";
    	my $resourcesString = (defined $::gProperties{"resources"}) ? $::gProperties{"resources"} . " resources processed\n" : "";
    	my $testsString = (defined $::gProperties{"tests"}) ? $::gProperties{"tests"} . " tests\n" : "";
    	my $skippedTestsString = (defined $::gProperties{"testsSkipped"}) ? $::gProperties{"testsSkipped"} . " tests skipped\n" : "";
    	my $emakebuildsString = (defined $::gProperties{"emake-builds"}) ? " (" . $::gProperties{"emake-builds"} . " with emake) " : "";
    	my $armccErrorsString = (defined $::gProperties{"armcc-errors"}) ? $::gProperties{"armcc-errors"} . " armcc errors\n" : "";
    	my $makeErrorsString = (defined $::gProperties{"make-errors"}) ? $::gProperties{"make-errors"} . " errors reported by make\n" : "";
    	my $makeIgnoredErrorsString = (defined $::gProperties{"make-ignored-errors"}) ? $::gProperties{"make-ignored-errors"} . " ignored errors reported by make\n" : "";
    	my $warningsString = (defined $::gProperties{"warnings"}) ? $::gProperties{"warnings"} . " total warnings\n" : "";
    	my $armccWarningsString = (defined $::gProperties{"armcc-warnings"}) ? $::gProperties{"armcc-warnings"} . " armcc warnings\n" : "";
    	my $makmakeWarningsString = (defined $::gProperties{"makmake-warnings"}) ? $::gProperties{"makmake-warnings"} . " makmake warnings\n" : "";
    	my $phasesString = (defined $::gProperties{"phases"}) ? "Built " . $::gProperties{"phases"} . " phases" . $emakebuildsString . "\n" : "";
    	my $stagesString = (defined $::gProperties{"stages"}) ? "Processed " . $::gProperties{"stages"} . " stages\n" : "";
    	my $idString = (defined $::gProperties{"id"}) ? "Executed " . $::gProperties{"id"} . " ids\n" : "";
    	my $filecopiesString = (defined $::gProperties{"file-copies"}) ? $::gProperties{"file-copies"} . " files copied\n" : "";
    	my $fxcopAnalysisExString = (defined $::gProperties{"fxcop-summary-analysis-exceptions"}) ? $::gProperties{"fxcop-summary-analysis-exceptions"} . " analysis exceptions\n" : "";
    	my $fxcopRuleExString = (defined $::gProperties{"fxcop-summary-rule-exceptions"}) ? $::gProperties{"fxcop-summary-rule-exceptions"} . " rule exceptions\n" : "";
    	my $fxcopMsgsString = (defined $::gProperties{"fxcop-summary-messages"}) ? $::gProperties{"fxcop-summary-messages"} . " messages written\n" : "";
    	my $fxcopLoadedString = (defined $::gProperties{"fxcop-loaded"}) ? $::gProperties{"fxcop-loaded"} . " objects loaded\n" : "";
    	my $fxcopMissingDepString = (defined $::gProperties{"fxcop-missing-dependency"}) ? $::gProperties{"fxcop-missing-dependency"} . " missing deps\n" : "";
    	my $fxcopUnresRefString = (defined $::gProperties{"fxcop-unresolved-reference"}) ? $::gProperties{"fxcop-unresolved-reference"} . " unresolved refs\n" : "";
    
    	setProperty ("summary",
    		$phasesString .
    		$stagesString .
    		$idString .
    		$projectsString .
    		$targetsString .
    		$targetsSkippedString .
    		$vBCompilesString .
    		$cSharpCompilesString .
    		$licenseCompilesString .
    		$compilesString .
    		$testsString .
    		$skippedTestsString .
    		$warningsString .
    		$armccWarningsString .
    		$errorsString .
    		$armccErrorsString .
    		$makeErrorsString .
    		$makeIgnoredErrorsString .
    		$filecopiesString .
    		$fxcopLoadedString .
    		$fxcopMissingDepString .
    		$fxcopUnresRefString .
    		$fxcopAnalysisExString .
    		$fxcopRuleExString .
    		$fxcopMsgsString
    	);
    }
    

Have more questions?

0 Comments

Please sign in to leave a comment.