Skip to content

Commit

Permalink
fix(unit-test): update to use new folder structure
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasrothenberger committed Oct 18, 2023
1 parent d0583a4 commit 4e87750
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion test/do_all/daxpy/src/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
all: clean prog

prog: daxpy.o
$(LINKER) -o prog daxpy.o $(CXXFLAGS)
$(CXX) -o prog daxpy.o $(CXXFLAGS)

daxpy.o:
$(CXX) -c -o daxpy.o daxpy.cpp $(CXXFLAGS)

clean:
rm -rf .discopop
rm -rf src/.discopop
find . -not -name daxpy.cpp -not -name Makefile -not -path **/FileMapping.txt -delete

veryclean: clean
Expand Down
11 changes: 7 additions & 4 deletions test/do_all/daxpy/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,19 @@ def test(self):
os.system("" + os.path.join(build_dir, "scripts", "dp-fmap"))

# build
make_command = "DP_FM_PATH=" + os.path.join(src_dir, "FileMapping.txt") + " "
# make_command = "DP_FM_PATH=" + os.path.join(src_dir, "FileMapping.txt") + " "
make_command = ""
make_command += "CC=" + os.path.join(build_dir, "scripts", "CC_wrapper.sh") + " "
make_command += "CXX=" + os.path.join(build_dir, "scripts", "CXX_wrapper.sh") + " "
make_command += "LINKER=" + os.path.join(build_dir, "scripts", "LINKER_wrapper.sh") + " "
# make_command += "LINKER=" + os.path.join(build_dir, "scripts", "LINKER_wrapper.sh") + " "
make_command += "make "
os.system(make_command)
# execute instrumented program
os.system("./prog")
# execute DiscoPoP analysis
os.system("discopop_explorer --dep-file=prog_dep.txt --dump-detection-result")
os.chdir(".discopop")
os.system("discopop_explorer")
os.chdir("..")
# validate results
self.validate_results(current_dir, src_dir)
# clean environment
Expand All @@ -39,7 +42,7 @@ def test(self):
def validate_results(self, test_dir, src_dir):
"""compare results to gold standard"""
gold_standard_file = os.path.join(test_dir, "detection_result_dump.json")
test_output_file = os.path.join(src_dir, "detection_result_dump.json")
test_output_file = os.path.join(src_dir, ".discopop", "explorer", "detection_result_dump.json")
# load both detection results
with open(gold_standard_file, "r") as f:
tmp_str = f.read()
Expand Down

0 comments on commit 4e87750

Please sign in to comment.