Skip to content

Commit

Permalink
make test doesn't execute benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
hugsy committed Jan 30, 2022
1 parent 1311cc9 commit bab267b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ 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
endif

.PHONY: test test_% Test% testbins clean lint

test: $(TMPDIR) testbins
TMPDIR=$(TMPDIR) python3 -m pytest $(PYTEST_PARAMETERS)
TMPDIR=$(TMPDIR) python3 -m pytest $(PYTEST_PARAMETERS) -k "not benchmark"

test_%: $(TMPDIR) testbins
TMPDIR=$(TMPDIR) python3 -m pytest $(PYTEST_PARAMETERS) -k $@
Expand Down
3 changes: 2 additions & 1 deletion tests/api/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
class MiscFunctionTest(GefUnitTestGeneric):
"""Tests GEF internal functions."""


def test_func_which(self):
res = gdb_test_python_method("which('gdb')")
lines = res.splitlines()
Expand Down Expand Up @@ -50,6 +49,7 @@ def test_func_download_file(self):
@pytest.mark.slow
@pytest.mark.online
def test_func_update_gef(self):
bkp_home = os.environ["HOME"]
for branch in ("master", "dev"):
with tempfile.TemporaryDirectory() as tmpdir:
dirpath = pathlib.Path(tmpdir)
Expand All @@ -63,3 +63,4 @@ def test_func_update_gef(self):
self.assertEqual(open(f"{home}/.gdbinit", "r").read(), f"source ~/.gef-{ref}.py\n")
fpath = home / f".gef-{ref}.py"
self.assertTrue(fpath.exists())
os.environ["HOME"] = bkp_home

0 comments on commit bab267b

Please sign in to comment.