Revert "collect C++ code coverage (#23619)"

This reverts commit a97b2e613b275f407576ddb3d7a3bd52b05f612a.

old-commit-hash: a62e914090
commatwo_master
Willem Melching 3 years ago
parent dc20ab6c42
commit 772f394423
  1. 20
      .github/workflows/selfdrive_tests.yaml
  2. 4
      .gitignore
  3. 13
      SConstruct
  4. 13
      tools/collect_coverage.sh
  5. 2
      tools/gcov_for_clang.sh
  6. 4
      tools/ubuntu_setup.sh

@ -209,7 +209,7 @@ jobs:
run: eval "$BUILD"
- name: Run valgrind
run: |
${{ env.RUN }} "scons -j$(nproc) --coverage && \
${{ env.RUN }} "scons -j$(nproc) && \
FILEREADER_CACHE=1 python selfdrive/test/test_valgrind_replay.py"
- name: Print logs
if: always()
@ -244,7 +244,7 @@ jobs:
run: eval "$BUILD"
- name: Run unit tests
run: |
${{ env.RUN }} "scons -j$(nproc) --test --coverage && \
${{ env.RUN }} "scons -j$(nproc) --test && \
coverage run selfdrive/test/test_fingerprints.py && \
$UNIT_TEST common && \
$UNIT_TEST opendbc/can && \
@ -265,7 +265,7 @@ jobs:
./selfdrive/proclogd/tests/test_proclog && \
./selfdrive/ui/replay/tests/test_replay && \
./selfdrive/camerad/test/ae_gray_test && \
tools/collect_coverage.sh"
coverage xml"
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v2
@ -299,9 +299,9 @@ jobs:
run: eval "$BUILD"
- name: Run replay
run: |
${{ env.RUN }} "scons -j$(nproc) --coverage && \
${{ env.RUN }} "scons -j$(nproc) && \
FILEREADER_CACHE=1 CI=1 coverage run selfdrive/test/process_replay/test_processes.py && \
tools/collect_coverage.sh"
coverage xml"
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v2
- name: Print diff
@ -354,12 +354,10 @@ jobs:
- name: Test longitudinal
run: |
${{ env.RUN }} "mkdir -p selfdrive/test/out && \
scons -j$(nproc) --coverage && \
scons -j$(nproc) && \
cd selfdrive/test/longitudinal_maneuvers && \
coverage run ./test_longitudinal.py && \
coverage xml && \
cd ../../.. && \
tools/collect_coverage.sh"
coverage xml"
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v2
- uses: actions/upload-artifact@v2
@ -403,9 +401,9 @@ jobs:
run: eval "$BUILD"
- name: Test car models
run: |
${{ env.RUN }} "scons -j$(nproc) --test --coverage && \
${{ env.RUN }} "scons -j$(nproc) --test && \
FILEREADER_CACHE=1 coverage run -m pytest selfdrive/test/test_models.py && \
tools/collect_coverage.sh && \
coverage xml && \
chmod -R 777 /tmp/comma_download_cache"
env:
NUM_JOBS: 4

4
.gitignore vendored

@ -83,7 +83,3 @@ models/*.thneed
build/
!**/.gitkeep
*.gcno
*.gcda
coverage.info

@ -52,11 +52,6 @@ AddOption('--no-thneed',
dest='no_thneed',
help='avoid using thneed')
AddOption('--coverage',
action='store_true',
dest='coverage',
help='outpute covarge information')
real_arch = arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip()
if platform.system() == "Darwin":
arch = "Darwin"
@ -173,10 +168,6 @@ else:
ccflags = []
ldflags = []
if GetOption('coverage'):
ccflags += ["-fprofile-arcs", "-ftest-coverage"]
ldflags += ["-fprofile-arcs", "-ftest-coverage"]
# no --as-needed on mac linker
if arch != "Darwin":
ldflags += ["-Wl,--as-needed", "-Wl,--no-undefined"]
@ -294,10 +285,6 @@ elif arch == "aarch64":
else:
envCython["LINKFLAGS"] = ["-pthread", "-shared"]
if GetOption('coverage'):
envCython['CCFLAGS'] += ["-fprofile-arcs", "-ftest-coverage"]
envCython['LINKFLAGS'] += ["-fprofile-arcs", "-ftest-coverage"]
Export('envCython')
# Qt build environment

@ -1,13 +0,0 @@
#!/bin/bash
set -e
find opendbc/can/dbc_out -name "*.gcda" -delete
find rednose/helpers -name "*.gcda" -delete
find rednose_repo/rednose/helpers -name "*.gcda" -delete
find cereal/gen -name "*.gcda" -delete
lcov --capture --directory . --gcov-tool tools/gcov_for_clang.sh --output-file coverage.info
lcov --remove coverage.info '*/third_party/*' --output-file coverage.info
lcov --remove coverage.info '/usr/*' --output-file coverage.info
coverage xml || true

@ -1,2 +0,0 @@
#!/bin/bash
exec llvm-cov gcov "$@"

@ -31,9 +31,8 @@ function install_ubuntu_common_requirements() {
git \
git-lfs \
ffmpeg \
lcov \
libavcodec-dev \
libavformat-dev \
libavcodec-dev \
libavdevice-dev \
libavutil-dev \
libavfilter-dev \
@ -51,7 +50,6 @@ function install_ubuntu_common_requirements() {
libusb-1.0-0-dev \
libzmq3-dev \
libsystemd-dev \
llvm \
locales \
opencl-headers \
ocl-icd-libopencl1 \

Loading…
Cancel
Save