Skip to content

Commit 88c900f

Browse files
vecchiot-awstedinski
authored andcommitted
Added --function flag to cargo-rmc (rust-lang#239)
* Added --function flag to cargo-rmc
1 parent 0642530 commit 88c900f

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

scripts/cargo-rmc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,12 @@ def main():
2929
parser.add_argument("--target-dir", default="target",
3030
help="Directory for all generated artifacts")
3131
parser.add_argument("--wkdir", default=".")
32+
parser.add_argument("--function", default="main")
3233
parser.add_argument("crate", help="crate to verify")
3334
parser.add_argument("cbmc_args", nargs=argparse.REMAINDER,
3435
default=[], help="Pass through directly to CBMC")
3536
args = parser.parse_args()
3637

37-
# In the future we hope to make this configurable in the command line.
38-
# For now, however, changing this from "main" breaks rmc.
39-
# Issue: https://github.com/model-checking/rmc/issues/169
40-
args.function = "main"
41-
4238
if args.quiet:
4339
args.verbose = False
4440

scripts/rmc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def run_visualize(cbmc_filename, cbmc_args, verbose=False, quiet=False, keep_tem
117117
# 4) cbmc --xml-ui --show-properties ~/rmc/library/rmc/rmc_lib.c temp.goto > property.xml
118118
# 5) cbmc-viewer --result results.xml --coverage coverage.xml --property property.xml --srcdir . --goto temp.goto --reportdir report
119119

120-
run_goto_cc(cbmc_filename, temp_goto_filename, verbose, quiet)
120+
run_goto_cc(cbmc_filename, temp_goto_filename, verbose, quiet, function=function)
121121

122122
def run_cbmc_local(cbmc_args, output_to):
123123
cbmc_cmd = ["cbmc"] + cbmc_args + [temp_goto_filename]

src/tools/compiletest/src/runtest.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2442,11 +2442,10 @@ impl<'test> TestCx<'test> {
24422442
let function_name = self.testpaths.file.file_stem().unwrap().to_str().unwrap();
24432443
cargo
24442444
.arg("rmc")
2445+
.args(["--function", function_name])
24452446
.arg("--target")
24462447
.arg(self.output_base_dir().join("target"))
2447-
.arg(&parent_dir)
2448-
.arg("--")
2449-
.args(["--function", function_name]);
2448+
.arg(&parent_dir);
24502449
self.add_rmc_dir_to_path(&mut cargo);
24512450
let proc_res = self.compose_and_run_compiler(cargo, None);
24522451
let expected = fs::read_to_string(self.testpaths.file.clone()).unwrap();

0 commit comments

Comments
 (0)