Backed out changeset b71c8c052463 (bug 1943846) for causing mass failures. CLOSED...
[gecko.git] / tools / lint / test / test_android_format.py
blob70cd1ea02e7f9e709cbf0c59d67d99e3f4e2b522
1 import mozunit
2 from conftest import build
4 LINTER = "android-format"
7 def test_basic(global_lint, config):
8 substs = {
9 "GRADLE_ANDROID_FORMAT_LINT_CHECK_TASKS": [
10 "spotlessJavaCheck",
11 "spotlessKotlinCheck",
13 "GRADLE_ANDROID_FORMAT_LINT_FIX_TASKS": [
14 "spotlessJavaApply",
15 "spotlessKotlinApply",
17 "GRADLE_ANDROID_FORMAT_LINT_FOLDERS": ["tools/lint/test/files/android-format"],
19 results = global_lint(
20 config=config,
21 topobjdir=build.topobjdir,
22 root=build.topsrcdir,
23 substs=substs,
24 extra_args=["-PandroidFormatLintTest"],
26 print(results)
28 # When first task (spotlessJavaCheck) hits error, we won't check next Kotlin error.
29 # So results length will be 1.
30 assert len(results) == 1
31 assert results[0].level == "error"
33 # Since android-format is global lint, fix=True overrides repository files directly.
34 # No way to add this test.
37 if __name__ == "__main__":
38 mozunit.main()