From 0ca19da3cf9e336d6e7a0936dbaeabbbcb60f773 Mon Sep 17 00:00:00 2001 From: Sam Blackshear Date: Tue, 19 Jul 2016 16:00:16 -0700 Subject: [PATCH] allowing custom procname in analyzerTester Reviewed By: lazaroclapp Differential Revision: D3590116 fbshipit-source-id: 7fe052f --- infer/src/unit/analyzerTester.ml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/infer/src/unit/analyzerTester.ml b/infer/src/unit/analyzerTester.ml index 26a97c529..f243ceff1 100644 --- a/infer/src/unit/analyzerTester.ml +++ b/infer/src/unit/analyzerTester.ml @@ -150,10 +150,10 @@ module Make type assert_map = string M.t - let structured_program_to_cfg program = + let structured_program_to_cfg program test_pname = let cfg = Cfg.Node.create_cfg () in let pdesc = - Cfg.Procdesc.create cfg (ProcAttributes.default dummy_procname !Config.curr_language) in + Cfg.Procdesc.create cfg (ProcAttributes.default test_pname !Config.curr_language) in let create_node kind cmds = Cfg.Node.create cfg dummy_loc kind cmds pdesc in @@ -227,8 +227,8 @@ module Make Cfg.Procdesc.set_exit_node pdesc exit_node; pdesc, assert_map - let create_test test_program extras _ = - let pdesc, assert_map = structured_program_to_cfg test_program in + let create_test test_program extras test_pname _ = + let pdesc, assert_map = structured_program_to_cfg test_program test_pname in let inv_map = I.exec_pdesc (ProcData.make pdesc (Tenv.create ()) extras) in let collect_invariant_mismatches node_id (inv_str, inv_label) error_msgs_acc = @@ -260,8 +260,8 @@ module Make |> F.flush_str_formatter in OUnit2.assert_failure assert_fail_message - let create_tests extras tests = + let create_tests ?(test_pname=Procname.empty_block) extras tests = let open OUnit2 in - IList.map (fun (name, test_program) -> name>::create_test test_program extras) tests + IList.map (fun (name, test_program) -> name>::create_test test_program extras test_pname) tests end