Skip to content

Commit

Permalink
fix: Downgrade gcc toolchain on windows
Browse files Browse the repository at this point in the history
Gcc version 8.0.2 produces coverage reports that are not
readable by lcov(linux-test-project/lcov#38)
As a result we are required to  downgrade the gcc-toolchain

Download older gcc version from http://repo.msys2.org/mingw/x86_64/

Disable optimizations flags for better coverage reports
  • Loading branch information
rish9511 committed Sep 30, 2018
1 parent 1e95599 commit f9408eb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
11 changes: 5 additions & 6 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,24 @@ environment:

install:
- SET "PATH=C:\%MSYS2_DIR%\%MSYSTEM%\bin;C:\%MSYS2_DIR%\usr\bin;%PATH%"

- bash -lc "pacman -S --needed --noconfirm mingw-w64-x86_64-qt-creator"

- bash -lc "pacman -S --needed --noconfirm mingw64/mingw-w64-x86_64-hdf5 mingw64/mingw-w64-x86_64-netcdf mingw64/mingw-w64-x86_64-boost"

- bash -lc "pacman -S --needed --noconfirm zlib-devel"

- bash -lc "pacman -S --noconfirm mingw64/mingw-w64-x86_64-curl"

- bash -lc "/c/projects/ElMaven/gcc_v7.3.0.sh"
- bash -lc "wget https://github.com/linux-test-project/lcov/releases/download/v1.12/lcov-1.12.tar.gz"
- bash -lc "tar -xzf lcov-1.12.tar.gz"
- bash -lc "ln -s $PWD/lcov-1.12/bin/lcov /c/msys64/mingw64/bin/lcov"
- bash -lc "ln -s $PWD/lcov-1.12/bin/geninfo /c/msys64/mingw64/bin/geninfo"

build_script:
- bash -lc "cd C:/projects/ElMaven/ ; echo yes | ./run.sh"
# - bash -lc "ls -lR C:/Projects/"
# - bash -lc "lcov -b /c/Projects/ElMaven/src/core/libmaven/ --capture --directory /c/projects/build/tmp/maven/ --output-file /c/projects/ElMaven/lcov.info --no-external"
# - bash -lc "lcov --summary /c/projects/ElMaven/lcov.info"
- bash -lc "cd C:/projects/ElMaven/ ; echo no | ./run.sh"
- bash -lc "ls -lR C:/Projects/"
- bash -lc "lcov -b /c/Projects/ElMaven/src/core/libmaven/ --capture --directory /c/projects/build/tmp/maven/ --output-file /c/projects/ElMaven/lcov.info --no-external"
- bash -lc "lcov --summary /c/projects/ElMaven/lcov.info"

#on_success:
#- bash -lc "export CODECOV_TOKEN="9a0f9704-6d63-48c6-8c1a-ded361a26597"
Expand Down
16 changes: 16 additions & 0 deletions gcc_v7.3.0.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

#wget http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-7.3.0-1-any.pkg.tar.xz \
# http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-ada-7.3.0-1-any.pkg.tar.xz \
# http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-fortran-7.3.0-1-any.pkg.tar.xz \
# http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-libgfortran-7.3.0-1-any.pkg.tar.xz \
# http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-libs-7.3.0-1-any.pkg.tar.xz \
# http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-objc-7.3.0-1-any.pkg.tar.xz
#

pacman --noconfirm -U mingw-w64-x86_64-gcc-7.3.0-1-any.pkg.tar.xz \
mingw-w64-x86_64-gcc-ada-7.3.0-1-any.pkg.tar.xz \
mingw-w64-x86_64-gcc-fortran-7.3.0-1-any.pkg.tar.xz \
mingw-w64-x86_64-gcc-libgfortran-7.3.0-1-any.pkg.tar.xz \
mingw-w64-x86_64-gcc-libs-7.3.0-1-any.pkg.tar.xz \
mingw-w64-x86_64-gcc-objc-7.3.0-1-any.pkg.tar.xz
1 change: 1 addition & 0 deletions src/core/libmaven/libmaven.pro
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ win32: QMAKE_CXXFLAGS += -Ofast -ffast-math
message("adding gcov compiler flags")
QMAKE_CCFLAGS += -fprofile-arcs -ftest-coverage
QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage
QMAKE_CXXFLAGS -= -Ofast -ffast-math
QMAKE_LFLAGS += -fprofile-arcs -ftest-coverage
QMAKE_LFLAGS += -lgcov --coverage
}
Expand Down

0 comments on commit f9408eb

Please sign in to comment.