Witam
Brykam się z uruchomieniem testów.
Postępowałem zgodnie z:
https://criterion.readthedocs.io/en/master/setup.html
Nie było żadnych błęgów.
Przekleiłem prosty test:
#include <string.h>
#include <criterion/criterion.h>
Test(sample, test) {
cr_expect(strlen("Test") == 4, "Expected \"Test\" to have a length of 4.");
cr_expect(strlen("Hello") == 4, "This will always fail, why did I add this?");
cr_assert(strlen("") == 0);
}
I otrzymuję błędy:
make all
Building file: ../src/Test.cpp
Invoking: GCC C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/Test.d" -MT"src/Test.o" -o "src/Test.o" "../src/Test.cpp"
Finished building: ../src/Test.cpp
Building target: MyC++
Invoking: GCC C++ Linker
g++ -o "MyC++" ./src/MyC++.o ./src/Test.o
/usr/bin/ld: ./src/Test.o: in function sample_test_jmp()': /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:4: undefined reference to
criterion_internal_test_setup'
/usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:4: undefined reference to criterion_internal_test_main' /usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:4: undefined reference to
criterion_internal_test_teardown'
/usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:4: undefined reference to criterion_test_die' /usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:4: undefined reference to
criterion_test_die'
/usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:4: undefined reference to criterion_test_die' /usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:4: undefined reference to
criterion_test_die'
/usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:4: undefined reference to criterion_test_die' /usr/bin/ld: ./src/Test.o:/home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:4: more undefined references to
criterion_test_die' follow
/usr/bin/ld: ./src/Test.o: in function sample_test_impl': /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:5: undefined reference to
criterion_options'
/usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:5: undefined reference to cr_translate_assert_msg' /usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:5: undefined reference to
cr_asprintf'
/usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:5: undefined reference to cr_asprintf_free' /usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:5: undefined reference to
cr_asprintf_free'
/usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:5: undefined reference to criterion_send_assert' /usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:5: undefined reference to
cr_asprintf_free'
/usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:5: undefined reference to criterion_continue_test' /usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:5: undefined reference to
cri_asserts_passed_incr'
/usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:6: undefined reference to criterion_options' /usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:6: undefined reference to
cr_translate_assert_msg'
/usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:6: undefined reference to cr_asprintf' /usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:6: undefined reference to
cr_asprintf_free'
/usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:6: undefined reference to cr_asprintf_free' /usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:6: undefined reference to
criterion_send_assert'
/usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:6: undefined reference to cr_asprintf_free' /usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:6: undefined reference to
criterion_continue_test'
/usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:6: undefined reference to cri_asserts_passed_incr' /usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:7: undefined reference to
criterion_options'
/usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:7: undefined reference to cr_translate_assert_msg' /usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:7: undefined reference to
cr_asprintf'
/usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:7: undefined reference to cr_asprintf_free' /usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:7: undefined reference to
cr_asprintf_free'
/usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:7: undefined reference to criterion_send_assert' /usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:7: undefined reference to
cr_asprintf_free'
/usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:7: undefined reference to criterion_abort_test' /usr/bin/ld: /home/bq666/Workspace/eclipse/MyC++/Debug/../src/Test.cpp:7: undefined reference to
cri_asserts_passed_incr'
/usr/bin/ld: ./src/Test.o:(.rodata+0x10): undefined reference to cr_malloc' /usr/bin/ld: ./src/Test.o:(.rodata+0x18): undefined reference to
cr_free'
/usr/bin/ld: ./src/Test.o:(.rodata+0x20): undefined reference to cr_calloc' /usr/bin/ld: ./src/Test.o:(.rodata+0x28): undefined reference to
cr_realloc'
/usr/bin/ld: ./src/Test.o:(.rodata+0x30): undefined reference to cr_log' /usr/bin/ld: ./src/Test.o: in function
criterion::logging::streambuf::sync()':
/usr/local/include/criterion/logging.h:162: undefined reference to `cr_log'
collect2: error: ld returned 1 exit status
make: *** [makefile:47: MyC++] Error 1
"make all" terminated with exit code 2. Build might be incomplete.
Pracuję na Eclipsie
Będę wdzięczny za nakierowanie gdzie szukać przyczyny błędów.
Pozdrawiam