(patch-coverage.pl) Ignore header files that yield no coverage 73/224873/1
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 13 Feb 2020 14:50:52 +0000 (14:50 +0000)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 13 Feb 2020 14:50:52 +0000 (14:50 +0000)
Change-Id: I5488a6c1d9f52db6f0d4ee7ee285cb6679c759fb

automated-tests/patch-coverage.pl

index 5e5e164cd6884bba2566d9a3d8b3006db587157d..c5d9083aef9a2cdf57e333a3f9a74b84405b1d5e 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 #
-# Copyright (c) 2016 Samsung Electronics Co., Ltd.
+# Copyright (c) 2020 Samsung Electronics Co., Ltd.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -266,6 +266,12 @@ sub get_coverage
                 if(index( $source_file, $file ) > 0 )
                 {
                     $gcovfile = $coverage_file;
+                    # Some header files do not produce an equivalent gcov file so we shouldn't parse them
+                    if(($source_file =~ /\.h$/) && (! -e $gcovfile))
+                    {
+                        print "Omitting Header: $source_file\n" if $debug;
+                        $gcovfile = ""
+                    }
                     last;
                 }
             }