diff --git a/.coveralls.condarc b/.coveralls.condarc new file mode 100644 index 000000000..80240a8c5 --- /dev/null +++ b/.coveralls.condarc @@ -0,0 +1,5 @@ +channels: + - conda-forge + - defaults +always_yes: True +auto_update_conda: True diff --git a/.coveralls.env.yml b/.coveralls.env.yml new file mode 100644 index 000000000..9f614af62 --- /dev/null +++ b/.coveralls.env.yml @@ -0,0 +1,4 @@ +name: hyphy-test-env +dependencies: + - pip + - openmpi diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100755 index 000000000..f5887b823 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,42 @@ +name: Test Coverage +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] +jobs: + coverage: + name: Coveralls Report + runs-on: ubuntu-latest + steps: + - name: Install python + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Install dependencies + run: + python -m pip install --upgrade pip; + python -m pip install --upgrade wheel; + python -m pip install --upgrade cpp-coveralls; + - name: Get HyPhy code + uses: actions/checkout@v2 + - name: Install and activate miniconda + uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: 'hyphy-test-env' + environment-file: '.coveralls.env.yml' + condarc-file: '.coveralls.condarc' + - name: Build HyPhy + run: + cmake .; + make -j HYPHYDEBUG; + ln -s HYPHYDEBUG hyphy; + ln -s HYPHYDEBUG HYPHYMP; + - name: Run unit tests + run: + PATH=.:$PATH ./run_unit_tests.sh || true; + - name: Generate coverage information + run: + coveralls --gcov-options '\-lp'; + env: + COVERALLS_REPO_TOKEN: ${{ secrets.coveralls_token }} diff --git a/.travis.yml b/.travis.yml index 00e8c80f2..1804b9142 100644 --- a/.travis.yml +++ b/.travis.yml @@ -149,4 +149,4 @@ jobs: install: - if [ "$CXX" = "g++" ]; then export CXX="g++-8" CC="gcc-8"; fi - cmake . - - make \ No newline at end of file + - make diff --git a/src/core/matrix.cpp b/src/core/matrix.cpp index d2d4a4734..61323e1ff 100644 --- a/src/core/matrix.cpp +++ b/src/core/matrix.cpp @@ -2263,7 +2263,7 @@ bool _Matrix::IncreaseStorage (void) { } else { theData = (hyFloat*) MemReallocate(theData, lDim*sizeof(void*)); for (long i = lDim-allocationBlock; i < lDim; i++) { - theData [i] = ZEROPOINTER; + theData [i] = ZEROOBJECT; } } } else {