Skip to content

Commit

Permalink
Merge pull request ocaml#4979 from rjbou/reftests
Browse files Browse the repository at this point in the history
Reftests: port opam-rt tests
  • Loading branch information
kit-ty-kate authored Jan 3, 2022
2 parents e6b87e1 + 9b8ffc2 commit 3625a1a
Show file tree
Hide file tree
Showing 7 changed files with 1,050 additions and 1 deletion.
2 changes: 2 additions & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ users)
* opam root version: add local switch cases [#4763 @rjbou] [2.1.0~rc2 #4715]
* opam root version: add reinit test casess [#4763 @rjbou] [2.1.0~rc2 #4750]
* Add & update env tests [#4861 #4841 @rjbou @dra27]
* Port opam-rt tests: orphans, dep-cycles, reinstall, and big-upgrade [#4979 @AltGr]
### Engine
* Add `opam-cat` to normalise opam file printing [#4763 @rjbou @dra27] [2.1.0~rc2 #4715]
* Fix meld reftest: open only with failing ones [#4913 @rjbou]
Expand All @@ -190,6 +191,7 @@ users)
* Add `<pin:path>` header to specify incomplete opam files to pin, it is updated from a template in reftest run (no lint errors) [#4966 @rjbou]
* Unescape output [#4966 @rjbou]
* Clean outputs from opam error reporting block [#4966 @rjbou]
* Avoid diff when the repo is too old [#4979 @AltGr]


## Github Actions
Expand Down
88 changes: 88 additions & 0 deletions tests/reftests/dune.inc
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,74 @@
%{targets}
(run ./run.exe %{bin:opam} %{dep:opamroot-versions.test} %{read-lines:testing-env}))))

(rule
(alias reftest-opamrt-big-upgrade)
(action
(diff opamrt-big-upgrade.test opamrt-big-upgrade.out)))

(alias
(name reftest)
(deps (alias reftest-opamrt-big-upgrade)))

(rule
(targets opamrt-big-upgrade.out)
(deps root-7090735c9d)
(action
(with-stdout-to
%{targets}
(run ./run.exe %{bin:opam} %{dep:opamrt-big-upgrade.test} %{read-lines:testing-env}))))

(rule
(alias reftest-opamrt-dep-cycle)
(action
(diff opamrt-dep-cycle.test opamrt-dep-cycle.out)))

(alias
(name reftest)
(deps (alias reftest-opamrt-dep-cycle)))

(rule
(targets opamrt-dep-cycle.out)
(deps root-N0REP0)
(action
(with-stdout-to
%{targets}
(run ./run.exe %{bin:opam} %{dep:opamrt-dep-cycle.test} %{read-lines:testing-env}))))

(rule
(alias reftest-opamrt-reinstall)
(action
(diff opamrt-reinstall.test opamrt-reinstall.out)))

(alias
(name reftest)
(deps (alias reftest-opamrt-reinstall)))

(rule
(targets opamrt-reinstall.out)
(deps root-N0REP0)
(action
(with-stdout-to
%{targets}
(run ./run.exe %{bin:opam} %{dep:opamrt-reinstall.test} %{read-lines:testing-env}))))

(rule
(alias reftest-orphans)
(action
(diff orphans.test orphans.out)))

(alias
(name reftest)
(deps (alias reftest-orphans)))

(rule
(targets orphans.out)
(deps root-N0REP0)
(action
(with-stdout-to
%{targets}
(run ./run.exe %{bin:opam} %{dep:orphans.test} %{read-lines:testing-env}))))

(rule
(alias reftest-pat-sub)
(action
Expand Down Expand Up @@ -393,6 +461,26 @@
--no-setup --bypass-checks --no-opamrc --bare
file://%{dep:opam-repo-009e00fa})))))

(rule
(targets opam-archive-7090735c9d.tar.gz)
(action (run wget --quiet -O %{targets} https://github.com/ocaml/opam-repository/archive/7090735c9d.tar.gz)))

(rule
(targets opam-repo-7090735c9d)
(action
(progn
(run mkdir -p %{targets})
(run tar -C %{targets} -xzf %{dep:opam-archive-7090735c9d.tar.gz} --strip-components=1))))

(rule
(targets root-7090735c9d)
(action
(progn
(ignore-stdout
(run %{bin:opam} init --root=%{targets}
--no-setup --bypass-checks --no-opamrc --bare
file://%{dep:opam-repo-7090735c9d})))))

(rule
(targets opam-archive-ad4dd344.tar.gz)
(action (run wget --quiet -O %{targets} https://github.com/ocaml/opam-repository/archive/ad4dd344.tar.gz)))
Expand Down
Loading

0 comments on commit 3625a1a

Please sign in to comment.