Commit Graph

9 Commits

Author SHA1 Message Date
Paul Duffin 55e740e9a6 Remove varargs from RunTest(t *testing.T)
Use GroupFixturePreparers instead.

Bug: 182885307
Test: m nothing
Change-Id: Iaedb0ddc9d6a704f4d41363e705f3025a1291dc8
2021-03-31 16:03:59 +01:00
Paul Duffin 29888b1bf0 Migrate system_modules_test.go from NormalizePathsForTesting
Bug: 183650682
Test: m nothing
Change-Id: I9ccbbe521a449cb88ab13cde10161a41cfcf244c
2021-03-29 17:29:30 +01:00
Paul Duffin 71ae59412b Remove javaFixtureFactory
Replaces uses of javaFixtureFactory with prepareForJavaTest and removes
the unused javaFixtureFactory.

Bug: 182885307
Test: m nothing
Change-Id: I809772d14af2af211b9e15ad676fbdc06b07cd46
2021-03-24 01:07:12 +00:00
Paul Duffin e84b1338c5 Migrate from result methods to function Asserts
Bug: 181070625
Test: m nothing
Change-Id: Iadb85270290acb52c55f2ad70c9f145f1c34b611
2021-03-12 22:24:51 +00:00
Paul Duffin 4e99ef761a Improve name of getModuleHeaderJarsAsNormalizedPaths
Bug: 182402568
Test: m nothing
Change-Id: I93bfe10f0ac62bf018cfee6738fa080d9404b1cb
2021-03-11 15:53:25 +00:00
Paul Duffin 4f0a75abde Ensure java_system_modules_import uses prebuilts
Make sure that java_system_modules_import always depends on the
prebuilt by adding dependencies in the ComponentDepsMutator() method
which is called before prebuilts without a corresponding source are
renamed from prebuilt_<x> to <x>. That requires the prebuilt_ prefix
to be provided but it ensures that the dependencies are safe.

Similar logic also makes sure java_system_modules always depends on
the source module and not on a renamed prebuilt module.

Bug: 182402568
Test: m nothing
Change-Id: I30db95978f5d9b205951011edf40585ee36c0c4c
2021-03-11 09:40:02 +00:00
Paul Duffin c52bea9555 Improve system modules tests
The previous approach of looking for substrings in the command that
matched the base name of the jar could not differentiate between
whether the jar was a prebuilt or a source as they both have the same
base name.

The tests also did not cover the case when there was both prebuilts
and source modules.

This change:
1. Checks that the inputs to the command come from the appropriate
   module.
2. Adds a mixed test.
3. Deduped the source and prebuilt module definitions.

The new test reveals the buggy behavior which will be fixed in a follow
up change.

Bug: 182402568
Test: m nothing
Change-Id: I384ecca097cbe3560e7589c23fb99c176a42fd9b
2021-03-11 09:39:18 +00:00
Paul Duffin f23e346f6c Convert system modules tests to use fixtures
Bug: 182402568
Test: m nothing
Change-Id: I0535e60a692925b141e465d8e1ec92be21d54c88
2021-03-11 08:32:01 +00:00
Paul Duffin db284be913 Separate system modules tests into their own file
java_test.go is getting too big.

Bug: 182402568
Test: m nothing
Change-Id: I9c3818f1d747a230fcb66687319a3a14d557a57c
2021-03-11 08:21:49 +00:00