[lit] Fix test that relied on "single process" mode
authorJulian Lettner <julian.lettner@apple.com>
Tue, 31 Mar 2020 04:35:42 +0000 (21:35 -0700)
committerJulian Lettner <julian.lettner@apple.com>
Tue, 31 Mar 2020 04:58:48 +0000 (21:58 -0700)
commit1e8900cc828bd62fdcc314283c991080bae4520c
tree0a53a94027c0b4d0b4366a79aab2720f32d97ca6
parentf3c329986cf4349eb45a3e551f936d2b01a03ed5
[lit] Fix test that relied on "single process" mode

The shtest-inject test relied on being executed in "single process" mode
and started to fail with a `PicklingError` after it was removed:
```
  Can't pickle <class 'lit.TestingConfig.CustomFormat'>: attribute
  lookup lit.TestingConfig.CustomFormat failed
```

This happened because the test config has to be serialized to the worker
process, but apparently the `CustomFormat` class defined inline is not
serializable.

This change allows passing the tested functionality (preamble_commands)
directly to `lit.formats.ShTest` so we can use it directly in the test.
llvm/utils/lit/lit/formats/shtest.py
llvm/utils/lit/tests/Inputs/shtest-inject/lit.cfg
llvm/utils/lit/tests/shtest-inject.py