Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: remove symbolic links and change naming convention of tests #980

Merged
merged 5 commits into from
Aug 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion test/passing/align_cases_break_all.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/assign_colon_op_begin_line.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/break_before_in_auto.ml

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion test/passing/break_cases_align.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/break_cases_all.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/break_cases_closing_on_separate_line.ml

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/break_cases_cosl_lnmp_cmei.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/break_cases_fit_or_vertical.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/break_cases_nested.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/break_cases_normal_indent.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/break_cases_toplevel.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/break_fun_decl-fit_or_vertical.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/break_fun_decl-smart.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/break_fun_decl-wrap.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/break_separators_after.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/break_separators_after_docked.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/break_separators_after_docked_wrap.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/break_separators_after_wrap.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/break_separators_wrap.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/break_string_literals_never.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/break_string_literals_newlines.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/break_string_literals_newlines_and_wrap.ml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -244,3 +244,21 @@ end
processing "y = t". If we don't explicitly preserve "x = y", the
normalizer cannot pick it up *)
let _ = ()

(** Tags without text *)

(** @see <Abc> *)

(** @before a *)

(** @deprecated *)

(** @param b *)

(** @raise c *)

(** @return *)

(** @see 'file' *)

(** @see "title" *)
Original file line number Diff line number Diff line change
Expand Up @@ -244,3 +244,21 @@ end
processing "y = t". If we don't explicitly preserve "x = y", the
normalizer cannot pick it up *)
let _ = ()

(** Tags without text *)

(** @see <Abc> *)

(** @before a *)

(** @deprecated *)

(** @param b *)

(** @raise c *)

(** @return *)

(** @see 'file' *)

(** @see "title" *)
1 change: 0 additions & 1 deletion test/passing/doc_comments.after.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/doc_comments.before.ml

This file was deleted.

26 changes: 18 additions & 8 deletions test/passing/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
type setup =
{ mutable has_ref: bool
; mutable has_opts: bool
; mutable base_file: string option
; mutable extra_deps: string list }

let read_lines fn =
Expand All @@ -13,17 +14,25 @@ let read_lines fn =
let lines = aux [] ic in
close_in ic ; lines

let add_test ?base_file tests src_test_name =
let s = {has_ref= false; has_opts= false; base_file; extra_deps= []} in
Hashtbl.add tests src_test_name s ;
s

let register_file tests fname =
match String.split_on_char '.' fname with
| test_name :: (("ml" | "mli") as ext) :: rest -> (
let test_name = test_name ^ "." ^ ext in
| test_name :: (("ml" | "mli" | "mlt") as ext) :: rest -> (
let src_test_name = test_name ^ "." ^ ext in
let setup =
match Hashtbl.find tests test_name with
match Hashtbl.find tests src_test_name with
| setup -> setup
| exception Not_found ->
let s = {has_ref= false; has_opts= false; extra_deps= []} in
Hashtbl.add tests test_name s ;
s
| exception Not_found -> (
(* foo_file-some_variant.ml should derive from foo_file.ml *)
match String.index_opt test_name '-' with
| None -> add_test tests src_test_name
| Some i ->
let base_file = String.sub test_name 0 i ^ "." ^ ext in
add_test ~base_file tests src_test_name )
in
match rest with
| [] -> ()
Expand All @@ -42,6 +51,7 @@ let emit_test buffer test_name setup =
else ""
in
let ref_name = if setup.has_ref then test_name ^ ".ref" else test_name in
let base_test_name = Option.value setup.base_file ~default:test_name in
let extra_deps = String.concat " " setup.extra_deps in
Printf.ksprintf
(Buffer.add_string buffer)
Expand All @@ -59,7 +69,7 @@ let emit_test buffer test_name setup =
(deps %s %s.output)
(action (diff %s %s.output)))
|}
test_name test_name extra_deps opts ref_name test_name ref_name
test_name base_test_name extra_deps opts ref_name test_name ref_name
test_name

let tests = Hashtbl.create 64
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion test/passing/exp_grouping_parens.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/extensions_indent.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/extensions_indent.mli

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/extensions_sugar_always.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/field_op_begin_line.ml

This file was deleted.

File renamed without changes.
1 change: 0 additions & 1 deletion test/passing/function_indent_never.ml

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion test/passing/ite_fit_or_vertical.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/ite_fit_or_vertical_closing.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/ite_fit_or_vertical_no_indicate.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/ite_kr.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/ite_kr_closing.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/ite_kw_first.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/ite_kw_first_closing.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/ite_kw_first_no_indicate.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/ite_no_indicate.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/let_binding_in_indent.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/let_binding_indent.ml

This file was deleted.

File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion test/passing/let_module_sparse.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/list-space_around.ml

This file was deleted.

File renamed without changes.
1 change: 0 additions & 1 deletion test/passing/match_indent_never.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/module_item_spacing_preserve.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/module_item_spacing_sparse.ml

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion test/passing/open_auto.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/open_long.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/open_preserve.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/open_short.ml

This file was deleted.

File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion test/passing/record_loose.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/record_tight_decl.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/sequence_preserve.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/types-compact-space_around-docked.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/types-compact-space_around.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/types-compact.ml

This file was deleted.

File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion test/passing/types-sparse-space_around.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/types-sparse.ml

This file was deleted.

1 change: 0 additions & 1 deletion test/passing/types_indent.ml

This file was deleted.