http://qs1969.pair.com?node_id=537995


in reply to Re: cmd.exe piping stress
in thread cmd.exe piping stress

Th dmp4.results and the dmp4.piped are identical.

When I then go and run:

C:/> perl unit2summary.pl < dmp4.piped

It works.

When however I run it with "perl units.pl COM1 | perl unit2summary.pl" it doesn't work.

The COM1 identifies the com port. It is part of a basic unit testing framework for a consumer electronics device.

The code for unit2summary.pl follows:

#!perl use strict; use warnings; my %results = (); my $total; my $command = ''; my $result = ''; while (<STDIN>) { chomp; next if /^\s*$/; if (/^COMMAND:\s+(.*)$/) { $command = $1; } if (/^RESULT:\s+(.*)$/) { $result = $1; print "$result: $command \n"; $results{$result}++; $total++; } } print "\n"; print "TESTS: $total "; foreach (keys %results) { print "$_: " . $results{$_} . " (" . abs($results{$_} * 100 / $tot +al) . "%) "; } print "\n";

A sample of the dmp4.piped follows:

COMMAND: mc creation TIMEOUT: 3 Creating various ContentData objects SUCCESS: Up-Casting HMediaAudioCD to HMediaCD SUCCESS: Up-Casting HMediaImageCD to HMediaCD SUCCESS: Up-Casting HMediaVideoCD to HMediaCD Working with const ContentData objects SUCCESS: Creation of new const-pointer HMediaAudioCD initialized w +ith non-const handle SUCCESS: Up-casting constHMediaAudioCD to constHMediaCD SUCCESS: Const-Casting from constHMediaAudioCD to HMediaAudioCD SUCCESS: Down-casting from constHMediaCD to constHMediaAudioCD SUCCESS: Making Const from cpHACDconst to ccpCD not successful RETURN: RESULT: PASSED COMMAND: mc attr TIMEOUT: 3 Creating HMediaAudioCD and add Title Attribute SUCCESS: HMediaAudioCD created SUCCESS: Checking for attribute "title" ERROR: Checking attribute value: This is my lif Changing value of Title attribute by re-adding with different valu +e SUCCESS: Checking for attribute "title" (2nd time) SUCCESS: Checking if attribute value was updated SUCCESS: Checking No. of attributes: 1 SUCCESS: Re-Checking No. of attributes: 1 SUCCESS: Removing attribute ERROR: Checking if attribute was really removed Adding more attributes SUCCESS: Attribute 0 has value A SUCCESS: Attribute 1 has value B SUCCESS: Attribute 2 has value C SUCCESS: Attribute 3 has value D SUCCESS: Attribute 4 has value E SUCCESS: Removing attribute at index 1 in list SUCCESS: Trying to remove non-existing attribute at index 5 ERROR: Removing all 4 Attributes: 4 elements left Checking setAttributeValue methods SUCCESS: Checking if setting value by name on non existing attribu +te prohibited SUCCESS: Checking if setting value by index on non existing attrib +ute prohibited SUCCESS: Setting value to new attribute SUCCESS: Re-setting value of existing attribute at index 0 Testing const char* - interface Adding attribute using const char* interface SUCCESS: Getting value of just added attribute SUCCESS: Checking if value of attribute is correct: somewhere over + the rainbow SUCCESS: Re-setting value of just added attribute using const char +* interface SUCCESS: Getting value of just changed attribute SUCCESS: Checking if value of attribute is correct: somewhere over + the rainbow RETURN: RESULT: FAILED

Any help appreciated.

-Andrew.


Andrew Tomazos  |  andrew@tomazos.com  |  www.tomazos.com