-
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.
- Loading branch information
Showing
7 changed files
with
74 additions
and
16 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,16 @@ | ||
# DYNAPYT: DO NOT INSTRUMENT | ||
|
||
|
||
import dynapyt.runtime as _rt | ||
|
||
_dynapyt_ast_ = "/home/eghbalaz/Documents/PhD/Projects/DynaPyt/tests/test_coverage/multi_file/program2.py" + ".orig" | ||
try: | ||
def foo(x): | ||
return x + 1 | ||
|
||
|
||
def bar(x): | ||
return _rt._call_(_dynapyt_ast_, 2, foo, False, [("", x)], {}) * 2 | ||
except Exception as _dynapyt_exception_: | ||
_rt._catch_(_dynapyt_exception_) | ||
|
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 |