platform_build/tools/post_process_props_unittest...

7 lines
305 B
XML
Raw Normal View History

Support optional prop assignments This CL adds a number of changes to make the assignment of system properties to be less confusing. 1. Added `a ?= b` syntax, which is called optional prop assignments. The prop `a` gets the value `b` only when there is no non-optional prop assignment for `a` such as `a = c`. This is useful for props that provide some reasonable default values as fallback. 2. With the introduction of the optional prop assignment syntax, duplicated non-optional assignments is prohibited; e.g., the follwing now triggers a build-time error: a = b a = c , but the following doesn't: a ?= b a = c Note that the textual order between the optional and non-optional assignments doesn't matter. The non-optional assignment eclipses the optional assignment even when the former appears 'before' the latter. a = c a ?= b In the above, `a` gets the value `c` When there are multiple optional assignments without a non-optional assignments as shown below, the last one wins: a ?= b a ?= c `a` becomes `c`. Specifically, the former assignment is commented out and the latter is converted to a non-optional assignment. 3. post_process_props.py is modified so that when a prop assignment is deleted, changed, or added, the changes are recorded as comments. This is to aid debugging. Previously, it was often difficult to find out why a certain sysprop assignment is missing or is added. 4. post_process_prop.py now has a unittest Bug: 117892318 Bug: 158735147 Test: atest --host post_process_prop_unittest Exempt-From-Owner-Approval: cherry-pick from master Merged-In: I9c073a21c8257987cf2378012cadaeeeb698a4fb (cherry picked from commit 7aeb8de74e08eb2d305686aa8eff45353973e7d7) Change-Id: I9c073a21c8257987cf2378012cadaeeeb698a4fb
2020-06-22 16:30:57 +08:00
<configuration description="Config to run post_process_props_unittest">
<test class="com.android.tradefed.testtype.python.PythonBinaryHostTest" >
<option name="par-file-name" value="post_process_props_unittest" />
<option name="test-timeout" value="1m" />
</test>
</configuration>