UTBotCpp icon indicating copy to clipboard operation
UTBotCpp copied to clipboard

Automatically update 'compile_commands.json' when build configuration changes.

Open tyuldashev opened this issue 3 years ago • 0 comments

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

  1. Create simple project with some valid code in helloworld.c and CMakeLists.txt with following content
cmake_minimum_required(VERSION 3.10)
project(helloworld)
add_executable(helloworld helloworld.c)
  1. Generate tests for the helloworld.c - everything is okay.
  2. Rename helloworld.c file to anotherhelloworld.c
  3. Update CMakeLists.txt with new file name
  4. 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.json when 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.

tyuldashev avatar Aug 30 '22 10:08 tyuldashev