(library
 (name dune_pkg_unit_tests)
 (inline_tests
  (deps
   tar-inputs/plaintext.md
   tarball.tar.gz
   %{bin:git}
   %{bin:curl}
   (env_var DUNE_CONFIG__REV_STORE_CACHE)))
 (libraries
  dune_tests_common
  stdune
  dune_pkg
  dune_engine
  dune_util
  dune_lang
  dune_vcs
  dune_console
  dune_config
  fiber
  http
  opam_core
  threads.posix
  unix
  xdg
  base
  ;; This is because of the (implicit_transitive_deps false)
  ;; in dune-project
  ppx_expect.config
  ppx_expect.config_types
  ppx_inline_test.config)
 (preprocess
  (pps ppx_expect)))

(rule
 (target tarball.tar.gz)
 (deps
  (source_tree tar-inputs))
 (action
  (run tar -czf %{target} %{deps})))

(alias
 (name pkg)
 (deps
  (alias runtest)))

(env
 (_
  (env-vars
   (DUNE_CONFIG__REV_STORE_CACHE enabled))))
