Commit graph

4 commits

Author SHA1 Message Date
Cole Faust
bbe2cc6191 Cleanup genrule_sandbox_test.py
In preparation for adding the ability to check all genrules in the tree.

Bug: 290816499
Test: ./build/soong/tests/genrule_sandbox_test.py extensions_db.pb
Change-Id: I6454be7e88a876a2ab1105c04f5ecda03ecd7771
2023-07-12 18:01:32 -07:00
Jason Macnak
394f1b7b86 Fix local var error, warn if no outputs, handle "}generate{"
1. UnboundLocalError: cannot access local variable 'output' where
   it is not associated with a value

2. `build/soong/tests/genrule_sandbox_test.py WmediumdServerProto_cc`
   would try to build the entire world due to 3)

3. WmediumdServerProto_cc 's module action desc had '}generate{'
   without a space which would cause 2)

Bug: b/287470077
Test: build/soong/tests/genrule_sandbox_test.py WmediumdServerProto_cc
Change-Id: Ie9d5db44195a6f700cc876ec889bd01c11e66cff
2023-06-15 10:59:20 -07:00
Liz Kammer
2fb361cfb8 Add feature to print output paths for module
Test: ./genrule_sandbox_test.py -o gen_fstab.gs201 \
    libbt_topshim_bridge_header \
    android-support-multidex-instrumentation-version
Change-Id: Ied74d727054a1bc3b447c1f10a4ee41b3fdfdf1d
2023-06-09 11:31:28 -04:00
Liz Kammer
767fad4b05 Make genrule sandbox script a python script
Unfortunately, genrules are not always available with `m`, instead we
need to know their output paths in order to build them and diff them.
Rewriting in Python lets us store module:output path maps more easily.

Test: ./genrule_sandbox_test.py gen_fstab.gs201 \
      libbt_topshim_bridge_header \
      android-support-multidex-instrumentation-version
Change-Id: If74130e5a4381cc0e1fab396ebb90dfd5a595a1c
2023-06-09 11:31:08 -04:00