[test-suite] r262306 - lit: Add simple codesize module

Duncan Exon Smith via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 1 10:08:25 PST 2016


Thank you!

> On Feb 29, 2016, at 11:05 PM, Matthias Braun via llvm-commits <llvm-commits at lists.llvm.org> wrote:
> 
> Author: matze
> Date: Tue Mar  1 00:05:27 2016
> New Revision: 262306
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=262306&view=rev
> Log:
> lit: Add simple codesize module
> 
> This simply records the filesize of the executable.
> 
> Added:
>    test-suite/trunk/litsupport/codesize.py
> Modified:
>    test-suite/trunk/litsupport/test.py
> 
> Added: test-suite/trunk/litsupport/codesize.py
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/litsupport/codesize.py?rev=262306&view=auto
> ==============================================================================
> --- test-suite/trunk/litsupport/codesize.py (added)
> +++ test-suite/trunk/litsupport/codesize.py Tue Mar  1 00:05:27 2016
> @@ -0,0 +1,13 @@
> +import lit.Test
> +import logging
> +import shellcommand
> +import os.path
> +
> +
> +def collect(context, result):
> +    try:
> +        size = os.path.getsize(context.executable)
> +        result.addMetric('size', lit.Test.toMetricValue(size))
> +    except:
> +        logging.info('Could not calculate filesize for %s' %
> +                     context.executable)
> 
> Modified: test-suite/trunk/litsupport/test.py
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/litsupport/test.py?rev=262306&r1=262305&r2=262306&view=diff
> ==============================================================================
> --- test-suite/trunk/litsupport/test.py (original)
> +++ test-suite/trunk/litsupport/test.py Tue Mar  1 00:05:27 2016
> @@ -8,6 +8,7 @@ from lit.TestRunner import executeScript
> from lit import Test
> from lit.util import to_bytes, to_string
> 
> +import codesize
> import compiletime
> import hash
> import perf
> @@ -151,5 +152,6 @@ class TestSuiteTest(FileBasedTest):
>             result.addMetric(metric, lit.Test.toMetricValue(values[0]))
>         compiletime.collect(context, result)
>         hash.collect(context, result)
> +        codesize.collect(context, result)
> 
>         return result
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list