Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ jobs:
- name: install
run: sudo make install
- name: install pytrap
run: (cd pytrap && make coverage; sudo python3 setup.py install;)
run: (cd pytrap && make test; sudo pip install . ;)
- name: tests pycommon
run: (cd pycommon && pip install .[test] && python3 -m pytest;)
- name: make check
run: make check
- name: make distcheck
Expand Down
9 changes: 7 additions & 2 deletions pytrap/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,16 @@ TESTS = test.sh

.PHONY: coverage
coverage:
CFLAGS=-coverage python3 -m pip install .[test] --no-deps --disable-pip-version-check --no-cache-dir
CFLAGS=-coverage python3 -m pytest --cov=pycommon || echo "Skipped python3 tests"
CFLAGS=-coverage python3 -m pip install .[test] --disable-pip-version-check --no-cache-dir
CFLAGS=-coverage python3 -m pytest --cov=pytrap || echo "Skipped python3 tests"
@lcov --capture --directory . --output-file coverage.info 2>/dev/null && \
genhtml coverage.info --output-directory out 2>/dev/null || echo "Skipped coverage analysis"

.PHONY: test
test:
python3 -m pip install .[test] --no-cache-dir
python3 -m pytest

.PHONY: doc
doc:
python3 -m pip install .[docs] --no-cache-dir
Expand Down
4 changes: 3 additions & 1 deletion pytrap/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ license = { text = "BSD" }
requires-python = ">=3.8"
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: POSIX :: Linux",
"Programming Language :: C",
"Programming Language :: Python :: 3",
Expand Down Expand Up @@ -63,7 +64,8 @@ sources = [
"src/iplist.c",
"src/fields.c"
]
libraries = ["trap", "unirec"]
libraries = ["trap", "unirec","gcov"]
extra-compile-args = ["-O2"]


[tool.pytest.ini_options]
Expand Down
1 change: 1 addition & 0 deletions pytrap/src/unirecmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>

#include "fields.h"
#include "unirectemplate.h"
Expand Down
2 changes: 1 addition & 1 deletion pytrap/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fi

python3 -c 'import pytrap' 2>/dev/null || exit 77

python3 $srcdir/setup.py test || exit $?
python3 -m pytest $srcdir/test || exit $?

path_to_logger="$srcdir"/../../modules/logger/logger

Expand Down
Loading