Comments (31)
We have had errors on s390x before (#226 and #227). The text in those issues indicate that they are fixed but they are not closed, I suppose we waited to get feedback on if it was really fixed with the PR that those issues refer to. Could you perhaps figure out if the error output from the failing tests are the same? (I don't have any s390x to try it on ;-)
from cgreen.
root@debian:/build/cgreen-1.6.2/build# ctest --rerun-failed --output-on-failure
Test project /build/cgreen-1.6.2/build
Start 3: runner_test_cgreen_c
1/4 Test #3: runner_test_cgreen_c .............***Failed 0.03 sec
/build/cgreen-1.6.2/build/tools/cgreen-runner: error while loading shared libraries: libcgreen.so.1: cannot open shared object file: No such file or directory
Start 6: runner_test_cgreen_cpp
2/4 Test #6: runner_test_cgreen_cpp ...........***Failed 0.02 sec
/build/cgreen-1.6.2/build/tools/cgreen-runner: error while loading shared libraries: libcgreen.so.1: cannot open shared object file: No such file or directory
Start 7: constraint_messsages
3/4 Test #7: constraint_messsages .............***Failed 0.95 sec
Comparing output of constraint_messages_tests to expected:
*** constraint_messages_tests.output.normalized Mon Sep 4 14:54:24 2023
--- /build/cgreen-1.6.2/tests/constraint_messages_tests.expected Thu Feb 9 14:35:04 2023
***************
*** 1 ****
! ../tools/cgreen-runner: error while loading shared libraries: libcgreen.so.1: cannot open shared object file: No such file or directory
--- 1,163 ----
! Running "constraint_messages_tests" (37 tests)...
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_always_followed_by_expectation
! Mocked function [some_mock] already has an expectation that it will always be called a certain way; any expectations declared after an always expectation are invalid
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_assert_that
! Expected [0 == 1] to [be true]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_begins_with_string
! Expected [does_not_begin_with_forty_five] to [begin with string] [forty_five]
! actual value: ["this string does not begin with fortyfive"]
! expected to begin with: ["fortyfive"]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_contains_string
! Expected [not_containing_forty_five] to [contain string] [forty_five]
! actual value: ["this text is thirtythree"]
! expected to contain: ["fortyfive"]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_does_not_begin_with_string
! Expected [begins_with_forty_five] to [not begin with string] [forty_five]
! actual value: ["fortyfive is the start of this"]
! expected to not begin with: ["fortyfive"]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_does_not_contain_string
! Expected [contains_forty_five] to [not contain string] [forty_five]
! actual value: ["this string is fortyfive"]
! expected to not contain: ["fortyfive"]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_does_not_end_with_string
! Expected [ends_with_forty_five] to [not end with string] [forty_five]
! actual value: ["this string ends with fortyfive"]
! expected to not end with: ["fortyfive"]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_ends_with_string
! Expected [does_not_end_with_forty_five] to [end with string] [forty_five]
! actual value: ["fortyfive is not the end of this string"]
! expected to end with: ["fortyfive"]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_equal_to_double
! Expected [0] to [equal double] [1] within [8] significant figures
! actual value: [0.000000]
! expected value: [1.000000]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_equal_to_double_negative
! Expected [-1] to [equal double] [-2] within [8] significant figures
! actual value: [-1.000000]
! expected value: [-2.000000]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_equal_to
! Expected [forty_five] to [equal] [thirty_three]
! actual value: [45]
! expected value: [33]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_equal_to_contents_of
! Expected [thirty_three] to [equal contents of] [forty_five]
! at offset: [2]
! actual value: [0x21]
! expected value: [0x2b]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_equal_to_double
! Expected [four_point_five] to [equal double] [three_point_three] within [8] significant figures
! actual value: [4.500000]
! expected value: [3.300000]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_equal_to_hex
! Expected [(unsigned char) bytes[0]] to [equal] [0xbb]
! actual value: [0xaa]
! expected value: [0xbb]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_equal_to_string
! Expected [thirty_three] to [equal string] [forty_five]
! actual value: ["this string is thirtythree"]
! expected to equal: ["this string is fortyfive"]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_greater_than
! Expected [thirty_three] to [be greater than] [forty_five]
! actual value: [33]
! expected to be greater than: [45]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_greater_than_double
! Expected [three_point_three] to [be greater than double] [four_point_five] within [8] significant figures
! actual value: [3.300000]
! expected value: [4.500000]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_greater_than_double_with_accuracy
! Expected [1.0] to [be greater than double] [1.0 + 1.0e-3 + DBL_EPSILON] within [4] significant figures
! actual value: [1.000000]
! expected value: [1.001000]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_less_than
! Expected [forty_five] to [be less than] [thirty_three]
! actual value: [45]
! expected to be less than: [33]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_less_than_double
! Expected [four_point_five] to [be less than double] [three_point_three] within [8] significant figures
! actual value: [4.500000]
! expected value: [3.300000]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_less_than_double_with_accuracy
! Expected [1.0] to [be less than double] [1.0 - 1.0e-3 - DBL_EPSILON] within [4] significant figures
! actual value: [1.000000]
! expected value: [0.999000]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_non_null
! Expected [pointer] to [be non null]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_not_equal_to
! Expected [should_not_be_forty_five] to [not equal] [forty_five]
! actual value: [45]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_not_equal_to_contents_of
! Expected [forty_five_and_up] to [not equal contents of] [another_forty_five_and_up]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_not_equal_to_double
! Expected [four_point_five] to [not equal double] [almost_four_point_five] within [4] significant figures
! actual value: [4.500000]
! expected value: [4.499900]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_not_equal_to_string
! Expected [another_forty_five] to [not equal string] [forty_five]
! actual value: ["this string is fortyfive"]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_null
! Expected [pointer] to [be null]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_mock_called_more_times_than_expected
! Mocked function [some_mock] was called too many times
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_mock_called_with_unexpected_parameter_value
! Expected [[parameter] parameter in [some_mock]] to [equal] [1]
! actual value: [0]
! expected value: [1]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_mock_called_without_expectation
! Mocked function [some_mock] did not have an expectation that it would be called
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_mock_parameter_name_not_matching_constraint_parameter_name
! Mocked function [some_mock] did not define a parameter named [PARAMETER]. Did you misspell it in the expectation or forget it in the mock's argument list?
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_no_mock_parameters_with_parameter_constraint
! Mocked function [forgot_to_pass_parameters_mock] did not define a parameter named [x]. Did you misspell it in the expectation or forget it in the mock's argument list?
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_not_equal_to_double
! Expected [0] to [not equal double] [0] within [8] significant figures
! actual value: [0.000000]
! expected value: [0.000000]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_not_equal_to_double_negative
! Expected [-1] to [not equal double] [-1] within [8] significant figures
! actual value: [-1.000000]
! expected value: [-1.000000]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_violated_never_expect
! Mocked function [some_mock] has an expectation that it will never be called, but it was
!
! constraint_messages_tests.c: Exception: ConstraintMessage -> increments_exception_count_when_terminating_via_SIGQUIT
! Test terminated with signal: Quit
!
! constraint_messages_tests.c: Exception: ConstraintMessage -> increments_exception_count_when_terminating_via_SIGTERM
! Test terminated with signal: Terminated
!
! "ConstraintMessage": 35 failures, 2 exceptions in 0ms.
! Completed "constraint_messages_tests": 35 failures, 2 exceptions in 0ms.
Start 12: ignore_messages
4/4 Test #12: ignore_messages ..................***Failed 0.96 sec
Comparing output of ignore_messages_tests to expected with CGREEN_PER_TEST_TIMEOUT=2:
*** ignore_messages_tests.output.normalized Mon Sep 4 14:54:25 2023
--- /build/cgreen-1.6.2/tests/ignore_messages_tests.expected Thu Feb 9 14:35:04 2023
***************
*** 1 ****
! ../tools/cgreen-runner: error while loading shared libraries: libcgreen.so.1: cannot open shared object file: No such file or directory
--- 1,9 ----
! Running "ignore_messages_tests" (5 tests)...
! ignore_messages_tests.c: Exception: IgnoreMessage -> should_not_count_exceptions_as_ignored
! Test terminated with signal: Segmentation fault
!
! ignore_messages_tests.c: Failure: IgnoreMessage -> should_not_count_failing_tests_as_ignored
! Expected [0] to [be true]
!
! "IgnoreMessage": 1 pass, 1 skipped, 1 failure, 1 exception in 0ms.
! Completed "ignore_messages_tests": 1 pass, 1 skipped, 1 failure, 1 exception in 0ms.
0% tests passed, 4 tests failed out of 4
Total Test time (real) = 2.08 sec
The following tests FAILED:
3 - runner_test_cgreen_c (Failed)
6 - runner_test_cgreen_cpp (Failed)
7 - constraint_messsages (Failed)
12 - ignore_messages (Failed)
from cgreen.
Are you sure that this is the first error message shown? This looks like either a failed build of the library (libcgreen) or a failure to find it at dynamic load time (shared libraries are loaded at runtime).
The build script assumes that on Linux the extension for a shared library is .so
which seems to be right. But it also assumes that CMake is set up so that it uses the library built in build/src
. Can you see if there is a library file there?
from cgreen.
root@debian:/build/cgreen-1.6.2/build# find . -iname libcgreen.so*
./src/libcgreen.so.1.6.1
./src/libcgreen.so.1
./src/libcgreen.so
I also noticed the error. I tried "amd64" again with the same build procedure. "amd64" passed the test. I have no idea at this moment. I think this needs a deeper look ...
from cgreen.
Looks like the library was built with the wrong name, 1.6.1 instead of 1.6.2. I'm not sure this should make a difference, but I don't know the look-up rules for shared libraries. Can you try to rename it and see if that fixes it?
I'll have a look in the build scripts to see if I missed something when bumping to 1.6.2.
from cgreen.
Thanks for the prompt reply! Unfortunately, the result is the same.
root@debian:/build/cgreen-1.6.2/build/src# ls -l
total 840
drwxr-xr-x 3 pbuilder pbuilder 4096 Sep 4 14:28 CMakeFiles
-rw-r--r-- 1 pbuilder pbuilder 265 Sep 4 14:28 CTestTestfile.cmake
-rw-r--r-- 1 pbuilder pbuilder 32828 Sep 4 14:28 Makefile
-rw-r--r-- 1 pbuilder pbuilder 2505 Sep 4 14:28 cmake_install.cmake
lrwxrwxrwx 1 pbuilder pbuilder 14 Sep 4 14:30 libcgreen.so -> libcgreen.so.1
lrwxrwxrwx 1 root root 18 Sep 4 15:22 libcgreen.so.1 -> libcgreen.so.1.6.2
-rwxr-xr-x 1 pbuilder pbuilder 405504 Sep 4 14:30 libcgreen.so.1.6.1
-rwxr-xr-x 1 pbuilder pbuilder 405504 Sep 4 15:21 libcgreen.so.1.6.2
from cgreen.
Sorry ... I think I see merge mistakes on my side. I will fix it and run the test again. Apologize for taking your time ...
from cgreen.
No problem. (crossing fingers...)
from cgreen.
I think I merge the code correctly, but the result looks the same.
debian source code: https://salsa.debian.org/gavinlai-guest/cgreen
Test project /build/cgreen-1.6.2/build
Start 3: runner_test_cgreen_c
1/4 Test #3: runner_test_cgreen_c .............***Failed 0.03 sec
/build/cgreen-1.6.2/build/tools/cgreen-runner: error while loading shared libraries: libcgreen.so.1: cannot open shared object file: No such file or directory
Start 6: runner_test_cgreen_cpp
2/4 Test #6: runner_test_cgreen_cpp ...........***Failed 0.02 sec
/build/cgreen-1.6.2/build/tools/cgreen-runner: error while loading shared libraries: libcgreen.so.1: cannot open shared object file: No such file or directory
Start 7: constraint_messsages
3/4 Test #7: constraint_messsages .............***Failed 0.85 sec
Comparing output of constraint_messages_tests to expected:
*** constraint_messages_tests.output.normalized Sun Sep 10 14:35:32 2023
--- /build/cgreen-1.6.2/tests/constraint_messages_tests.expected Mon May 15 11:23:06 2023
***************
*** 1 ****
! ../tools/cgreen-runner: error while loading shared libraries: libcgreen.so.1: cannot open shared object file: No such file or directory
--- 1,163 ----
! Running "constraint_messages_tests" (37 tests)...
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_always_followed_by_expectation
! Mocked function [some_mock] already has an expectation that it will always be called a certain way; any expectations declared after an always expectation are invalid
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_assert_that
! Expected [0 == 1] to [be true]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_begins_with_string
! Expected [does_not_begin_with_forty_five] to [begin with string] [forty_five]
! actual value: ["this string does not begin with fortyfive"]
! expected to begin with: ["fortyfive"]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_contains_string
! Expected [not_containing_forty_five] to [contain string] [forty_five]
! actual value: ["this text is thirtythree"]
! expected to contain: ["fortyfive"]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_does_not_begin_with_string
! Expected [begins_with_forty_five] to [not begin with string] [forty_five]
! actual value: ["fortyfive is the start of this"]
! expected to not begin with: ["fortyfive"]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_does_not_contain_string
! Expected [contains_forty_five] to [not contain string] [forty_five]
! actual value: ["this string is fortyfive"]
! expected to not contain: ["fortyfive"]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_does_not_end_with_string
! Expected [ends_with_forty_five] to [not end with string] [forty_five]
! actual value: ["this string ends with fortyfive"]
! expected to not end with: ["fortyfive"]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_ends_with_string
! Expected [does_not_end_with_forty_five] to [end with string] [forty_five]
! actual value: ["fortyfive is not the end of this string"]
! expected to end with: ["fortyfive"]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_equal_to_double
! Expected [0] to [equal double] [1] within [8] significant figures
! actual value: [0.000000]
! expected value: [1.000000]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_equal_to_double_negative
! Expected [-1] to [equal double] [-2] within [8] significant figures
! actual value: [-1.000000]
! expected value: [-2.000000]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_equal_to
! Expected [forty_five] to [equal] [thirty_three]
! actual value: [45]
! expected value: [33]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_equal_to_contents_of
! Expected [thirty_three] to [equal contents of] [forty_five]
! at offset: [2]
! actual value: [0x21]
! expected value: [0x2b]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_equal_to_double
! Expected [four_point_five] to [equal double] [three_point_three] within [8] significant figures
! actual value: [4.500000]
! expected value: [3.300000]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_equal_to_hex
! Expected [(unsigned char) bytes[0]] to [equal] [0xbb]
! actual value: [0xaa]
! expected value: [0xbb]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_equal_to_string
! Expected [thirty_three] to [equal string] [forty_five]
! actual value: ["this string is thirtythree"]
! expected to equal: ["this string is fortyfive"]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_greater_than
! Expected [thirty_three] to [be greater than] [forty_five]
! actual value: [33]
! expected to be greater than: [45]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_greater_than_double
! Expected [three_point_three] to [be greater than double] [four_point_five] within [8] significant figures
! actual value: [3.300000]
! expected value: [4.500000]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_greater_than_double_with_accuracy
! Expected [1.0] to [be greater than double] [1.0 + 1.0e-3 + DBL_EPSILON] within [4] significant figures
! actual value: [1.000000]
! expected value: [1.001000]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_less_than
! Expected [forty_five] to [be less than] [thirty_three]
! actual value: [45]
! expected to be less than: [33]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_less_than_double
! Expected [four_point_five] to [be less than double] [three_point_three] within [8] significant figures
! actual value: [4.500000]
! expected value: [3.300000]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_less_than_double_with_accuracy
! Expected [1.0] to [be less than double] [1.0 - 1.0e-3 - DBL_EPSILON] within [4] significant figures
! actual value: [1.000000]
! expected value: [0.999000]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_non_null
! Expected [pointer] to [be non null]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_not_equal_to
! Expected [should_not_be_forty_five] to [not equal] [forty_five]
! actual value: [45]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_not_equal_to_contents_of
! Expected [forty_five_and_up] to [not equal contents of] [another_forty_five_and_up]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_not_equal_to_double
! Expected [four_point_five] to [not equal double] [almost_four_point_five] within [4] significant figures
! actual value: [4.500000]
! expected value: [4.499900]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_not_equal_to_string
! Expected [another_forty_five] to [not equal string] [forty_five]
! actual value: ["this string is fortyfive"]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_is_null
! Expected [pointer] to [be null]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_mock_called_more_times_than_expected
! Mocked function [some_mock] was called too many times
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_mock_called_with_unexpected_parameter_value
! Expected [[parameter] parameter in [some_mock]] to [equal] [1]
! actual value: [0]
! expected value: [1]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_mock_called_without_expectation
! Mocked function [some_mock] did not have an expectation that it would be called
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_mock_parameter_name_not_matching_constraint_parameter_name
! Mocked function [some_mock] did not define a parameter named [PARAMETER]. Did you misspell it in the expectation or forget it in the mock's argument list?
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_no_mock_parameters_with_parameter_constraint
! Mocked function [forgot_to_pass_parameters_mock] did not define a parameter named [x]. Did you misspell it in the expectation or forget it in the mock's argument list?
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_not_equal_to_double
! Expected [0] to [not equal double] [0] within [8] significant figures
! actual value: [0.000000]
! expected value: [0.000000]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_not_equal_to_double_negative
! Expected [-1] to [not equal double] [-1] within [8] significant figures
! actual value: [-1.000000]
! expected value: [-1.000000]
!
! constraint_messages_tests.c: Failure: ConstraintMessage -> for_violated_never_expect
! Mocked function [some_mock] has an expectation that it will never be called, but it was
!
! constraint_messages_tests.c: Exception: ConstraintMessage -> increments_exception_count_when_terminating_via_SIGQUIT
! Test terminated with signal: Quit
!
! constraint_messages_tests.c: Exception: ConstraintMessage -> increments_exception_count_when_terminating_via_SIGTERM
! Test terminated with signal: Terminated
!
! "ConstraintMessage": 35 failures, 2 exceptions in 0ms.
! Completed "constraint_messages_tests": 35 failures, 2 exceptions in 0ms.
Start 12: ignore_messages
4/4 Test #12: ignore_messages ..................***Failed 0.93 sec
Comparing output of ignore_messages_tests to expected with CGREEN_PER_TEST_TIMEOUT=2:
*** ignore_messages_tests.output.normalized Sun Sep 10 14:35:33 2023
--- /build/cgreen-1.6.2/tests/ignore_messages_tests.expected Mon May 15 11:23:06 2023
***************
*** 1 ****
! ../tools/cgreen-runner: error while loading shared libraries: libcgreen.so.1: cannot open shared object file: No such file or directory
--- 1,9 ----
! Running "ignore_messages_tests" (5 tests)...
! ignore_messages_tests.c: Exception: IgnoreMessage -> should_not_count_exceptions_as_ignored
! Test terminated with signal: Segmentation fault
!
! ignore_messages_tests.c: Failure: IgnoreMessage -> should_not_count_failing_tests_as_ignored
! Expected [0] to [be true]
!
! "IgnoreMessage": 1 pass, 1 skipped, 1 failure, 1 exception in 0ms.
! Completed "ignore_messages_tests": 1 pass, 1 skipped, 1 failure, 1 exception in 0ms.
0% tests passed, 4 tests failed out of 4
Total Test time (real) = 1.94 sec
The following tests FAILED:
3 - runner_test_cgreen_c (Failed)
6 - runner_test_cgreen_cpp (Failed)
7 - constraint_messsages (Failed)
12 - ignore_messages (Failed)
root@debian:/build/cgreen-1.6.2/build/src# ls -l
total 444
drwxr-xr-x 3 pbuilder pbuilder 4096 Sep 10 06:12 CMakeFiles
-rw-r--r-- 1 pbuilder pbuilder 265 Sep 10 06:12 CTestTestfile.cmake
-rw-r--r-- 1 pbuilder pbuilder 32828 Sep 10 06:12 Makefile
-rw-r--r-- 1 pbuilder pbuilder 2505 Sep 10 06:12 cmake_install.cmake
lrwxrwxrwx 1 pbuilder pbuilder 14 Sep 10 06:13 libcgreen.so -> libcgreen.so.1
lrwxrwxrwx 1 pbuilder pbuilder 18 Sep 10 06:13 libcgreen.so.1 -> libcgreen.so.1.6.2
-rwxr-xr-x 1 pbuilder pbuilder 405504 Sep 10 06:13 libcgreen.so.1.6.2
from cgreen.
One strange thing: why is there only 4 tests? When I run make test
in the top directory or ctest
in the build directory (which are basically the same) I get "0 tests failed out of 30".
Can you try the following command in the Cgreens build/test directory:
./test_cgreen_c
If that fails with the same message as above ("error while loading shared libraries: libcgreen.so.1"), try
LD_LIBRARY_PATH=../src ./test_cgreen_c
If any of those ends with a line something like
Completed "all_c_tests": 350 passes in 80ms.
then there is something wrong with how this environment looks up shared libraries that are different from "normal", or CMake
does not handle loading of shared libraries "correctly".
from cgreen.
Thanks for your prompt reply.
The result of s390 (running in Qemu) is as follows:
root@debian:/build/cgreen-1.6.2/build/tests# ./test_cgreen_c
./test_cgreen_c: error while loading shared libraries: libcgreen.so.1: cannot open shared object file: No such file or directory
root@debian:/build/cgreen-1.6.2/build/tests# LD_LIBRARY_PATH=../src ./test_cgreen_c
Running "all_c_tests" (181 tests)...
"assertion_tests": 62 passes in 481ms.
"breadcrumb_tests": 9 passes in 106ms.
"cgreen_value_tests": 10 passes in 57ms.
"cdash_reporter_tests": 10 passes in 113ms.
"constraint_tests": 29 passes in 195ms.
"cute_reporter_tests": 15 passes in 67ms.
"message_formatting_tests": 2 passes in 13ms.
"highly_nested_test_suite": 1 pass in 10ms.
"highly_nested_test_suite": No assertions.
...
"highly_nested_test_suite": No assertions.
"highly_nested_test_suite": No assertions.
"messaging_tests": 4 passes in 42ms.
"mock_tests": 74 passes in 472ms.
"parameter_tests": 35 passes in 186ms.
"reflective_no_teardown_tests": 2 passes in 24ms.
"reflective_tests": 2 passes in 22ms.
"text_reporter_tests": 7 passes in 58ms.
"unit_tests": 3 passes in 37ms.
"vector_tests": 25 passes in 173ms.
"xml_reporter_tests": 17 passes in 155ms.
"libxml_reporter_tests": 43 passes in 328ms.
Completed "all_c_tests": 350 passes in 2597ms.
from cgreen.
So, with the LD_LIBRARY_PATH set it loads the library correctly and passes all test in that suite.
Again, I suspect that the environment in which the Cgreen tests are run are not set up correctly (= same as on other machines) wrt. how shared libraries are found and loaded. If it were the tests would pass.
Do you use CMake to build and run the tests? Do you know if that's the same version as on other machines? Is it only on s390 it fails? And succeeds on all other architectures?
Sorry, I don't know what else to suggest, apart from blaming CMake or the OS.
from cgreen.
I've uploaded the 1.6.2 version to the experimental distribution.
The build results of every architecture are listed at https://buildd.debian.org/status/package.php?p=cgreen&suite=experimental
Not all the build statuses are completed at this moment. At least "s390x", "powerpc" and "ppc64" indicate some testing failure. You can get the detailed build log by clicking the text in the "Status" column.
I also found that the information on this web page may be helpful: https://wiki.debian.org/ArchitectureSpecificsMemo
It is very welcome to share any thoughts from your side : )
from cgreen.
Thanks for that page!
Could you paste the indicated log file (/<<PKGBUILDDIR>>/build/Testing/Temporary/LastTest.log
), please?
(Edited this comment, since the previous one was a red herring and would not have given any new information, sorry if you did read it before I did that...)
from cgreen.
Or... can you check if the output in the log file contains something like this as the error output for the failing test:
Comparing output of mock_messages_tests to expected:
*** mock_messages_tests.output.normalized Tue Sep 19 10:34:51 2023
--- /Users/thomas/Utveckling/Cgreen/cgreen-devs/cgreen/tests/mock_messages_tests.expected Sun Aug 6 15:28:59 2023
***************
*** 10,19 ****
mock_messages_tests.c:000: Failure: Mocks -> can_declare_function_never_called
Mocked function [sample_mock] has an expectation that it will never be called, but it was
- ***-> Calling mocked 'fun' with (all values shown as integer as type information is not availble)
- *** i = 7 (0x7)
- *** s = 4330520482 (0x1021e7fa2)
- ***<- returning 42
mock_messages_tests.c:000: Failure: Mocks -> constraint_number_of_calls_out_of_order_expectations_fail
Expected [[first] parameter in [simple_mocked_function]] to [equal] [1]
actual value: [2]
--- 10,15 ----
If it does, I might have a clue to why the tests fail.
from cgreen.
Ignore that. Looking at completely wrong things...
from cgreen.
Could you paste the indicated log file (/<>/build/Testing/Temporary/LastTest.log), please?
Based on my knowledge, the buildd does not keep the data. So, I am considering uploading a second revision to experimental distribution to collect the information for debugging.
I would like to cat /<<PKGBUILDDIR>>/build/Testing/Temporary/LastTest.log
when the make test
fails. Is there any other thing that may help? I want to add it to the second revision.
Thanks!
from cgreen.
Nothing that comes to mind at this point. Maybe after seeing the logs ;-)
from cgreen.
I have uploaded the second revision (1.6.2-1~exp2) to experimental distribution: https://buildd.debian.org/status/package.php?p=cgreen&suite=experimental
This is the log of s390x: https://buildd.debian.org/status/fetch.php?pkg=cgreen&arch=s390x&ver=1.6.2-1%7Eexp2&stamp=1695568441&raw=0
from cgreen.
Thanks. It looks like all the actual tests passed. The suspicius and the lines that fails the run is
+------------------------------------------------------------------------------+
| Cleanup |
+------------------------------------------------------------------------------+
Purging /<<BUILDDIR>>
Not cleaning session: cloned chroot in use
E: Build failure (dpkg-buildpackage died)
from cgreen.
Do test case 3 & test case 6 actually pass the test?
The summary indicates two of the test cases fail
3/30 Test #3: runner_test_cgreen_c ...............................................***Failed 0.13 sec
Start 4: test_cgreen_cpp
4/30 Test #4: test_cgreen_cpp .................................................... Passed 0.06 sec
Start 5: test_cgreen_cpp_run_named_test
5/30 Test #5: test_cgreen_cpp_run_named_test ..................................... Passed 0.00 sec
Start 6: runner_test_cgreen_cpp
6/30 Test #6: runner_test_cgreen_cpp .............................................***Failed 0.14 sec
from cgreen.
Yeah, sorry. I was scrolling on my phone and missed the actual output from running those two tests. The 46th and 47th hit on "fail" in the log are actual fails. There is very little output. I'll dig further when I get home.
from cgreen.
Those two tests both somehow signal failure. If you search for "-x"
(including the quotes) in the logs, you will find their actual output.
They both generate the test results in XML-output in files called TEST-*.xml. That's why they are, and should be, as silent as they are. No output on the console.
So why do they fail? I have no idea. I've ran the exact same command on Linux x86-64 and MacOS arm64 and get no errors or return codes indicating anything. I've also ran they under valgrind
to see if there is any lurking memory issue, to no avail.
In my environments the generated files from those tests, TEST-*.xml
, indicate no errors either.
The only thing I can think of right now is to get the content of those XML-files using cat TEST-*.xml
straight after the build.
I noticed that those two tests also fail on PPC64, Sparc64 and PowerPC. On PowerPC there was additional failures on two other tests, all which are actually the same suite of tests, just compiled with C resp. C++ and run either as a compiled executable or dynamically loaded library.
The PowerPC output indicates, the highly_nested_test_suite
might fail in a different fashion than expected. (It concerns handling of a full message queue and giving nice feedback for that, which is tricky to do).
To test this last theory (guess, really...) we could disable the highly_nested_test_suite
by adding an single x
in front of that test inside messaging_tests.c
line 14:
Ensure(highly_nested_test_suite_should_still_complete) {
change that to
xEnsure(highly_nested_test_suite_should_still_complete) {
from cgreen.
The following are the messages I found in my qemu environment
root@debian:/build/cgreen-1.6.2/build/tests# grep -nr "failure message" -A 10 TEST*.xml
TEST-libcgreen_cpp_tests-Mocks.xml:8: <failure message="Expected [captured_first] to [equal] [1]
TEST-libcgreen_cpp_tests-Mocks.xml-9- actual value: [0]
TEST-libcgreen_cpp_tests-Mocks.xml-10- expected value: [1]">
TEST-libcgreen_cpp_tests-Mocks.xml-11- <location file="/build/cgreen-1.6.2/tests/mocks_tests.c" line="444"/>
TEST-libcgreen_cpp_tests-Mocks.xml-12- </failure>
TEST-libcgreen_cpp_tests-Mocks.xml:13: <failure message="Expected [captured_second] to [equal] [2]
TEST-libcgreen_cpp_tests-Mocks.xml-14- actual value: [0]
TEST-libcgreen_cpp_tests-Mocks.xml-15- expected value: [2]">
TEST-libcgreen_cpp_tests-Mocks.xml-16- <location file="/build/cgreen-1.6.2/tests/mocks_tests.c" line="445"/>
TEST-libcgreen_cpp_tests-Mocks.xml-17- </failure>
TEST-libcgreen_cpp_tests-Mocks.xml-18- </testcase>
TEST-libcgreen_cpp_tests-Mocks.xml-19- <testcase classname="libcgreen_cpp_tests/Mocks" name="can_mock_a_function_macro" time="0.01300">
TEST-libcgreen_cpp_tests-Mocks.xml-20- </testcase>
TEST-libcgreen_cpp_tests-Mocks.xml-21- <testcase classname="libcgreen_cpp_tests/Mocks" name="can_mock_full_function_call" time="0.02000">
TEST-libcgreen_cpp_tests-Mocks.xml-22- </testcase>
TEST-libcgreen_cpp_tests-Mocks.xml-23- <testcase classname="libcgreen_cpp_tests/Mocks" name="can_mock_full_function_call_when_there_is_no_space_between_parameters" time="0.01700">
--
TEST-libcgreen_c_tests-Mocks.xml:10: <failure message="Expected [captured_first] to [equal] [1]
TEST-libcgreen_c_tests-Mocks.xml-11- actual value: [0]
TEST-libcgreen_c_tests-Mocks.xml-12- expected value: [1]">
TEST-libcgreen_c_tests-Mocks.xml-13- <location file="/build/cgreen-1.6.2/tests/mocks_tests.c" line="444"/>
TEST-libcgreen_c_tests-Mocks.xml-14- </failure>
TEST-libcgreen_c_tests-Mocks.xml:15: <failure message="Expected [captured_second] to [equal] [2]
TEST-libcgreen_c_tests-Mocks.xml-16- actual value: [0]
TEST-libcgreen_c_tests-Mocks.xml-17- expected value: [2]">
TEST-libcgreen_c_tests-Mocks.xml-18- <location file="/build/cgreen-1.6.2/tests/mocks_tests.c" line="445"/>
TEST-libcgreen_c_tests-Mocks.xml-19- </failure>
TEST-libcgreen_c_tests-Mocks.xml-20- </testcase>
TEST-libcgreen_c_tests-Mocks.xml-21- <testcase classname="libcgreen_c_tests/Mocks" name="can_mock_a_function_macro" time="0.01300">
TEST-libcgreen_c_tests-Mocks.xml-22- </testcase>
TEST-libcgreen_c_tests-Mocks.xml-23- <testcase classname="libcgreen_c_tests/Mocks" name="can_mock_full_function_call" time="0.01700">
TEST-libcgreen_c_tests-Mocks.xml-24- </testcase>
TEST-libcgreen_c_tests-Mocks.xml-25- <testcase classname="libcgreen_c_tests/Mocks" name="can_mock_full_function_call_when_there_is_no_space_between_parameters" time="0.01700">
Another piece of information is that the bugzilla 2068898 – cgreen's test fails on s390x (redhat.com) maybe state the same observation.
I have not studied whether the "capture" feature is architecture-dependent.
Feel free to give any feedback : )
from cgreen.
Thank you very much! Finally something to go on. I'll investigate.
from cgreen.
The code for the "capture parameter" feature might be sensitive to architecture differences.
The sensitive code is this line (611 or there about, in constraint.c
):
memmove(constraint->expected_value.value.pointer_value, &actual.value, constraint->size_of_expected_value);
It assumes that it is possible to save the address to a local variable (in this case in the test), and the size of that variable, (constraint->expected_value.value.pointer_value
& constraint->size_of_expected_value
) and later use that to copy (move) the actual value of a parameter to it.
The problematic part here is that the type of the actual value is not known so the code uses actual.value
which in fact is a union of fields with some possible supported types like a pointer, and intptr_t
.
If int
and intptr_t
are different sizes the copy might do
bad things ;-)
For example if int
is 4 bytes and intptr_t
is 8 then the alignment in the union and the ended-ness of the storage matters:
When an int
is converted to an intptr_t
it is filled with leading zeros, so assuming an int
of 0xabcd
it will turn into 0x0000abcd
if we are running on a big-endian (which s390x is), it will be stored like this:
! 0 ! 1 ! 2 ! 3 ! 4 ! 5 ! 6 ! 7 !
! 0 ! 0 ! 0 ! 0 ! a ! b ! c ! d !
and copying 4 bytes from this to the local int
variable will copy the zeros instead of the actual value.
I'll have to figure out how to handle this.
Meanwhile, we could disable this test and document the fact that capture parameter
is only working on little-endian machines. Not a good option, but possible...
from cgreen.
I managed to add an s390x architecture to the Travis CI and it failed with the expected output, so that's a good step (and we will never have an "s390x problem" surprising us again...).
Now for a fix...
from cgreen.
Ok, so the commit e014a7a should fix the problem. You actually only need the part in src/constraint.c
, whichever is easier.
How do you want to proceed from here? Take the patch and see if the other builds (PowerPC, ppc64 and Sparc64) also pass? There's a chance that they will, since they also are, at least basically, bigendians.
from cgreen.
Thanks for the great work!
I also double-checked the cgreen with commit (e014a7a). It passed test case 3 and test case 6. So, I think we can close this issue : )
Regarding PowerPC, ppc64, and Sparc64, it seems debootstrap does not support these architectures. Maybe it is because they are not official support [1]. I cannot locally build the environment for testing.
I plan to upload a version with the commit (e014a7a) to the 'unstable' distribution because all the official supported architectures can pass the test. A patch in Debian or a newer version release from this upstream is acceptable to me.
[1] : https://wiki.debian.org/SupportedArchitectures
from cgreen.
Thanks for your support!
By "newer version release from this upstream" you mean a new release, 1.6.3, in the Cgreen repo?
(I mentioned you, @gavin09, in a new discussion about building on s390x: #324, perhaps you can help or give some pointers.)
from cgreen.
There is now a new release, 1.6.3, available.
from cgreen.
Related Issues (20)
- CMake warning: Could NOT find LibBfd HOT 4
- Never seem to get a cgreen-runner executable HOT 5
- The libbfd dependence issue in Debian HOT 14
- Test helper scripts should use sh instead of bash for maximum portability
- Revert dependency on libbfd HOT 1
- Make learning mocks print immediately HOT 4
- Add documentation on compile time configuration
- create_xml_reporter() crashes on MSYS platform HOT 2
- CUTE reporter final report statistics zero
- CUTE reporter per test time invalid HOT 2
- Option for unbuffered stdout for cgreen-runner HOT 1
- cannot pass unit test in i386 HOT 8
- Test signal HOT 1
- [1.6.2] Version marked as 1.6.1 in the Cmake file HOT 1
- "cgreen-runner --quiet" results in "unrecognised option" HOT 3
- "cgreen-runner --verbose" is not HOT 2
- Default text reporter does not show names of failed tests HOT 2
- offer a mechanism to skip tests at runtime HOT 2
- Use custom reporter with cgreen-runner
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cgreen.