" causes local include files to be used";
"-include_headers", Arg.Set include_headers,
" process header files independently";
- "-I", Arg.String (function x -> FC.include_path := Some x),
+ "-I", Arg.String (fun x ->
+ FC.include_path:= x::!FC.include_path
+ ),
" <dir> containing the header files (optional)";
"-preprocess", Arg.Set preprocess,
" works with -dir, use info generated by glimpseindex";
"-use_google", Arg.String (function s -> Flag.scanner := Flag.Google s),
" find relevant files using google code search";
- "-patch", Arg.String (function s -> Flag.patch := Some s),
+ "-patch",
+ Arg.String (function s -> Flag.patch := Some (Cocci.normalize_path s)),
(" <dir> path name with respect to which a patch should be created\n"^
" \"\" for a file in the current directory");
"-kbuild_info", Arg.Set_string kbuild_info,
" guess what";
"-date", Arg.Unit (fun () ->
- pr2 "version: $Date: 2010/01/26 06:01:55 $";
+ pr2 "version: $Date: 2010/03/05 21:12:11 $";
raise (Common.UnixExit 0)
),
" guess what";
if !dir && !Flag.patch =*= None
then
(match xs with
- | [] -> Flag.patch := Some x
+ | [] -> Flag.patch := Some (Cocci.normalize_path x)
| _ ->
pr2
("warning: patch output can only be created when only one\n"^
chosen
end
else List.hd !args in
- if !FC.include_path =*= None
- then FC.include_path := Some (Filename.concat chosen_dir "include"));
+ if !FC.include_path =*= []
+ then FC.include_path := [Filename.concat chosen_dir "include"]);
args := List.rev !args;
(* The test framework. Works with tests/ or .ok and .failed *)
(* --------------------------------------------------------- *)
| [x] when !test_mode ->
- FC.include_path := Some "tests/include";
- Testing.testone x !compare_with_expected
+ begin
+ try
+ let prefix = "tests/" in
+ FC.include_path := [prefix^"include"];
+ Testing.testone prefix x !compare_with_expected
+ with _ ->
+ FC.include_path := ["include"];
+ Testing.testone "" x !compare_with_expected
+ end
| [] when !test_all ->
- FC.include_path := Some "tests/include";
+ FC.include_path := ["tests/include"];
if !expected_score_file <> ""
then Testing.testall ~expected_score_file:!expected_score_file ()
else Testing.testall ()