From 66c74426c6508a675f9d6233eacc549c6c484746 Mon Sep 17 00:00:00 2001 From: Kate Date: Mon, 17 Oct 2022 20:12:05 +0100 Subject: [PATCH 1/3] reftest: Make the binary name of opam the same accross platforms (used when testing invalid commands) --- tests/reftests/dune.inc | 134 ++++++++++++++++++++-------------------- tests/reftests/gen.ml | 2 +- 2 files changed, 68 insertions(+), 68 deletions(-) diff --git a/tests/reftests/dune.inc b/tests/reftests/dune.inc index f786b940ab5..dcf589d2c7e 100644 --- a/tests/reftests/dune.inc +++ b/tests/reftests/dune.inc @@ -14,7 +14,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:admin-add-constraint.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:admin-add-constraint.test} %{read-lines:testing-env})))) (rule (alias reftest-assume-built) @@ -31,7 +31,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:assume-built.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:assume-built.test} %{read-lines:testing-env})))) (rule (alias reftest-autopin) @@ -48,7 +48,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:autopin.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:autopin.test} %{read-lines:testing-env})))) (rule (alias reftest-avoid-version) @@ -65,7 +65,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:avoid-version.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:avoid-version.test} %{read-lines:testing-env})))) (rule (alias reftest-best-effort) @@ -82,7 +82,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:best-effort.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:best-effort.test} %{read-lines:testing-env})))) (rule (alias reftest-clean) @@ -99,7 +99,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:clean.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:clean.test} %{read-lines:testing-env})))) (rule (alias reftest-cli-versioning) @@ -116,7 +116,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:cli-versioning.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:cli-versioning.test} %{read-lines:testing-env})))) (rule (alias reftest-config) @@ -133,7 +133,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:config.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:config.test} %{read-lines:testing-env})))) (rule (alias reftest-conflict-4373) @@ -150,7 +150,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:conflict-4373.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:conflict-4373.test} %{read-lines:testing-env})))) (rule (alias reftest-conflict-badversion) @@ -167,7 +167,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:conflict-badversion.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:conflict-badversion.test} %{read-lines:testing-env})))) (rule (alias reftest-conflict-camlp4) @@ -184,7 +184,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:conflict-camlp4.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:conflict-camlp4.test} %{read-lines:testing-env})))) (rule (alias reftest-conflict-core) @@ -201,7 +201,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:conflict-core.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:conflict-core.test} %{read-lines:testing-env})))) (rule (alias reftest-conflict-resto) @@ -218,7 +218,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:conflict-resto.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:conflict-resto.test} %{read-lines:testing-env})))) (rule (alias reftest-conflict-solo5) @@ -235,7 +235,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:conflict-solo5.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:conflict-solo5.test} %{read-lines:testing-env})))) (rule (alias reftest-cudf-preprocess) @@ -252,7 +252,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:cudf-preprocess.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:cudf-preprocess.test} %{read-lines:testing-env})))) (rule (alias reftest-depexts) @@ -269,7 +269,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:depexts.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:depexts.test} %{read-lines:testing-env})))) (rule (alias reftest-deprecated) @@ -286,7 +286,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:deprecated.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:deprecated.test} %{read-lines:testing-env})))) (rule (alias reftest-deps-only) @@ -303,7 +303,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:deps-only.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:deps-only.test} %{read-lines:testing-env})))) (rule (alias reftest-dot-install) @@ -320,7 +320,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:dot-install.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:dot-install.test} %{read-lines:testing-env})))) (rule (alias reftest-empty-conflicts-001) @@ -337,7 +337,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:empty-conflicts-001.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:empty-conflicts-001.test} %{read-lines:testing-env})))) (rule (alias reftest-empty-conflicts-002) @@ -354,7 +354,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:empty-conflicts-002.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:empty-conflicts-002.test} %{read-lines:testing-env})))) (rule (alias reftest-empty-conflicts-003) @@ -371,7 +371,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:empty-conflicts-003.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:empty-conflicts-003.test} %{read-lines:testing-env})))) (rule (alias reftest-empty-conflicts-004) @@ -388,7 +388,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:empty-conflicts-004.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:empty-conflicts-004.test} %{read-lines:testing-env})))) (rule (alias reftest-empty-conflicts-005) @@ -405,7 +405,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:empty-conflicts-005.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:empty-conflicts-005.test} %{read-lines:testing-env})))) (rule (alias reftest-empty-conflicts-006) @@ -422,7 +422,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:empty-conflicts-006.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:empty-conflicts-006.test} %{read-lines:testing-env})))) (rule (alias reftest-env) @@ -439,7 +439,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:env.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:env.test} %{read-lines:testing-env})))) (rule (alias reftest-init) @@ -456,7 +456,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:init.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:init.test} %{read-lines:testing-env})))) (rule (alias reftest-inplace) @@ -473,7 +473,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:inplace.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:inplace.test} %{read-lines:testing-env})))) (rule (alias reftest-install-formula) @@ -490,7 +490,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:install-formula.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:install-formula.test} %{read-lines:testing-env})))) (rule (alias reftest-install-pgocaml) @@ -507,7 +507,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:install-pgocaml.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:install-pgocaml.test} %{read-lines:testing-env})))) (rule (alias reftest-json.unix) @@ -527,7 +527,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:json.unix.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:json.unix.test} %{read-lines:testing-env})))) (rule (alias reftest-legacy-git) @@ -544,7 +544,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:legacy-git.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:legacy-git.test} %{read-lines:testing-env})))) (rule (alias reftest-legacy-local) @@ -561,7 +561,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:legacy-local.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:legacy-local.test} %{read-lines:testing-env})))) (rule (alias reftest-lint) @@ -578,7 +578,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:lint.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:lint.test} %{read-lines:testing-env})))) (rule (alias reftest-list) @@ -595,7 +595,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:list.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:list.test} %{read-lines:testing-env})))) (rule (alias reftest-list.unix) @@ -615,7 +615,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:list.unix.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:list.unix.test} %{read-lines:testing-env})))) (rule (alias reftest-lock) @@ -632,7 +632,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:lock.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:lock.test} %{read-lines:testing-env})))) (rule (alias reftest-opamroot-versions) @@ -649,7 +649,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:opamroot-versions.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:opamroot-versions.test} %{read-lines:testing-env})))) (rule (alias reftest-opamrt-big-upgrade) @@ -666,7 +666,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:opamrt-big-upgrade.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:opamrt-big-upgrade.test} %{read-lines:testing-env})))) (rule (alias reftest-opamrt-dep-cycle) @@ -683,7 +683,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:opamrt-dep-cycle.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:opamrt-dep-cycle.test} %{read-lines:testing-env})))) (rule (alias reftest-opamrt-reinstall) @@ -700,7 +700,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:opamrt-reinstall.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:opamrt-reinstall.test} %{read-lines:testing-env})))) (rule (alias reftest-orphans) @@ -717,7 +717,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:orphans.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:orphans.test} %{read-lines:testing-env})))) (rule (alias reftest-parallel) @@ -734,7 +734,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:parallel.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:parallel.test} %{read-lines:testing-env})))) (rule (alias reftest-pat-sub) @@ -751,7 +751,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:pat-sub.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:pat-sub.test} %{read-lines:testing-env})))) (rule (alias reftest-pin) @@ -768,7 +768,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:pin.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:pin.test} %{read-lines:testing-env})))) (rule (alias reftest-rebuild) @@ -785,7 +785,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:rebuild.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:rebuild.test} %{read-lines:testing-env})))) (rule (alias reftest-rec-pin) @@ -802,7 +802,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:rec-pin.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:rec-pin.test} %{read-lines:testing-env})))) (rule (alias reftest-reinstall) @@ -819,7 +819,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:reinstall.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:reinstall.test} %{read-lines:testing-env})))) (rule (alias reftest-remove) @@ -836,7 +836,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:remove.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:remove.test} %{read-lines:testing-env})))) (rule (alias reftest-repository) @@ -853,7 +853,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:repository.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:repository.test} %{read-lines:testing-env})))) (rule (alias reftest-resolve-variables) @@ -870,7 +870,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:resolve-variables.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:resolve-variables.test} %{read-lines:testing-env})))) (rule (alias reftest-shared-fetch) @@ -887,7 +887,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:shared-fetch.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:shared-fetch.test} %{read-lines:testing-env})))) (rule (alias reftest-show) @@ -904,7 +904,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:show.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:show.test} %{read-lines:testing-env})))) (rule (alias reftest-source) @@ -921,7 +921,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:source.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:source.test} %{read-lines:testing-env})))) (rule (alias reftest-switch-creation) @@ -938,7 +938,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:switch-creation.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:switch-creation.test} %{read-lines:testing-env})))) (rule (alias reftest-switch-import) @@ -955,7 +955,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:switch-import.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:switch-import.test} %{read-lines:testing-env})))) (rule (alias reftest-switch-invariant) @@ -972,7 +972,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:switch-invariant.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:switch-invariant.test} %{read-lines:testing-env})))) (rule (alias reftest-switch-set) @@ -989,7 +989,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:switch-set.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:switch-set.test} %{read-lines:testing-env})))) (rule (alias reftest-tree) @@ -1006,7 +1006,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:tree.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:tree.test} %{read-lines:testing-env})))) (rule (alias reftest-unhelpful-conflicts-001) @@ -1023,7 +1023,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:unhelpful-conflicts-001.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:unhelpful-conflicts-001.test} %{read-lines:testing-env})))) (rule (alias reftest-update-upgrade) @@ -1040,7 +1040,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:update-upgrade.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:update-upgrade.test} %{read-lines:testing-env})))) (rule (alias reftest-upgrade-format) @@ -1057,7 +1057,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:upgrade-format.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:upgrade-format.test} %{read-lines:testing-env})))) (rule (alias reftest-upgrade-two-point-o) @@ -1074,7 +1074,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:upgrade-two-point-o.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:upgrade-two-point-o.test} %{read-lines:testing-env})))) (rule (alias reftest-upgrade) @@ -1091,7 +1091,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:upgrade.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:upgrade.test} %{read-lines:testing-env})))) (rule (alias reftest-var-option) @@ -1108,7 +1108,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:var-option.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:var-option.test} %{read-lines:testing-env})))) (rule (alias reftest-with-dev-setup) @@ -1125,7 +1125,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:with-dev-setup.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:with-dev-setup.test} %{read-lines:testing-env})))) (rule (alias reftest-working-dir) @@ -1142,7 +1142,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{bin:opam} %{dep:working-dir.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:working-dir.test} %{read-lines:testing-env})))) (rule (targets opam-repo-N0REP0) diff --git a/tests/reftests/gen.ml b/tests/reftests/gen.ml index b0e0d8940bd..5382642f7e6 100644 --- a/tests/reftests/gen.ml +++ b/tests/reftests/gen.ml @@ -38,7 +38,7 @@ let run_rule ~base_name ~archive_hash ~condition = (action (with-stdout-to %%{targets} - (run ./run.exe %%{bin:opam} %%{dep:%s.test} %%{read-lines:testing-env})))) + (run ./run.exe %%{exe:../../src/client/opamMain.exe} %%{dep:%s.test} %%{read-lines:testing-env})))) |} (base_name^".out") (opamroot_directory ~archive_hash) condition base_name let archive_download_rule archive_hash = From 62ba6ea0016ff4d9eef4dffc9cf2b110bf07acbb Mon Sep 17 00:00:00 2001 From: Raja Boujbel Date: Tue, 18 Oct 2022 15:40:29 +0200 Subject: [PATCH 2/3] update changes --- master_changes.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/master_changes.md b/master_changes.md index 3d0e532c730..082f8428b25 100644 --- a/master_changes.md +++ b/master_changes.md @@ -401,6 +401,8 @@ users) * Add config (report) test [#4892 @rjbou] * Add `sed-cmd` command to replace resolved path command printing by command name only [#5285 @rjbou] * Update sed-cmd to handle commands without any arguments [#5257 @kit-ty-kate] + * Make the binary name of opam the same accross platforms (used when testing invalid commands) [#5308 @kit-ty-kate] + * Handle cygpaths for opamp binary path [#5308 @rjbou] ## Github Actions * Add solver backends compile test [#4723 @rjbou] [2.1.0~rc2 #4720] From 9c42884db7bd71bc72ed440e921ced3441ab0c42 Mon Sep 17 00:00:00 2001 From: Kate Date: Thu, 10 Nov 2022 18:52:57 +0000 Subject: [PATCH 3/3] Fix the tests on Cygwin --- src/client/dune | 5 ++ tests/reftests/dune.inc | 134 ++++++++++++++++++++-------------------- tests/reftests/gen.ml | 2 +- tests/reftests/run.ml | 22 +++++-- 4 files changed, 90 insertions(+), 73 deletions(-) diff --git a/src/client/dune b/src/client/dune index da93a5cb39b..bcfb6862109 100644 --- a/src/client/dune +++ b/src/client/dune @@ -27,6 +27,11 @@ ( -> link-opam-manifest.dummy) ))) +; Hack to make the tests work on Cygwin +(rule + (targets opamMain.exe.exe) + (action (copy opamMain.exe %{targets}))) + (rule (with-stdout-to link-opam-manifest.dummy (echo ""))) diff --git a/tests/reftests/dune.inc b/tests/reftests/dune.inc index dcf589d2c7e..458b9457dbe 100644 --- a/tests/reftests/dune.inc +++ b/tests/reftests/dune.inc @@ -14,7 +14,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:admin-add-constraint.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:admin-add-constraint.test} %{read-lines:testing-env})))) (rule (alias reftest-assume-built) @@ -31,7 +31,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:assume-built.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:assume-built.test} %{read-lines:testing-env})))) (rule (alias reftest-autopin) @@ -48,7 +48,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:autopin.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:autopin.test} %{read-lines:testing-env})))) (rule (alias reftest-avoid-version) @@ -65,7 +65,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:avoid-version.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:avoid-version.test} %{read-lines:testing-env})))) (rule (alias reftest-best-effort) @@ -82,7 +82,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:best-effort.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:best-effort.test} %{read-lines:testing-env})))) (rule (alias reftest-clean) @@ -99,7 +99,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:clean.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:clean.test} %{read-lines:testing-env})))) (rule (alias reftest-cli-versioning) @@ -116,7 +116,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:cli-versioning.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:cli-versioning.test} %{read-lines:testing-env})))) (rule (alias reftest-config) @@ -133,7 +133,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:config.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:config.test} %{read-lines:testing-env})))) (rule (alias reftest-conflict-4373) @@ -150,7 +150,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:conflict-4373.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:conflict-4373.test} %{read-lines:testing-env})))) (rule (alias reftest-conflict-badversion) @@ -167,7 +167,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:conflict-badversion.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:conflict-badversion.test} %{read-lines:testing-env})))) (rule (alias reftest-conflict-camlp4) @@ -184,7 +184,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:conflict-camlp4.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:conflict-camlp4.test} %{read-lines:testing-env})))) (rule (alias reftest-conflict-core) @@ -201,7 +201,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:conflict-core.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:conflict-core.test} %{read-lines:testing-env})))) (rule (alias reftest-conflict-resto) @@ -218,7 +218,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:conflict-resto.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:conflict-resto.test} %{read-lines:testing-env})))) (rule (alias reftest-conflict-solo5) @@ -235,7 +235,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:conflict-solo5.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:conflict-solo5.test} %{read-lines:testing-env})))) (rule (alias reftest-cudf-preprocess) @@ -252,7 +252,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:cudf-preprocess.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:cudf-preprocess.test} %{read-lines:testing-env})))) (rule (alias reftest-depexts) @@ -269,7 +269,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:depexts.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:depexts.test} %{read-lines:testing-env})))) (rule (alias reftest-deprecated) @@ -286,7 +286,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:deprecated.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:deprecated.test} %{read-lines:testing-env})))) (rule (alias reftest-deps-only) @@ -303,7 +303,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:deps-only.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:deps-only.test} %{read-lines:testing-env})))) (rule (alias reftest-dot-install) @@ -320,7 +320,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:dot-install.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:dot-install.test} %{read-lines:testing-env})))) (rule (alias reftest-empty-conflicts-001) @@ -337,7 +337,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:empty-conflicts-001.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:empty-conflicts-001.test} %{read-lines:testing-env})))) (rule (alias reftest-empty-conflicts-002) @@ -354,7 +354,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:empty-conflicts-002.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:empty-conflicts-002.test} %{read-lines:testing-env})))) (rule (alias reftest-empty-conflicts-003) @@ -371,7 +371,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:empty-conflicts-003.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:empty-conflicts-003.test} %{read-lines:testing-env})))) (rule (alias reftest-empty-conflicts-004) @@ -388,7 +388,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:empty-conflicts-004.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:empty-conflicts-004.test} %{read-lines:testing-env})))) (rule (alias reftest-empty-conflicts-005) @@ -405,7 +405,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:empty-conflicts-005.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:empty-conflicts-005.test} %{read-lines:testing-env})))) (rule (alias reftest-empty-conflicts-006) @@ -422,7 +422,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:empty-conflicts-006.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:empty-conflicts-006.test} %{read-lines:testing-env})))) (rule (alias reftest-env) @@ -439,7 +439,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:env.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:env.test} %{read-lines:testing-env})))) (rule (alias reftest-init) @@ -456,7 +456,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:init.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:init.test} %{read-lines:testing-env})))) (rule (alias reftest-inplace) @@ -473,7 +473,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:inplace.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:inplace.test} %{read-lines:testing-env})))) (rule (alias reftest-install-formula) @@ -490,7 +490,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:install-formula.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:install-formula.test} %{read-lines:testing-env})))) (rule (alias reftest-install-pgocaml) @@ -507,7 +507,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:install-pgocaml.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:install-pgocaml.test} %{read-lines:testing-env})))) (rule (alias reftest-json.unix) @@ -527,7 +527,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:json.unix.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:json.unix.test} %{read-lines:testing-env})))) (rule (alias reftest-legacy-git) @@ -544,7 +544,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:legacy-git.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:legacy-git.test} %{read-lines:testing-env})))) (rule (alias reftest-legacy-local) @@ -561,7 +561,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:legacy-local.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:legacy-local.test} %{read-lines:testing-env})))) (rule (alias reftest-lint) @@ -578,7 +578,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:lint.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:lint.test} %{read-lines:testing-env})))) (rule (alias reftest-list) @@ -595,7 +595,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:list.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:list.test} %{read-lines:testing-env})))) (rule (alias reftest-list.unix) @@ -615,7 +615,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:list.unix.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:list.unix.test} %{read-lines:testing-env})))) (rule (alias reftest-lock) @@ -632,7 +632,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:lock.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:lock.test} %{read-lines:testing-env})))) (rule (alias reftest-opamroot-versions) @@ -649,7 +649,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:opamroot-versions.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:opamroot-versions.test} %{read-lines:testing-env})))) (rule (alias reftest-opamrt-big-upgrade) @@ -666,7 +666,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:opamrt-big-upgrade.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:opamrt-big-upgrade.test} %{read-lines:testing-env})))) (rule (alias reftest-opamrt-dep-cycle) @@ -683,7 +683,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:opamrt-dep-cycle.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:opamrt-dep-cycle.test} %{read-lines:testing-env})))) (rule (alias reftest-opamrt-reinstall) @@ -700,7 +700,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:opamrt-reinstall.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:opamrt-reinstall.test} %{read-lines:testing-env})))) (rule (alias reftest-orphans) @@ -717,7 +717,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:orphans.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:orphans.test} %{read-lines:testing-env})))) (rule (alias reftest-parallel) @@ -734,7 +734,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:parallel.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:parallel.test} %{read-lines:testing-env})))) (rule (alias reftest-pat-sub) @@ -751,7 +751,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:pat-sub.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:pat-sub.test} %{read-lines:testing-env})))) (rule (alias reftest-pin) @@ -768,7 +768,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:pin.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:pin.test} %{read-lines:testing-env})))) (rule (alias reftest-rebuild) @@ -785,7 +785,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:rebuild.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:rebuild.test} %{read-lines:testing-env})))) (rule (alias reftest-rec-pin) @@ -802,7 +802,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:rec-pin.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:rec-pin.test} %{read-lines:testing-env})))) (rule (alias reftest-reinstall) @@ -819,7 +819,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:reinstall.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:reinstall.test} %{read-lines:testing-env})))) (rule (alias reftest-remove) @@ -836,7 +836,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:remove.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:remove.test} %{read-lines:testing-env})))) (rule (alias reftest-repository) @@ -853,7 +853,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:repository.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:repository.test} %{read-lines:testing-env})))) (rule (alias reftest-resolve-variables) @@ -870,7 +870,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:resolve-variables.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:resolve-variables.test} %{read-lines:testing-env})))) (rule (alias reftest-shared-fetch) @@ -887,7 +887,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:shared-fetch.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:shared-fetch.test} %{read-lines:testing-env})))) (rule (alias reftest-show) @@ -904,7 +904,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:show.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:show.test} %{read-lines:testing-env})))) (rule (alias reftest-source) @@ -921,7 +921,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:source.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:source.test} %{read-lines:testing-env})))) (rule (alias reftest-switch-creation) @@ -938,7 +938,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:switch-creation.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:switch-creation.test} %{read-lines:testing-env})))) (rule (alias reftest-switch-import) @@ -955,7 +955,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:switch-import.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:switch-import.test} %{read-lines:testing-env})))) (rule (alias reftest-switch-invariant) @@ -972,7 +972,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:switch-invariant.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:switch-invariant.test} %{read-lines:testing-env})))) (rule (alias reftest-switch-set) @@ -989,7 +989,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:switch-set.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:switch-set.test} %{read-lines:testing-env})))) (rule (alias reftest-tree) @@ -1006,7 +1006,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:tree.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:tree.test} %{read-lines:testing-env})))) (rule (alias reftest-unhelpful-conflicts-001) @@ -1023,7 +1023,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:unhelpful-conflicts-001.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:unhelpful-conflicts-001.test} %{read-lines:testing-env})))) (rule (alias reftest-update-upgrade) @@ -1040,7 +1040,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:update-upgrade.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:update-upgrade.test} %{read-lines:testing-env})))) (rule (alias reftest-upgrade-format) @@ -1057,7 +1057,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:upgrade-format.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:upgrade-format.test} %{read-lines:testing-env})))) (rule (alias reftest-upgrade-two-point-o) @@ -1074,7 +1074,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:upgrade-two-point-o.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:upgrade-two-point-o.test} %{read-lines:testing-env})))) (rule (alias reftest-upgrade) @@ -1091,7 +1091,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:upgrade.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:upgrade.test} %{read-lines:testing-env})))) (rule (alias reftest-var-option) @@ -1108,7 +1108,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:var-option.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:var-option.test} %{read-lines:testing-env})))) (rule (alias reftest-with-dev-setup) @@ -1125,7 +1125,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:with-dev-setup.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:with-dev-setup.test} %{read-lines:testing-env})))) (rule (alias reftest-working-dir) @@ -1142,7 +1142,7 @@ (action (with-stdout-to %{targets} - (run ./run.exe %{exe:../../src/client/opamMain.exe} %{dep:working-dir.test} %{read-lines:testing-env})))) + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:working-dir.test} %{read-lines:testing-env})))) (rule (targets opam-repo-N0REP0) diff --git a/tests/reftests/gen.ml b/tests/reftests/gen.ml index 5382642f7e6..5ee890adea1 100644 --- a/tests/reftests/gen.ml +++ b/tests/reftests/gen.ml @@ -38,7 +38,7 @@ let run_rule ~base_name ~archive_hash ~condition = (action (with-stdout-to %%{targets} - (run ./run.exe %%{exe:../../src/client/opamMain.exe} %%{dep:%s.test} %%{read-lines:testing-env})))) + (run ./run.exe %%{exe:../../src/client/opamMain.exe.exe} %%{dep:%s.test} %%{read-lines:testing-env})))) |} (base_name^".out") (opamroot_directory ~archive_hash) condition base_name let archive_download_rule archive_hash = diff --git a/tests/reftests/run.ml b/tests/reftests/run.ml index 01e14c80d15..ade9bcfe911 100644 --- a/tests/reftests/run.ml +++ b/tests/reftests/run.ml @@ -60,6 +60,11 @@ type test = { commands: (string * string list) list; } +type opam = { + as_called : string; + as_seen_in_opam : string; +} + let cmd_prompt = "### " let no_opam_repo = "N0REP0" let default_repo = "REPO" @@ -493,12 +498,12 @@ let common_filters ?opam dir = ] @ (match opam with | None -> [] - | Some opam -> [ str opam, Sed "${OPAM}" ]) + | Some opam -> [ str opam.as_seen_in_opam, Sed "${OPAM}" ]) let run_cmd ~opam ~dir ?(vars=[]) ?(filter=[]) ?(silent=false) cmd args = let filter = filter @ common_filters ~opam dir in let var_filters = filters_of_var vars in - let cmd = if cmd = "opam" then opam else cmd in + let cmd = if cmd = "opam" then opam.as_called else cmd in let args = List.map (fun a -> let expanded = @@ -603,7 +608,7 @@ let run_test ?(vars=[]) ~opam t = else ignore @@ command "cp" ["-PR"; opamroot0; opamroot]; let vars = [ - "OPAM", opam; + "OPAM", opam.as_seen_in_opam; "OPAMROOT", opamroot; "BASEDIR", dir; ] @ vars @@ -611,10 +616,10 @@ let run_test ?(vars=[]) ~opam t = if t.repo_hash = no_opam_repo then (mkdir_p (default_repo^"/packages"); write_file ~path:(default_repo^"/repo") ~contents:{|opam-version: "2.0"|}; - ignore @@ command opam ~silent:true + ignore @@ command opam.as_called ~silent:true [ "repository"; "set-url"; "default"; "./"^default_repo; "--root"; opamroot]); - ignore @@ command ~silent:true opam + ignore @@ command ~silent:true opam.as_called ["var"; "--quiet"; "--root"; opamroot; "--global"; "--cli=2.1"; "sys-ocaml-version=4.08.0"]; print_endline t.repo_hash; @@ -790,6 +795,13 @@ let () = match Array.to_list Sys.argv with | _ :: opam :: input :: env -> let opam = OpamFilename.(to_string (of_string opam)) in + let opam = + (* NOTE: We need that to be able to have the same output from Sys.executable_name when calling the opam binary *) + let opam_without_double_exe = Filename.chop_suffix opam ".exe" in + if Sys.cygwin + then {as_called = opam; as_seen_in_opam = opam_without_double_exe} + else {as_called = opam_without_double_exe; as_seen_in_opam = opam_without_double_exe} + in let vars = List.map (fun s -> match OpamStd.String.cut_at s '=' with | Some (var, value) -> var, value