Ceedling icon indicating copy to clipboard operation
Ceedling copied to clipboard

ceedling+Unity records wrong line numers for test in some cases

Open jwalkerbg opened this issue 7 years ago • 4 comments

Hello, It seems that ceedling, while generating a test runner, records wrong lines for tests in this partcular case:

// void test_MyTest(void)
// Description: This test does ....
// Expected result: ....
void test_MyTest(void)
{
...
}

Given above test, generate_test_runner.rb puts as second argument of RUN_TEST macro the line number of the line where the comment is, not where the test definition is.

However if C-like comment /* */ is used instead if C++ like comment //, generate_test_runner.rb records the line number where is the definition of the test, not the comment (which is right):

/* void test_MyTest(void) */
// Description: This test does ....
// Expected result: ....
void test_MyTest(void)
{
...
}

I tested this ceedling 0.28.2 / Unity 2.4.2.

jwalkerbg avatar Feb 23 '18 10:02 jwalkerbg

Do you have header preprocessing enabled?

mvandervoord avatar Feb 25 '18 21:02 mvandervoord

Yes, I have :use_test_preprocessor: TRUE I cannot disable it, because I use it (1) to compile groups of tests and (2) to compile variations of same functions depending on application configuration.

jwalkerbg avatar Feb 26 '18 19:02 jwalkerbg

:) I wasn't going to try to talk you out of disabling the preprocessing. I was just attempting to narrow down the situations where this problem happens.

mvandervoord avatar Feb 26 '18 19:02 mvandervoord

Hi @jwalkerbg ,

I tried to reproduce your issue at latest version of Ceedling master without success.

Ceedling:: 0.31.1
      Unity:: 2.5.4
      CMock:: 2.5.4
 CException:: 1.3.3

Do you think that we can close this ticket as no longer valid? As the issue cannot be reproduced on latest version of Ceedling?

lukzeg avatar Feb 01 '23 09:02 lukzeg