Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-8251

Fail unit tests with more friendly output if the boost-test library is not present

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • qpid-cpp-1.39.0
    • None
    • C++ Broker
    • None

    Description

      If the boost-test library is not present, cmake logs a warning:
      "-- Could not find unit testing library - will not build unit tests"

      (seeĀ https://issues.apache.org/jira/browse/QPID-5260)

      This is easy to miss and leads to a failure in the unit tests with some rather ugly output (see test output below) due to the unit_tests binary and indeed entire make target not being created.

      Those unfamiliar with the testing framework (like me) may spend quite some time connecting the resulting "valgrind: unit_test: command not found" error message to the above cmake warning, so it might be nice to have eg: the "run_unit_tests" script output an additional message explaining the probable cause.

      Test output:

      run_unit_tests: Calling '/usr/bin/valgrind --leak-check=full --num-callers=25 --error-exitcode=100 --log-file=/home/chrisr/projects/git/qpid-cpp/build-1.39.0-rc1/run_unit_tests_d578/valgrind_4832.log --gen-suppressions=all --suppressions=/home/chrisr/projects/git/qpid-cpp/build-1.39.0-rc1/src/tests/.valgrind.supp – unit_test'
      valgrind: unit_test: command not found
      Traceback (most recent call last):
      {{ File "run_unit_tests", line 37, in <module>}}
      {{ call_with_valgrind("unit_test")}}
      {{ File "/home/chrisr/projects/git/qpid-cpp/build-1.39.0-rc1/src/tests/common.py", line 70, in call_with_valgrind}}
      {{ call(command, *args, **kwargs)}}
      {{ File "/home/chrisr/projects/git/qpid-cpp/build-1.39.0-rc1/src/tests/plano.py", line 418, in call}}
      {{ _subprocess.check_call(command, **kwargs)}}
      {{ File "/usr/lib/python2.7/subprocess.py", line 190, in check_call}}
      {{ raise CalledProcessError(retcode, cmd)}}
      subprocess.CalledProcessError: Command '/usr/bin/valgrind --leak-check=full --num-callers=25 --error-exitcode=100 --log-file=/home/chrisr/projects/git/qpid-cpp/build-1.39.0-rc1/run_unit_tests_d578/valgrind_4832.log --gen-suppressions=all --suppressions=/home/chrisr/projects/git/qpid-cpp/build-1.39.0-rc1/src/tests/.valgrind.supp – unit_test' returned non-zero exit status 127

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              crichardson Chris Richardson
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: