-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test for multi file analysis coverage (#50)
* Added multi file test for coverage * Fixed cleanup
- Loading branch information
Showing
6 changed files
with
62 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from dynapyt.analyses.BaseAnalysis import BaseAnalysis | ||
|
||
|
||
class TestAnalysis(BaseAnalysis): | ||
def __init__(self): | ||
super().__init__() | ||
|
||
def begin_execution(self): | ||
print("begin execution") | ||
|
||
def end_execution(self): | ||
print("end execution") | ||
|
||
def pre_call(self, dyn_ast, iid, call, pos_args, kw_args): | ||
print(f"pre call {call.__name__}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{"test_coverage/multi_file/program.py.orig": {"8": {"TestAnalysis": 2}, "5": {"TestAnalysis": 1}}} | ||
{"test_coverage/multi_file/program2.py.orig": {"6": {"TestAnalysis": 1}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
begin execution | ||
pre call baz | ||
pre call bar | ||
pre call foo | ||
pre call print | ||
216 | ||
end execution |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from .program2 import bar | ||
|
||
|
||
def baz(x): | ||
return bar(x) ** 3 | ||
|
||
|
||
print(baz(2)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
def foo(x): | ||
return x + 1 | ||
|
||
|
||
def bar(x): | ||
return foo(x) * 2 |