mozbuild.test.controller package

Submodules

mozbuild.test.controller.test_ccachestats module

class mozbuild.test.controller.test_ccachestats.TestCcacheStats(methodName='runTest')

Bases: TestCase

STAT0 = '\n    cache directory                     /home/tlin/.ccache\n    cache hit (direct)                     0\n    cache hit (preprocessed)               0\n    cache miss                             0\n    files in cache                         0\n    cache size                             0 Kbytes\n    max cache size                      16.0 Gbytes'
STAT1 = '\n    cache directory                     /home/tlin/.ccache\n    cache hit (direct)                   100\n    cache hit (preprocessed)             200\n    cache miss                          2500\n    called for link                      180\n    called for preprocessing               6\n    compile failed                        11\n    preprocessor error                     3\n    bad compiler arguments                 6\n    unsupported source language            9\n    autoconf compile/link                 60\n    unsupported compiler option            2\n    no input file                         21\n    files in cache                      7344\n    cache size                           1.9 Gbytes\n    max cache size                      16.0 Gbytes'
STAT10 = 'stats_updated_timestamp\t1713951990\nstats_zeroed_timestamp\t0\ndirect_cache_hit\t197\npreprocessed_cache_hit\t719\ncache_miss\t8427\ncalled_for_link\t569\ncalled_for_preprocessing\t110\nmultiple_source_files\t0\ncompiler_produced_stdout\t0\ncompiler_produced_no_output\t0\ncompiler_produced_empty_output\t0\ncompile_failed\t49\ninternal_error\t1\npreprocessor_error\t90\ncould_not_use_precompiled_header\t0\ncould_not_use_modules\t0\ncould_not_find_compiler\t0\nmissing_cache_file\t1\nbad_compiler_arguments\t6\nunsupported_source_language\t0\ncompiler_check_failed\t0\nautoconf_test\t418\nunsupported_compiler_option\t0\nunsupported_code_directive\t1\noutput_to_stdout\t0\nbad_output_file\t0\nno_input_file\t9\nerror_hashing_extra_file\t0\ncleanups_performed\t161\nfiles_in_cache\t4425\ncache_size_kibibyte\t4624220\n'
STAT11 = 'stats_updated_timestamp\t1713951990\nstats_zeroed_timestamp\t1713952000\ndirect_cache_hit\t0\npreprocessed_cache_hit\t0\ncache_miss\t0\ncalled_for_link\t0\ncalled_for_preprocessing\t0\nmultiple_source_files\t0\ncompiler_produced_stdout\t0\ncompiler_produced_no_output\t0\ncompiler_produced_empty_output\t0\ncompile_failed\t0\ninternal_error\t0\npreprocessor_error\t0\ncould_not_use_precompiled_header\t0\ncould_not_use_modules\t0\ncould_not_find_compiler\t0\nmissing_cache_file\t0\nbad_compiler_arguments\t0\nunsupported_source_language\t0\ncompiler_check_failed\t0\nautoconf_test\t0\nunsupported_compiler_option\t0\nunsupported_code_directive\t0\noutput_to_stdout\t0\nbad_output_file\t0\nno_input_file\t0\nerror_hashing_extra_file\t0\ncleanups_performed\t16\nfiles_in_cache\t0\ncache_size_kibibyte\t0\n'
STAT12 = 'stats_updated_timestamp\t0\nstats_zeroed_timestamp\t0\ndirect_cache_hit\t0\npreprocessed_cache_hit\t0\ncache_miss\t0\ncalled_for_link\t0\ncalled_for_preprocessing\t0\nmultiple_source_files\t0\ncompiler_produced_stdout\t0\ncompiler_produced_no_output\t0\ncompiler_produced_empty_output\t0\ncompile_failed\t0\ninternal_error\t0\npreprocessor_error\t0\ncould_not_use_precompiled_header\t0\ncould_not_use_modules\t0\ncould_not_find_compiler\t0\nmissing_cache_file\t0\nbad_compiler_arguments\t0\nunsupported_source_language\t0\ncompiler_check_failed\t0\nautoconf_test\t0\nunsupported_compiler_option\t0\nunsupported_code_directive\t0\noutput_to_stdout\t0\nbad_output_file\t0\nno_input_file\t0\nerror_hashing_extra_file\t0\ncleanups_performed\t16\nfiles_in_cache\t0\ncache_size_kibibyte\t0\n'
STAT13 = 'stats_updated_timestamp\t1713951990\nstats_zeroed_timestamp\t1713952000\ndirect_cache_hit\t280542\npreprocessed_cache_hit\t0\ncache_miss\t387653\ncalled_for_link\t0\ncalled_for_preprocessing\t0\nmultiple_source_files\t0\ncompiler_produced_stdout\t0\ncompiler_produced_no_output\t0\ncompiler_produced_empty_output\t0\ncompile_failed\t1665\ninternal_error\t1\npreprocessor_error\t0\ncould_not_use_precompiled_header\t0\ncould_not_use_modules\t0\ncould_not_find_compiler\t0\nmissing_cache_file\t0\nbad_compiler_arguments\t0\nunsupported_source_language\t0\ncompiler_check_failed\t0\nautoconf_test\t0\nunsupported_compiler_option\t0\nunsupported_code_directive\t0\noutput_to_stdout\t0\nbad_output_file\t0\nno_input_file\t2\nerror_hashing_extra_file\t0\ncleanups_performed\t364\nfiles_in_cache\t335104\ncache_size_kibibyte\t18224250\n'
STAT2 = '\n    cache directory                     /home/tlin/.ccache\n    cache hit (direct)                  1900\n    cache hit (preprocessed)             300\n    cache miss                          2600\n    called for link                      361\n    called for preprocessing              12\n    compile failed                        22\n    preprocessor error                     6\n    bad compiler arguments                12\n    unsupported source language           18\n    autoconf compile/link                120\n    unsupported compiler option            4\n    no input file                         48\n    files in cache                      7392\n    cache size                           2.0 Gbytes\n    max cache size                      16.0 Gbytes'
STAT3 = '\n    cache directory                     /Users/tlin/.ccache\n    primary config                      /Users/tlin/.ccache/ccache.conf\n    secondary config      (readonly)    /usr/local/Cellar/ccache/3.2/etc/ccache.conf\n    cache hit (direct)                 12004\n    cache hit (preprocessed)            1786\n    cache miss                         26348\n    called for link                     2338\n    called for preprocessing            6313\n    compile failed                       399\n    preprocessor error                   390\n    bad compiler arguments                86\n    unsupported source language           66\n    autoconf compile/link               2439\n    unsupported compiler option          187\n    no input file                       1068\n    files in cache                     18044\n    cache size                           7.5 GB\n    max cache size                       8.6 GB\n    '
STAT4 = '\n    cache directory                     /Users/tlin/.ccache\n    primary config                      /Users/tlin/.ccache/ccache.conf\n    secondary config      (readonly)    /usr/local/Cellar/ccache/3.2.1/etc/ccache.conf\n    cache hit (direct)                 21039\n    cache hit (preprocessed)            2315\n    cache miss                         39370\n    called for link                     3651\n    called for preprocessing            6693\n    compile failed                       723\n    ccache internal error                  1\n    preprocessor error                   588\n    bad compiler arguments               128\n    unsupported source language           99\n    autoconf compile/link               3669\n    unsupported compiler option          187\n    no input file                       1711\n    files in cache                     18313\n    cache size                           6.3 GB\n    max cache size                       6.0 GB\n    '
STAT5 = '\n    cache directory                     /Users/tlin/.ccache\n    primary config                      /Users/tlin/.ccache/ccache.conf\n    secondary config      (readonly)    /usr/local/Cellar/ccache/3.2.1/etc/ccache.conf\n    cache hit (direct)                 21039\n    cache hit (preprocessed)            2315\n    cache miss                         39372\n    called for link                     3653\n    called for preprocessing            6693\n    compile failed                       723\n    ccache internal error                  1\n    preprocessor error                   588\n    bad compiler arguments               128\n    unsupported source language           99\n    autoconf compile/link               3669\n    unsupported compiler option          187\n    no input file                       1711\n    files in cache                     17411\n    cache size                           6.0 GB\n    max cache size                       6.0 GB\n    '
STAT6 = "\n    cache directory                     /Users/tlin/.ccache\n    primary config                      /Users/tlin/.ccache/ccache.conf\n    secondary config      (readonly)    /usr/local/Cellar/ccache/3.3.2/etc/ccache.conf\n    cache hit (direct)                319287\n    cache hit (preprocessed)          125987\n    cache miss                        749959\n    cache hit rate                     37.25 %\n    called for link                    87978\n    called for preprocessing          418591\n    multiple source files               1861\n    compiler produced no output          122\n    compiler produced empty output       174\n    compile failed                     14330\n    ccache internal error                  1\n    preprocessor error                  9459\n    can't use precompiled header           4\n    bad compiler arguments              2077\n    unsupported source language        18195\n    autoconf compile/link              51485\n    unsupported compiler option          322\n    no input file                     309538\n    cleanups performed                     1\n    files in cache                     17358\n    cache size                          15.4 GB\n    max cache size                      17.2 GB\n    "
STAT7 = '\n    cache directory                     /Users/tlin/.ccache\n    primary config                      /Users/tlin/.ccache/ccache.conf\n    secondary config      (readonly)    /usr/local/Cellar/ccache/3.3.3/etc/ccache.conf\n    cache hit (direct)                 27035\n    cache hit (preprocessed)           13939\n    cache miss                         62630\n    cache hit rate                     39.55 %\n    called for link                     1280\n    called for preprocessing             736\n    compile failed                       550\n    preprocessor error                   638\n    bad compiler arguments                20\n    autoconf compile/link               1751\n    unsupported code directive             2\n    no input file                       2378\n    cleanups performed                  1792\n    files in cache                      3479\n    cache size                           4.4 GB\n    max cache size                       5.0 GB\n    '
STAT8 = '\n    cache directory                     /home/psimonyi/.ccache\n    primary config                      /home/psimonyi/.ccache/ccache.conf\n    secondary config      (readonly)    /etc/ccache.conf\n    stats zero time                     Wed Apr 24 09:46:30 2024\n    cache hit (direct)                   571\n    cache hit (preprocessed)            1203\n    cache miss                         11747\n    cache hit rate                     13.12 %\n    called for link                      623\n    called for preprocessing            7194\n    compile failed                        32\n    preprocessor error                   137\n    bad compiler arguments                 4\n    autoconf compile/link                348\n    no input file                        162\n    cleanups performed                    77\n    files in cache                     13464\n    cache size                           6.2 GB\n    max cache size                       7.0 GB\n    '
STAT9 = '\n    cache directory                     /Users/tlin/.ccache\n    primary config                      /Users/tlin/.ccache/ccache.conf\n    secondary config      (readonly)    /usr/local/Cellar/ccache/3.5/etc/ccache.conf\n    stats updated                       Wed Apr 24 09:46:40 2024\n    stats zeroed                        Wed Apr 24 09:46:30 2024\n    cache hit (direct)                 80147\n    cache hit (preprocessed)           21413\n    cache miss                        191128\n    cache hit rate                     34.70 %\n    called for link                     5194\n    called for preprocessing            1721\n    compile failed                       825\n    preprocessor error                  3838\n    cache file missing                  4863\n    bad compiler arguments                32\n    autoconf compile/link               3554\n    unsupported code directive             4\n    no input file                       5545\n    cleanups performed                  3154\n    files in cache                     18525\n    cache size                          13.4 GB\n    max cache size                      15.0 GB\n    '
STAT_GARBAGE = 'A garbage line which should be failed to parse'
VERSION_3_5_GIT = '\n    ccache version 3.5.1+2_gf5309092_dirty\n\n    Copyright (C) 2002-2007 Andrew Tridgell\n    Copyright (C) 2009-2019 Joel Rosdahl\n\n    This program is free software; you can redistribute it and/or modify it under\n    the terms of the GNU General Public License as published by the Free Software\n    Foundation; either version 3 of the License, or (at your option) any later\n    version.\n    '
VERSION_4_2 = '\n    ccache version 4.2.1\n\n    Copyright (C) 2002-2007 Andrew Tridgell\n    Copyright (C) 2009-2021 Joel Rosdahl and other contributors\n\n    See <https://ccache.dev/credits.html> for a complete list of contributors.\n\n    This program is free software; you can redistribute it and/or modify it under\n    the terms of the GNU General Public License as published by the Free Software\n    Foundation; either version 3 of the License, or (at your option) any later\n    version.\n    '
VERSION_4_4 = '\n    ccache version 4.4\n    Features: file-storage http-storage\n\n    Copyright (C) 2002-2007 Andrew Tridgell\n    Copyright (C) 2009-2021 Joel Rosdahl and other contributors\n\n    See <https://ccache.dev/credits.html> for a complete list of contributors.\n\n    This program is free software; you can redistribute it and/or modify it under\n    the terms of the GNU General Public License as published by the Free Software\n    Foundation; either version 3 of the License, or (at your option) any later\n    version.\n    '
VERSION_4_4_2 = '\n    ccache version 4.4.2\n    Features: file-storage http-storage\n\n    Copyright (C) 2002-2007 Andrew Tridgell\n    Copyright (C) 2009-2021 Joel Rosdahl and other contributors\n\n    See <https://ccache.dev/credits.html> for a complete list of contributors.\n\n    This program is free software; you can redistribute it and/or modify it under\n    the terms of the GNU General Public License as published by the Free Software\n    Foundation; either version 3 of the License, or (at your option) any later\n    version.\n    '
VERSION_4_5 = '\n    ccache version 4.5.1\n    Features: file-storage http-storage redis-storage\n\n    Copyright (C) 2002-2007 Andrew Tridgell\n    Copyright (C) 2009-2021 Joel Rosdahl and other contributors\n\n    See <https://ccache.dev/credits.html> for a complete list of contributors.\n\n    This program is free software; you can redistribute it and/or modify it under\n    the terms of the GNU General Public License as published by the Free Software\n    Foundation; either version 3 of the License, or (at your option) any later\n    version.\n    '
maxDiff = None
test_cache_size_shrinking()
test_hit_rate_of_diff_stats()
test_parse_garbage_stats_message()
test_parse_zero_stats_message()
test_stats_contains_data()
test_stats_version32()
test_stats_version33()
test_stats_version34()
test_stats_version35()
test_stats_version37()

mozbuild.test.controller.test_clobber module

class mozbuild.test.controller.test_clobber.TestClobberer(methodName='runTest')

Bases: TestCase

get_tempdir()
get_topsrcdir()
setUp()

Hook method for setting up the test fixture before exercising it.

tearDown()

Hook method for deconstructing the test fixture after testing it.

test_cwd_is_topobjdir()

If cwd is topobjdir, we can still clobber.

test_cwd_under_topobjdir()

If cwd is under topobjdir, we can’t clobber.

test_mozconfig_opt_in()

Auto clobber iff AUTOCLOBBER is in the environment.

test_no_objdir()

If topobjdir does not exist, no clobber is needed.

test_objdir_clobber_newer()

If CLOBBER in topobjdir is newer, do nothing.

test_objdir_clobber_older()

If CLOBBER in topobjdir is older, we clobber.

test_objdir_is_srcdir()

If topobjdir is the topsrcdir, refuse to clobber.

test_objdir_no_clobber_file()

If CLOBBER does not exist in topobjdir, treat as empty.

Module contents