在https://github.com/mull-project/mull的 README 文件中,我在 openssl 和 fmtlib 上尝试了他们的变异测试示例。但是,当我输入突变测试命令时:mull-cxx -test-framework=GoogleTest -mutators=math_add_mutator ./bin/core-test,我收到以下错误
parseBitcodeFile failed: Invalid record
mull-cxx: /opt/mull/tools/driver-cxx/driver-cxx.cpp:63: void LoadModuleFromBitcodeTask::operator()(LoadModuleFromBitcodeTask::iterator, LoadModuleFromBitcodeTask::iterator, LoadModuleFromBitcodeTask::Out &, mull::progress_counter &): Assertion `module && "Could not load module"' failed.
Aborted (core dumped)
更新...........
我不再收到上述错误。但是一个新的 :( 以前,我使用的是 debian mull 而不是 ubuntu。我是由下面的 docker setup 编写的。现在,当我尝试执行突变测试时,我遇到了链接问题:
Extracting bitcode from executable (threads: 1): 1/1. Finished in 0ms.
Loading bitcode files (threads: 2): 2/2. Finished in 11ms.
Could not find dynamic library: libpthread.so.0
Could not find dynamic library: libstdc++.so.6
Could not find dynamic library: libm.so.6
Could not find dynamic library: libgcc_s.so.1
Could not find dynamic library: libc.so.6
我的 mull 设置在 docker 中。我已执行以下操作来设置我的图像:
FROM ubuntu:18.04
RUN mkdir -p /tmp/home
ENV HOME /tmp/home
RUN apt-get update && apt-get upgrade -y \
&& apt-get install -y git build-essential software-properties-common\
&& apt-get install -y vim wget
RUN apt-get update
RUN apt-get install -y python3-pip \
&& pip3 install conan
RUN apt-get update
## cpp unit
# RUN apt-get install -y autotools-dev automake libtool
RUN apt-get install -y libcppunit-dev
# for mull
RUN apt-get install -y sqlite3 libsqlite3-dev libncurses5-dev libxml2-dev uuid-dev libstdc++-6-dev
运行容器后,我设置了预构建的 llvm 二进制文件。LLVM 位置在 /usr/src/llvm
# LLVM setup
export PATH="$PATH:/usr/src/llvm/bin"
cat > llvm.conf << "HEREDOC"
/usr/src/llvm/lib
HEREDOC
mv llvm.conf /etc/ld.so.conf.d/
ldconfig
export CC=/usr/src/llvm/bin/clang
export CXX=/usr/src/llvm/bin/clang++
apt-get install -y cmake
apt-get update
dpkg -i setup/libicu55_55.1-7_amd64.deb
dpkg -i setup/Mull-0.3.0-LLVM-8.0-ubuntu-16.04.deb