-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
/* Test.cpp */
#include <unity.h>
#include "functions.h"
void test_something_specific_to_this_test_file_ok() {
TEST_ASSERT_TRUE(true);
}
void test_something_specific_to_this_test_file_fail() {
TEST_ASSERT_TRUE(false); // line 10
}
int main() {
UNITY_BEGIN();
RUN_TEST(test_something_specific_to_this_test_file_ok); // line 16
RUN_TEST(test_something_specific_to_this_test_file_fail); // line 17
RUN_TEST(test_something_more_universal_from_the_other_file); // line 19
return UNITY_END();
}/* functions.h */
#include <unity.h>
void test_something_more_universal_from_the_other_file() {
TEST_ASSERT_TRUE(false); // line 5
}The result I get:
Building...
Testing...
test/native/test_including/Test.cpp:16: test_something_specific_to_this_test_file_ok [PASSED]
test/native/test_including/Test.cpp:10: test_something_specific_to_this_test_file_fail: Expected TRUE Was FALSE [FAILED]
test/native/test_including/Test.cpp:5: test_something_more_universal_from_the_other_file: Expected TRUE Was FALSE [FAILED]
Program received signal SIGINT (Interrupt: 2)
----------- native:native/test_including [ERRORED] Took 2.93 seconds -----------
For the last test, the line given 5 is OK, but the filename is wrong: Test.cpp – in reality, the assert that failed is in the functions.h file.
And that makes debugging confusing and hard.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels