[PATCH] D83759: [clangd] Fixes in lit tests

Aleksandr Platonov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 22 04:37:28 PDT 2020


ArcsinX marked an inline comment as done.
ArcsinX added inline comments.


================
Comment at: clang-tools-extra/clangd/test/background-index.test:6
+# RUN: sed -e "s|DIRECTORY|%/t|" %/t/definition.jsonrpc > %/t/definition.jsonrpc.1
+# RUN: sed -i.bak -e "s|DIRECTORY|%/t|" %/t/compile_commands.json
+# On Windows, we need the URI in didOpen to look like "uri":"file:///C:/..."
----------------
kadircet wrote:
> i don't think there's much point in dropping `-i` from only some commands.
> 
> I would suggest either:
> - dropping it from all, by changing the original files to have a `.tmpl` suffix, and dropping the suffix in sed'd versions
> - keeping it for all comments by adding a `-i.bak` to all
For `definition.jsonrpc` we have two `sed` commands and we can keep the file name unchanged without `-i` option.
But for `compile_commands.json` we have only one `sed` command and we need `-i` option to keep the file name unchanged.


> changing the original files to have a .tmpl suffix
In other tests `.1` suffix is used, that's why I use this suffix here.
E.g. `compile-commands-path-in-initialize.test`
```
# RUN: sed -e "s|INPUT_DIR|%/t.dir|g" %s > %t.test.1
...
# RUN: sed -E -e 's|"file://([A-Z]):/|"file:///\1:/|g' %t.test.1 > %t.test
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83759/new/

https://reviews.llvm.org/D83759





More information about the cfe-commits mailing list