File: current_file.mli

package info (click to toggle)
ppx-expect 0.17.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 948 kB
  • sloc: ml: 3,399; ansic: 104; javascript: 19; makefile: 15; sh: 2
file content (29 lines) | stat: -rw-r--r-- 883 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
open! Base

(** We dynamically keep track of the "currently executing" file to make sure tests are
    not being run from outside the file in which they are defined. *)

val set : filename_rel_to_project_root:string -> unit
val unset : unit -> unit
val get : unit -> string

(** The absolute path of the working directory when the executable was first run.

    Forcing the [Lazy.t] raises if the initial call to [Stdlib.Sys.getcwd] raised.
*)
val initial_dir : string Lazy.t

(** Given a path relative to the initial working directory, returns an absolute path.

    Raises if the initial call to [Stdlib.Sys.getcwd] raised.
*)
val absolute_path : string -> string

(** Verifies that [filename_rel_to_project_root] was the last file set as [current].

    Raises if not.
*)
val verify_that_file_is_current_exn
  :  line_number:int
  -> filename_rel_to_project_root:string
  -> unit