Project

General

Profile

Task #2141

Code should be compiled in debug mode for coverage tests

Added by Alex Afanasyev almost 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Category:
Build
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:

Description

Based on https://gcc.gnu.org/onlinedocs/gcc/Gcov-Intro.html#Gcov-Intro, for code coverage we should use debug mode compilation. Right now, testing is done using the optimized mode.

#1

Updated by Junxiao Shi almost 7 years ago

  • Category changed from Integration Tests to Build

Category shall be Build. "Tests" category refers to integration tests.

We should choose between

  • let --with-coverage imply --debug, or
  • raise an error if --with-coverage is enabled but --debug is disabled
#2

Updated by Alex Afanasyev almost 7 years ago

I prefer the first approach: let --with-coverage imply --debug

#3

Updated by Alex Afanasyev almost 7 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 50
#4

Updated by Alex Afanasyev almost 7 years ago

Unfortunately, I'm not seeing a clean way to implement note-2 approach. During configure stage, code coverage module is loaded after default compiler flags, making it impossible to update conf.options.debug in coverage.

Loading coverage early has an implication of forcing all configuration tests to be run with code coverage flags, which is not really desirable.

The dirty way is to combine coverage and default-compiler-flags into one, but I don't want to go this direction. At least not right now.

#5

Updated by Junxiao Shi almost 7 years ago

Could code-coverage tool detect the value of conf.options.debug?

It should raise an error when code-coverage is enabled but debug is disabled.

#6

Updated by Alex Afanasyev almost 7 years ago

Yeah. Detection is possible. I'll make an update.

#7

Updated by Junxiao Shi almost 7 years ago

  • Status changed from In Progress to Closed
  • Assignee set to Alex Afanasyev
  • % Done changed from 50 to 100

Also available in: Atom PDF