mozbuild.test package

Submodules

mozbuild.test.common module

class mozbuild.test.common.MockConfig(topsrcdir=u'/path/to/topsrcdir', extra_substs={}, error_is_fatal=True)

Bases: object

mozbuild.test.test_android_version_code module

class mozbuild.test.test_android_version_code.TestAndroidVersionCode(methodName='runTest')

Bases: unittest.case.TestCase

test_android_version_code_v0()
test_android_version_code_v0_relative_v1()

Verify that the first v1 code is greater than the equivalent v0 code.

test_android_version_code_v1()
test_android_version_code_v1_overflow()

Verify that it is an error to ask for v1 codes that actually does overflow.

test_android_version_code_v1_running_low()

Verify there is an informative message if one asks for v1 codes that are close to overflow.

test_android_version_code_v1_underflow()

Verify that it is an error to ask for v1 codes predating the cutoff.

mozbuild.test.test_artifacts module

class mozbuild.test.test_artifacts.FakeResponse(content)

Bases: object

close()
headers
iter_content(chunk_size)
raise_for_status()
class mozbuild.test.test_artifacts.FakeSession

Bases: object

get(url, stream=True)
class mozbuild.test.test_artifacts.TestArtifactCache(methodName='runTest')

Bases: unittest.case.TestCase

listtmpdir()
setUp()

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

tearDown()

Hook method for deconstructing the test fixture after testing it.

test_artifact_cache_persistence()
utime(path, times)

mozbuild.test.test_base module

class mozbuild.test.test_base.TestMozbuildObject(methodName='runTest')

Bases: unittest.case.TestCase

get_base(topobjdir=None)
setUp()

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

tearDown()

Hook method for deconstructing the test fixture after testing it.

test_config_environment()
test_get_binary_path()
test_mach_command_base_inside_objdir()

Ensure a MachCommandBase constructed from inside the objdir works.

test_objdir_config_guess()
test_objdir_config_status()

Ensure @CONFIG_GUESS@ is handled when loading mozconfig.

test_objdir_is_srcdir_rejected()

Ensure the srcdir configurations are rejected.

test_objdir_mismatch()

Ensure MachCommandBase throwing on objdir mismatch.

test_objdir_trailing_slash()

Trailing slashes in topobjdir should be removed.

test_relative_objdir()

Relative defined objdirs are loaded properly.

Objdir that is a symlink is loaded properly.

class mozbuild.test.test_base.TestPathArgument(methodName='runTest')

Bases: unittest.case.TestCase

test_path_argument()

mozbuild.test.test_containers module

class mozbuild.test.test_containers.TestKeyedDefaultDict(methodName='runTest')

Bases: unittest.case.TestCase

test_defaults()
test_simple()
class mozbuild.test.test_containers.TestList(methodName='runTest')

Bases: unittest.case.TestCase

test_add_list()
test_add_string()
test_none()

As a special exception, we allow None to be treated as an empty list.

class mozbuild.test.test_containers.TestOrderedDefaultDict(methodName='runTest')

Bases: unittest.case.TestCase

test_defaults()
test_simple()
class mozbuild.test.test_containers.TestReadOnlyDefaultDict(methodName='runTest')

Bases: unittest.case.TestCase

test_assignment()
test_defaults()
test_simple()
class mozbuild.test.test_containers.TestReadOnlyDict(methodName='runTest')

Bases: unittest.case.TestCase

test_basic()
test_del()
test_update()
class mozbuild.test.test_containers.TestReadOnlyKeyedDefaultDict(methodName='runTest')

Bases: unittest.case.TestCase

test_defaults()
class mozbuild.test.test_containers.TestReadOnlyNamespace(methodName='runTest')

Bases: unittest.case.TestCase

test_basic()

mozbuild.test.test_dotproperties module

class mozbuild.test.test_dotproperties.TestDotProperties(methodName='runTest')

Bases: unittest.case.TestCase

test_bad_unicode_from_file()
test_get()
test_get_dict()
test_get_dict_with_shared_prefix()
test_get_dict_with_value_prefix()
test_get_list()
test_get_list_with_shared_prefix()
test_unicode()
test_update()
test_valid_unicode_from_file()

mozbuild.test.test_expression module

class mozbuild.test.test_expression.TestContext(methodName='runTest')

Bases: unittest.case.TestCase

Unit tests for the Context class

setUp()

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

test_in()

test ‘var in context’ to not fall for fallback

test_string_literal()

test string literal, fall-through for undefined var in a Context

test_variable()

test value for defined var in the Context class

class mozbuild.test.test_expression.TestExpression(methodName='runTest')

Bases: unittest.case.TestCase

Unit tests for the Expression class evaluate() is called with a context {FAIL: ‘PASS’}

setUp()

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

test_defined()

Test for the defined() value

test_equals()

Test for the == operator

test_logical_and()

Test for the && operator

test_logical_ops()

Test for the && and || operators precedence

test_logical_or()

Test for the || operator

test_not()

Test for the ! operator

test_notequals()

Test for the != operator

test_string_literal()

Test for a string literal in an Expression

test_variable()

Test for variable value in an Expression

mozbuild.test.test_jarmaker module

class mozbuild.test.test_jarmaker.TestJarMaker(methodName='runTest')

Bases: unittest.case.TestCase

Unit tests for JarMaker.py

debug = False
setUp()

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

tearDown()

Hook method for deconstructing the test fixture after testing it.

test_a_simple_jar()

Test a simple jar.mn

Test a simple jar.mn with a symlink

test_a_wildcard_jar()

Test a wildcard in jar.mn

Test a wildcard in jar.mn with symlinks

class mozbuild.test.test_jarmaker.Test_fluent(methodName='runTest')

Bases: unittest.case.TestCase

Unit tests for JarMaker interaction with Fluent

debug = False
setUp()

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

tearDown()

Hook method for deconstructing the test fixture after testing it.

test_l10n_not_merge_ftl()

Test that JarMaker doesn’t merge source .ftl files

class mozbuild.test.test_jarmaker.Test_relativesrcdir(methodName='runTest')

Bases: unittest.case.TestCase

setUp()

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

tearDown()

Hook method for deconstructing the test fixture after testing it.

test_en_US()
test_l10n_merge()
test_l10n_no_merge()
test_override()
test_override_l10n()

mozbuild.test.test_line_endings module

class mozbuild.test.test_line_endings.TestLineEndings(methodName='runTest')

Bases: unittest.case.TestCase

Unit tests for the Context class

createFile(lineendings)
setUp()

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

tearDown()

Hook method for deconstructing the test fixture after testing it.

testMac()
testUnix()
testWindows()

mozbuild.test.test_makeutil module

class mozbuild.test.test_makeutil.TestMakefile(methodName='runTest')

Bases: unittest.case.TestCase

test_makefile()
test_path_normalization(**kwargs)
test_read_dep_makefile()
test_rule()
test_statement()
test_write_dep_makefile()

mozbuild.test.test_manifest module

mozbuild.test.test_mozconfig module

class mozbuild.test.test_mozconfig.TestMozconfigLoader(methodName='runTest')

Bases: unittest.case.TestCase

get_loader()
get_temp_dir()
setUp()

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

tearDown()

Hook method for deconstructing the test fixture after testing it.

test_find_abs_path_not_exist()

Ensure a missing absolute path is detected.

test_find_default_files()

Ensure default paths are used when present.

test_find_deprecated_home_paths()

Ensure we error when deprecated home directory paths are present.

test_find_deprecated_path_srcdir()

Ensure we error when deprecated path locations are present.

test_find_legacy_env()

Ensure legacy mozconfig path definitions result in error.

test_find_multiple_but_identical_configs()

Ensure multiple relative-path MOZCONFIGs pointing at the same file are OK.

test_find_multiple_configs()

Ensure multiple relative-path MOZCONFIGs result in error.

test_find_multiple_defaults()

Ensure we error when multiple default files are present.

test_find_no_relative_configs()

Ensure a missing relative-path MOZCONFIG is detected.

test_find_path_not_file()

Ensure non-file paths are detected.

test_find_relative_mozconfig()

Ensure a relative MOZCONFIG can be found in the srcdir.

test_read_ac_options_substitution()

Ensure ac_add_options values are substituted.

test_read_capture_ac_options()

Ensures ac_add_options calls are captured.

test_read_capture_mk_options()

Ensures mk_add_options calls are captured.

test_read_capture_mk_options_objdir_environ()

Ensures mk_add_options calls are captured and override the environ.

test_read_empty_mozconfig()
test_read_empty_mozconfig_objdir_environ()
test_read_empty_variable_value()

Ensure empty variable values are parsed properly.

test_read_exported_variables()

Exported variables are caught as new variables.

test_read_load_exception()

Ensure non-0 exit codes in mozconfigs are handled properly.

test_read_modify_variables()

Variables modified by mozconfig are detected.

test_read_moz_objdir_substitution()

Ensure @TOPSRCDIR@ substitution is recognized in MOZ_OBJDIR.

test_read_multiline_variables()

Ensure multi-line variables are captured properly.

test_read_new_variables()

New variables declared in mozconfig file are detected.

test_read_no_mozconfig()
test_read_removed_variables()

Variables unset by the mozconfig are detected.

test_read_topsrcdir_defined()

Ensure $topsrcdir references work as expected.

test_read_unmodified_variables()

Variables modified by mozconfig are detected.

mozbuild.test.test_mozinfo module

class mozbuild.test.test_mozinfo.Base

Bases: object

class mozbuild.test.test_mozinfo.TestBuildDict(methodName='runTest')

Bases: unittest.case.TestCase, mozbuild.test.test_mozinfo.Base

test_android()
test_arm()

Test that all arm CPU architectures => arm.

test_crashreporter()

Test that crashreporter values are properly detected.

test_debug()

Test that debug values are properly detected.

test_linux()
test_mac()
test_missing()

Test that missing required values raises.

test_unknown()

Test that unknown values pass through okay.

test_win()
test_x86()

Test that various i?86 values => x86.

class mozbuild.test.test_mozinfo.TestWriteMozinfo(methodName='runTest')

Bases: unittest.case.TestCase, mozbuild.test.test_mozinfo.Base

Test the write_mozinfo function.

setUp()

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

tearDown()

Hook method for deconstructing the test fixture after testing it.

test_basic()

Test that writing to a file produces correct output.

test_fileobj()

Test that writing to a file-like object produces correct output.

mozbuild.test.test_preprocessor module

class mozbuild.test.test_preprocessor.TestPreprocessor(methodName='runTest')

Bases: unittest.case.TestCase

Unit tests for the Context class

do_include_compare(content_lines, expected_lines)
do_include_pass(content_lines)
setUp()

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

test_command_line_literal_at()
test_conditional_if_0()
test_conditional_if_0_elif_1()
test_conditional_if_0_or_1()
test_conditional_if_1()
test_conditional_if_1_elif_1_else()
test_conditional_if_1_if_1()
test_conditional_not_0()
test_conditional_not_0_and_1()
test_conditional_not_1()
test_conditional_not_emptyval()
test_conditional_not_nullval()
test_default_defines()
test_error()
test_expand()
test_filterDefine()
test_filter_attemptSubstitution()
test_filter_emptyLines()
test_filter_slashslash()
test_filter_spaces()
test_filter_substitution()
test_include()
test_include_line()
test_include_literal_at()
test_include_missing_file()
test_include_undefined_variable()
test_invalid_ifdef()
test_javascript_line()
test_literal()
test_no_marker()
test_number_value()
test_number_value_equals()
test_number_value_equals_defines()
test_number_value_not_equals_quoted_defines()
test_octal_value_equals()
test_octal_value_equals_defines()
test_octal_value_not_equals_quoted_defines()
test_octal_value_quoted_expansion()
test_string_value()
test_undef_defined()
test_undef_undefined()
test_undefined_variable()
test_value_quoted_expansion()

Quoted values on the commandline don’t currently have quotes stripped. Pike says this is for compat reasons.

test_var_directory()
test_var_file()
test_var_if_0()
test_var_if_0_elifdef()
test_var_if_0_elifndef()
test_var_ifdef_0()
test_var_ifdef_1_or_undef()
test_var_ifdef_undef()
test_var_ifndef_0()
test_var_ifndef_0_and_undef()
test_var_ifndef_undef()
test_var_line()

mozbuild.test.test_pythonutil module

class mozbuild.test.test_pythonutil.TestIterModules(methodName='runTest')

Bases: unittest.case.TestCase

test_iter_modules_in_path()

mozbuild.test.test_util module

class mozbuild.test.test_util.TestEnumString(methodName='runTest')

Bases: unittest.case.TestCase

test_string()
class mozbuild.test.test_util.TestFileAvoidWrite(methodName='runTest')

Bases: unittest.case.TestCase

test_diff_create()

Diffs are produced when files are created.

test_diff_not_default()

Diffs are not produced by default.

test_diff_update()

Diffs are produced on file update.

test_file_avoid_write()
class mozbuild.test.test_util.TestGroupUnifiedFiles(methodName='runTest')

Bases: unittest.case.TestCase

FILES = [u'a.cpp', u'b.cpp', u'c.cpp', u'd.cpp', u'e.cpp', u'f.cpp', u'g.cpp', u'h.cpp', u'i.cpp', u'j.cpp', u'k.cpp', u'l.cpp', u'm.cpp', u'n.cpp', u'o.cpp', u'p.cpp', u'q.cpp', u'r.cpp', u's.cpp', u't.cpp', u'u.cpp', u'v.cpp', u'w.cpp', u'x.cpp', u'y.cpp', u'z.cpp']
letter = 'z'
test_multiple_files()
test_unsorted_files()
class mozbuild.test.test_util.TestHashing(methodName='runTest')

Bases: unittest.case.TestCase

test_hash_file_known_hash()

Ensure a known hash value is recreated.

test_hash_file_large()

Ensure that hash_file seems to work with a large file.

class mozbuild.test.test_util.TestHierarchicalStringList(methodName='runTest')

Bases: unittest.case.TestCase

setUp()

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

test_del_exports()
test_exports_append()
test_exports_multiple_subdir()
test_exports_subdir()
test_invalid_exports_append()
test_invalid_exports_append_base()
test_invalid_exports_bool()
test_invalid_exports_set()
test_merge()
test_reassign()
test_unsorted()
test_walk()
class mozbuild.test.test_util.TestIndentedRepr(methodName='runTest')

Bases: unittest.case.TestCase

test_indented_repr()
class mozbuild.test.test_util.TestListWithAction(methodName='runTest')

Bases: unittest.case.TestCase

assertSameList(expected, actual)
setUp()

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

test_add()
test_extend()
test_iadd()
test_init()
test_slicing()
class mozbuild.test.test_util.TestMemoize(methodName='runTest')

Bases: unittest.case.TestCase

test_memoize()
test_memoize_method()
test_memoized_property()
class mozbuild.test.test_util.TestMisc(methodName='runTest')

Bases: unittest.case.TestCase

test_expand_variables()
test_pair()
class mozbuild.test.test_util.TestResolveTargetToMake(methodName='runTest')

Bases: unittest.case.TestCase

assertResolve(path, expected)
setUp()

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

test_Makefile()
test_dir()
test_regular_file()
test_root_path()
test_top_level()
class mozbuild.test.test_util.TestStrictOrderingOnAppendList(methodName='runTest')

Bases: unittest.case.TestCase

test_add()
test_add_StrictOrderingOnAppendList()
test_add_after_iadd()
test_extend()
test_iadd()
test_init()
test_slicing()
class mozbuild.test.test_util.TestStrictOrderingOnAppendListWithFlagsFactory(methodName='runTest')

Bases: unittest.case.TestCase

test_strict_ordering_on_append_list_with_flags_factory()
test_strict_ordering_on_append_list_with_flags_factory_extend()
class mozbuild.test.test_util.TestTypedList(methodName='runTest')

Bases: unittest.case.TestCase

test_add()
test_add_coercion()
test_extend()
test_iadd()
test_init()
test_memoized()
test_slicing()
class mozbuild.test.test_util.TestTypedNamedTuple(methodName='runTest')

Bases: unittest.case.TestCase

test_simple()
class mozbuild.test.test_util.TypedTestStrictOrderingOnAppendList(methodName='runTest')

Bases: unittest.case.TestCase

test_init()

Module contents