summaryrefslogtreecommitdiff
path: root/java/robolectric_test.go
AgeCommit message (Collapse)Author
2025-03-12Mark "Ravenwood-tests" and "robo-test" modules as being TestOnly and ↵ Ronald Braunstein
top-level-tests for code coverage reporting. Fixes: 402451184 Tests: m nothing --no-skip-soong-tests blueprint_tests Tests: go test ./java Tests: m all_teams && gqui from "flatten(out/soong/ownership/all_teams.pb, teams)" proto build/soong/android/team_proto/team.proto:AllTeams 'select teams.kind, count(*) where teams.test_only = true and teams.kind not like "%cc_%" group by teams.kind' +--------------------------+----------+ | teams.kind | count(*) | +--------------------------+----------+ | android_ravenwood_test | 37 | | android_robolectric_test | 118 | | android_test | 2230 | | android_test_helper_app | 2125 | ... Change-Id: Ib81b6d261a3088aed44ea4d74452f99ff0f3d587
2025-02-12Don't panic in ModuleForTests and friends Colin Cross
Panicking in ModuleForTests and similar test helper functions was a mistake. Go's test runner stops running tests as soon as any test panics, which means debugging multiple tests panicking requires rerunning all the tests after fixing each panic to find the next one. Pass the *testing.T into ModuleForTests and friends so that it can call t.Fatalf instead. Test: all soong tests pass Change-Id: I5d0f2424eaf04fb795079e6d1e4b9469d8c7033c
2025-01-31Add t.Parallel() to java tests Colin Cross
Speeds up go test ./java from 32 seconds to 9 seconds. Test: go test ./java Change-Id: I4c6640e787c0744c6dfda03b7382839b452e24cf
2025-01-02Stop using _upstream suffix, and remove visibility checks on ↵ Rex Hoffman
ClearcutJunitListener. Also removes visibility checks, if strict_mode is true, on robolectric_all. Bug: 386691288 Test: CI Change-Id: I8fb1669f570cff0fcbfa31e20306a638e27541d0
2024-12-27Adds clearcutlistener to junit running robolectric tests. Rex Hoffman
Test: CI Bug: 371194831 Flag: TEST_ONLY Change-Id: Ic6b6990236200496ee831aacfddff4b0e9ea6899
2024-07-09Properly package JNI libs in Robo tests Jamie Garside
Previously, the jni_libs property was ignored when packaging robolectric-tests.zip, meaning that tests sometimes couldn't find native libraries. This change causes any native libs that tests use to be written alongside the .jar/.apk for Robolectric tests. 99% of this code is just stolen from the Ravenwood tests, as they work in this area. In short though, any native libs will be built for the host arch and put in the correct place. Tests are a little lacking (just testing the new functionality), but I'm not 100% sure how to test the rest of the Robolectric file. Bug: 340801983 Test: Manually verified, `go test` in java/ Change-Id: I4ef28b1cbc4675fc329dc8fcab06d055d6538e60
2019-09-29Move sharding functions for reuse Colin Cross
Move shardPaths and shardTests to android.ShardPaths and android.ShardStrings for reuse in other packages. Test: m checkbuild Change-Id: I868802872c73616b80f56cbf11f959c01a8b793a
2019-06-14Support sharding robolectric tests Colin Cross
Explicitly pass the list of tests as LOCAL_ROBOTEST_FILES, and support sharding the list of tests into multiple test runners. Also filter out BaseRobolectricTest.java, which covers the only use of LOCAL_ROBOTEST_FILES in Android.mk files. Bug: 133878985 Test: m RunSettingsLibRoboTests runs the same number of tests before and after Test: m RunSettingsLibRoboTests runs the same number of tests when sharded Change-Id: Id85ffe03c98e722303eaa6def17812ed2244c6a6 Merged-In: Id85ffe03c98e722303eaa6def17812ed2244c6a6