Skip to content

Commit a76518d

Browse files
Add C tests to circle.
1 parent 50d6808 commit a76518d

File tree

2 files changed

+26
-29
lines changed

2 files changed

+26
-29
lines changed

.circleci/config.yml

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ jobs:
77
steps:
88
- checkout
99
- run: sudo chown -R circleci:circleci *
10-
# - restore_cache:
11-
# key: tskit-{{ .Branch }}
10+
- restore_cache:
11+
key: tskit-{{ .Branch }}
1212
- run:
1313
name: Checkout submodules
1414
command: |
@@ -23,10 +23,10 @@ jobs:
2323
pip install --user --pre --upgrade tskit
2424
pip install --user git+https://github.com/tskit-dev/msprime
2525
echo 'export PATH=/home/circleci/.local/bin:$PATH' >> $BASH_ENV
26-
# - save_cache:
27-
# key: tskit-{{ .Branch }}
28-
# paths:
29-
# - "/home/circleci/.local"
26+
- save_cache:
27+
key: tskit-{{ .Branch }}
28+
paths:
29+
- "/home/circleci/.local"
3030
- run:
3131
name: Compile Python
3232
command: |
@@ -62,18 +62,17 @@ jobs:
6262
python setup.py bdist_wheel
6363
# TODO This doesn't seem to be installing, fails on bdist_wheel build.
6464
# pip install dist/*.tar.gz
65-
# - run:
66-
# name: Compile C
67-
# command: |
68-
# CFLAGS=--coverage meson c/ build-gcc && cd build-gcc && ninja
69-
# - run:
70-
# name: Run C tests
71-
# command: |
72-
# export KASTORE_SOPATH=./build-gcc/libtskit.so
73-
# ./build-gcc/tests
74-
# ./build-gcc/dynamic_api_tests
75-
# ./build-gcc/malloc_tests
76-
# ./build-gcc/io_tests
65+
- run:
66+
name: Compile C
67+
command: |
68+
CFLAGS=--coverage meson c/ build-gcc && cd build-gcc && ninja
69+
- run:
70+
name: Run C tests
71+
command: |
72+
./build-gcc/test_core
73+
./build-gcc/test_tables
74+
./build-gcc/test_trees
75+
./build-gcc/test_genotypes
7776
# - run:
7877
# name: Valgrind for C tests.
7978
# command: |
@@ -82,16 +81,12 @@ jobs:
8281
# valgrind --leak-check=full --error-exitcode=1 ./build-gcc/dynamic_api_tests
8382
# valgrind --leak-check=full --error-exitcode=1 ./build-gcc/malloc_tests
8483
# valgrind --leak-check=full --error-exitcode=1 ./build-gcc/io_tests
85-
# - run:
86-
# name: Run gcov & upload coverage.
87-
# command: |
88-
# gcov -pb -o ./python/build/temp.linux*/ python/_tskitmodule.c
89-
# gcov -pb ./build-gcc/tests@exe/tskit.c.gcno \
90-
# ./build-gcc/malloc_tests@exe/tskit.c.gcno \
91-
# ./build-gcc/io_tests@exe/tskit.c.gcno \
92-
# ./build-gcc/dynamic_api_tests@exe/tskit.c.gcno \
93-
# ./build-gcc/tskit@sha/tskit.c.gcno
94-
# codecov -X gcov -F C
84+
- run:
85+
name: Run gcov & upload coverage.
86+
command: |
87+
gcov -pb -o ./python/build/temp.linux*/ python/_tskitmodule.c
88+
gcov -pb ./build-gcc/tskit@sta/tsk_*.gcno
89+
codecov -X gcov -F C
9590
# - run:
9691
# name: Compile C tests under clang
9792
# command: |

c/meson.build

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ lib_sources = [
1414
'kastore/c/kastore.c', 'tsk_core.c', 'tsk_tables.c', 'tsk_trees.c',
1515
'tsk_genotypes.c', 'tsk_stats.c', 'tsk_convert.c']
1616

17-
add_global_arguments(['-I../kastore/c'], language: 'c')
17+
kastore_dir=join_paths(meson.source_root(), 'kastore/c')
18+
19+
add_global_arguments(['-I' + kastore_dir], language: 'c')
1820

1921
tskit_lib = static_library('tskit',
2022
sources: lib_sources, dependencies: m_dep, c_args: extra_c_args)

0 commit comments

Comments
 (0)