|
| 1 | +#!/usr/bin/env python |
1 | 2 | # Author: Shilpa Roy
|
2 | 3 | # Last updated: June 16, 2020
|
3 | 4 |
|
4 | 5 | import itertools as it
|
5 | 6 | import os
|
6 | 7 | import subprocess
|
7 | 8 |
|
8 |
| -#### USERS PUT YOUR INFO HERE ##### |
9 |
| - |
10 |
| -# Please remember to add a '/' at the very end! |
11 |
| -path_to_monorepo = "/Users/shilpa-roy/checkedc/checkedc-clang/build/bin/" |
| 9 | +os.chdir(os.path.dirname(__file__)) |
| 10 | +# Relative path from clang/test/3C/ |
| 11 | +bin_path = "../../../build/bin/" |
12 | 12 |
|
13 | 13 |
|
14 | 14 |
|
@@ -726,23 +726,23 @@ def annot_gen_smart(prefix, proto, suffix):
|
726 | 726 |
|
727 | 727 | # run the porting tool on the file(s)
|
728 | 728 | if proto=="multi":
|
729 |
| - os.system("{}3c -alltypes -addcr -output-postfix=checkedALL {} {}".format(path_to_monorepo, name, name2)) |
730 |
| - os.system("{}3c -addcr -output-postfix=checkedNOALL {} {}".format(path_to_monorepo, name, name2)) |
| 729 | + os.system("{}3c -alltypes -addcr -output-postfix=checkedALL {} {}".format(bin_path, name, name2)) |
| 730 | + os.system("{}3c -addcr -output-postfix=checkedNOALL {} {}".format(bin_path, name, name2)) |
731 | 731 | else:
|
732 |
| - os.system("{}3c -alltypes -addcr -output-postfix=checkedALL {}".format(path_to_monorepo, name)) |
733 |
| - os.system("{}3c -addcr -output-postfix=checkedNOALL {}".format(path_to_monorepo, name)) |
| 732 | + os.system("{}3c -alltypes -addcr -output-postfix=checkedALL {}".format(bin_path, name)) |
| 733 | + os.system("{}3c -addcr -output-postfix=checkedNOALL {}".format(bin_path, name)) |
734 | 734 |
|
735 | 735 | # compile the files and if it doesn't compile, then let's indicate that a bug was generated for this file
|
736 | 736 | bug_generated = False
|
737 | 737 | if proto != "multi":
|
738 |
| - out = subprocess.Popen(['{}clang'.format(path_to_monorepo), '-c', cnameNOALL], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
| 738 | + out = subprocess.Popen(['{}clang'.format(bin_path), '-c', cnameNOALL], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
739 | 739 | stdout, stderr = out.communicate()
|
740 | 740 | stdout = str(stdout)
|
741 | 741 | if "error:" in stdout:
|
742 | 742 | bug_generated = True
|
743 | 743 | # name = prefix + proto + suffix + "_BUG.c"
|
744 | 744 | else:
|
745 |
| - out = subprocess.Popen(['{}clang'.format(path_to_monorepo), '-c', cnameNOALL, cname2NOALL], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
| 745 | + out = subprocess.Popen(['{}clang'.format(bin_path), '-c', cnameNOALL, cname2NOALL], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
746 | 746 | stdout, stderr = out.communicate()
|
747 | 747 | stdout = str(stdout)
|
748 | 748 | if "error:" in stdout:
|
|
0 commit comments