|
| 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 | +import find_bin |
| 10 | +bin_path = find_bin.bin_path |
12 | 11 |
|
13 | 12 |
|
14 | 13 |
|
@@ -726,23 +725,23 @@ def annot_gen_smart(prefix, proto, suffix): |
726 | 725 |
|
727 | 726 | # run the porting tool on the file(s) |
728 | 727 | 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)) |
| 728 | + os.system("{}3c -alltypes -addcr -output-postfix=checkedALL {} {}".format(bin_path, name, name2)) |
| 729 | + os.system("{}3c -addcr -output-postfix=checkedNOALL {} {}".format(bin_path, name, name2)) |
731 | 730 | 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)) |
| 731 | + os.system("{}3c -alltypes -addcr -output-postfix=checkedALL {}".format(bin_path, name)) |
| 732 | + os.system("{}3c -addcr -output-postfix=checkedNOALL {}".format(bin_path, name)) |
734 | 733 |
|
735 | 734 | # compile the files and if it doesn't compile, then let's indicate that a bug was generated for this file |
736 | 735 | bug_generated = False |
737 | 736 | if proto != "multi": |
738 | | - out = subprocess.Popen(['{}clang'.format(path_to_monorepo), '-c', cnameNOALL], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
| 737 | + out = subprocess.Popen(['{}clang'.format(bin_path), '-c', cnameNOALL], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
739 | 738 | stdout, stderr = out.communicate() |
740 | 739 | stdout = str(stdout) |
741 | 740 | if "error:" in stdout: |
742 | 741 | bug_generated = True |
743 | 742 | # name = prefix + proto + suffix + "_BUG.c" |
744 | 743 | else: |
745 | | - out = subprocess.Popen(['{}clang'.format(path_to_monorepo), '-c', cnameNOALL, cname2NOALL], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
| 744 | + out = subprocess.Popen(['{}clang'.format(bin_path), '-c', cnameNOALL, cname2NOALL], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
746 | 745 | stdout, stderr = out.communicate() |
747 | 746 | stdout = str(stdout) |
748 | 747 | if "error:" in stdout: |
|
0 commit comments