Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better tests #813

Merged
merged 45 commits into from
Feb 14, 2022
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
cb85ef0
first shot at refactoring ci testing
Jan 26, 2022
ca51d43
- Added skeleton for most missing command test modules
Jan 27, 2022
f96f4ad
[ci] added tests for `nop`
Jan 27, 2022
4d1dc46
[ci] extra test for nop for memory check
Jan 27, 2022
c739c68
added benchmarking capability, can be triggered directly from `pytest`
Jan 27, 2022
cbe0a03
- fixed `pcustom` command test for 32b
Jan 28, 2022
27881bf
[ci] cmd/heap - adjusted tcachebins indexes for 32b
Jan 28, 2022
14be53e
damnit
Jan 28, 2022
dc66f9b
- fixed linting
Jan 28, 2022
7d77734
last fixes for tonight
Jan 28, 2022
fc31d63
fixed `pattern` and `heap` tests for good
Jan 28, 2022
a99a6cb
- add 3rd party module check for `capstone`, `keystone`, `unicorn` an…
Jan 28, 2022
41d44fd
added `test_func_update_gef`
Jan 28, 2022
10d1025
`make test` doesn't execute benchmark
Jan 29, 2022
9d655ae
- fixed errors in the `pie` subcommands
Jan 30, 2022
f870920
`theme` added more tests
Jan 30, 2022
072f5d7
- improved tests for `pattern` and `edit-flags`
Jan 30, 2022
2876bca
[ci] created cases for all arches for bin tests in `tests/heap.py`
Jan 31, 2022
de824b8
fixed `heap` tests for good
Jan 31, 2022
1a4c061
- added ci test for `glibcarena`
Jan 31, 2022
c475fd0
- added tests for deprecated API
Jan 31, 2022
22630c2
started `gef` test module
Jan 31, 2022
6a020da
- added tests for `syscall-args` and `is-syscall`
Jan 31, 2022
969a737
- fixed `syscall-args` to also get catchpoints + tests
Feb 1, 2022
757eb17
- test `show_last_exception`
Feb 1, 2022
013d1bd
make sure `syscall-args` test collects the ABI files from `gef-extras`
Feb 1, 2022
be68e87
linting
Feb 1, 2022
357f1d4
only enable `syscall-args` test for x86
Feb 1, 2022
9a528d8
`syscall-args` fixed typo in i686 test
Feb 1, 2022
70e8b03
Fix RISCV arch detection (#790)
Grazfather Feb 1, 2022
18022a8
Update tests/api/gef_arch.py
hugsy Feb 1, 2022
8e4befe
fix: make shebang lines portable (#814)
theguy147 Feb 1, 2022
1ee790c
Merge branch 'dev' of github.com:hugsy/gef into better_tests
Feb 1, 2022
c2c8d08
make `heap` tests work universally
Feb 1, 2022
7a69c7e
disabling capstone/keystone/unicorn for some arches for now
Feb 1, 2022
da028a3
- fixed tests for ppc64
Feb 1, 2022
1800673
- `BIN_LS` -> `_target("default")`
Feb 1, 2022
5eb1f62
- disable pytest `--pdb` from makefile
Feb 2, 2022
ec352de
Apply suggestions from code review
hugsy Feb 4, 2022
aa8d051
fixing ci
Feb 4, 2022
02e9048
[tests] use camel case for format string helper test class
Feb 7, 2022
ae03c99
[tests] added docstring to `GefFuncDeprecatedApi`
Feb 7, 2022
af339c5
[tests] `edit-flags` are only for known arches for now
Feb 7, 2022
d2d85ff
PR review changes
hugsy Feb 13, 2022
bc44c2d
PR review last batch
Feb 14, 2022
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*.out
*.pyc
TAGS
*/__pycache__/
__pycache__
tests/*.pyc
tests/pylint.html
tests/pylint.txt
Expand Down
11 changes: 4 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,18 @@ TARGET := $(shell lscpu | head -1 | sed -e 's/Architecture:\s*//g')
COVERAGE_DIR ?= /tmp/cov
GEF_PATH ?= $(shell readlink -f gef.py)
TMPDIR ?= /tmp
PYTEST_PARAMETERS := --verbose -n $(NB_CORES)
PYTEST_PARAMETERS := --verbose --forked --numprocesses=$(NB_CORES)
ifdef DEBUG
PYTEST_PARAMETERS += --pdb
theguy147 marked this conversation as resolved.
Show resolved Hide resolved
endif

.PHONY: test test_% Test% testbins clean lint

test: $(TMPDIR) testbins
TMPDIR=$(TMPDIR) python3 -m pytest $(PYTEST_PARAMETERS) tests/runtests.py

Test%: $(TMPDIR) testbins
TMPDIR=$(TMPDIR) python3 -m pytest $(PYTEST_PARAMETERS) tests/runtests.py::$@
TMPDIR=$(TMPDIR) python3 -m pytest $(PYTEST_PARAMETERS) -k "not benchmark"

test_%: $(TMPDIR) testbins
TMPDIR=$(TMPDIR) python3 -m pytest $(PYTEST_PARAMETERS) tests/runtests.py -k $@
TMPDIR=$(TMPDIR) python3 -m pytest $(PYTEST_PARAMETERS) -k $@

testbins: $(TMPDIR) $(wildcard tests/binaries/*.c)
@TMPDIR=$(TMPDIR) $(MAKE) -j $(NB_CORES) -C tests/binaries TARGET=$(TARGET) all
Expand All @@ -36,7 +33,7 @@ clean:

lint:
python3 -m pylint $(PYLINT_GEF_PARAMETERS) $(GEF_PATH)
python3 -m pylint $(PYLINT_TEST_PARAMETERS) $(wildcard tests/*.py)
python3 -m pylint $(PYLINT_TEST_PARAMETERS) $(wildcard tests/*.py tests/*/*.py)

coverage:
@! ( [ -d $(COVERAGE_DIR) ] && echo "COVERAGE_DIR=$(COVERAGE_DIR) exists already")
Expand Down
Loading