UTBotCpp
UTBotCpp copied to clipboard
Automatically update 'compile_commands.json' when build configuration changes.
Description
Changing CMake configuration files doesn't lead to regeneration of compile_commands.json, so UBot fails to generate tests and provides no help to resolve the problem.
To Reproduce
- Create simple project with some valid code in
helloworld.candCMakeLists.txtwith following content
cmake_minimum_required(VERSION 3.10)
project(helloworld)
add_executable(helloworld helloworld.c)
- Generate tests for the
helloworld.c- everything is okay. - Rename
helloworld.cfile toanotherhelloworld.c - Update
CMakeLists.txtwith new file name - Try to regenerate test - UTbot fails with error, which could be confusing for new user:
compile_commands.json doesn't contain a command for source file /home/utbot/remote/SampleDocker2/anotherhelloworld.c
Expected behavior
- Whenever UTbot can it should try to regenerate
compile_commands.jsonwhen CMake (or other build system) configuration updated - Additionally we could update error message, so it would describe problem in simple words and suggest what user can do to resolve the problem. Please note that user doesn't know what is
compile_commands.json, where it is located and why there is no command there.