Skip to content

Commit

Permalink
squash
Browse files Browse the repository at this point in the history
  • Loading branch information
rjbou committed Feb 22, 2024
1 parent 22dbd72 commit 421682a
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 43 deletions.
31 changes: 26 additions & 5 deletions tests/reftests/dune.inc
Original file line number Diff line number Diff line change
@@ -1,21 +1,42 @@

(rule
(alias reftest-init-scripts)
(alias reftest-init-scripts.unix)
(enabled_if (= %{os_type} "Unix"))
(action
(diff init-scripts.test init-scripts.out)))
(diff init-scripts.unix.test init-scripts.unix.out)))

(alias
(name reftest)
(deps (alias reftest-init-scripts)))
(enabled_if (= %{os_type} "Unix"))
(deps (alias reftest-init-scripts.unix)))

(rule
(targets init-scripts.out)
(targets init-scripts.unix.out)
(deps root-N0REP0)
(enabled_if (= %{os_type} "Unix"))
(package opam)
(action
(with-stdout-to
%{targets}
(run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:init-scripts.test} %{read-lines:testing-env}))))
(run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:init-scripts.unix.test} %{read-lines:testing-env}))))

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

(alias
(name reftest)
(deps (alias reftest-scripts)))

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

(rule
(targets opam-repo-N0REP0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,25 @@ No configuration file found, using built-in defaults.
[default] Initialised
### # we need the switch for variables file
### opam switch create fake --empty --root root
### find root/opam-init/ | unordered
root/opam-init/
root/opam-init/complete.sh
root/opam-init/complete.zsh
root/opam-init/env_hook.csh
root/opam-init/env_hook.fish
root/opam-init/env_hook.sh
root/opam-init/env_hook.zsh
root/opam-init/hooks
root/opam-init/hooks/sandbox.sh
root/opam-init/hooks/sandbox.sh.hash
root/opam-init/init.cmd
root/opam-init/init.csh
root/opam-init/init.fish
root/opam-init/init.ps1
root/opam-init/init.sh
root/opam-init/init.zsh
root/opam-init/variables.cmd
root/opam-init/variables.csh
root/opam-init/variables.fish
root/opam-init/variables.ps1
root/opam-init/variables.sh
### ls root/opam-init
complete.sh
complete.zsh
env_hook.csh
env_hook.fish
env_hook.sh
env_hook.zsh
hooks
init.cmd
init.csh
init.fish
init.ps1
init.sh
init.zsh
variables.cmd
variables.csh
variables.fish
variables.ps1
variables.sh
### : Init scripts :
### cat root/opam-init/init.sh
if [ -t 0 ]; then
Expand Down Expand Up @@ -63,44 +60,33 @@ if exist "${BASEDIR}/root/opam-init/variables.cmd" call "${BASEDIR}/root/opam-in
### cat root/opam-init/init.ps1
. "${BASEDIR}/root/opam-init/variables.ps1" *> $null
### : Variables scripts :
### cat root/opam-init/variables.sh
### cat root/opam-init/variables.sh | grep -v man | grep -v MANPATH
# Prefix of the current opam switch
OPAM_SWITCH_PREFIX='${BASEDIR}/root/fake'; export OPAM_SWITCH_PREFIX;
# Current opam switch man dir
MANPATH="$MANPATH":'${BASEDIR}/root/fake/man'; export MANPATH;
# Binary dir for opam switch fake
PATH='${BASEDIR}/root/fake/bin':"$PATH"; export PATH;
### test -f root/opam-init/variables.zsh
# Return code 1 #
### cat root/opam-init/variables.fish
### cat root/opam-init/variables.fish | grep -v man | grep -v MANPATH
# Prefix of the current opam switch
set -gx OPAM_SWITCH_PREFIX '${BASEDIR}/root/fake';
# Current opam switch man dir
if [ (count $MANPATH) -gt 0 ]; set -gx MANPATH $MANPATH '${BASEDIR}/root/fake/man'; end;
# Binary dir for opam switch fake
set -gx PATH '${BASEDIR}/root/fake/bin' $PATH;
### cat root/opam-init/variables.csh
### cat root/opam-init/variables.csh | grep -v man | grep -v MANPATH
# Prefix of the current opam switch
if ( ! ${?OPAM_SWITCH_PREFIX} ) setenv OPAM_SWITCH_PREFIX ""
setenv OPAM_SWITCH_PREFIX '${BASEDIR}/root/fake'
# Current opam switch man dir
if ( ! ${?MANPATH} ) setenv MANPATH ""
setenv MANPATH "$MANPATH":'${BASEDIR}/root/fake/man'
# Binary dir for opam switch fake
if ( ! ${?PATH} ) setenv PATH ""
setenv PATH '${BASEDIR}/root/fake/bin':"$PATH"
### cat root/opam-init/variables.cmd
### cat root/opam-init/variables.cmd | grep -v man | grep -v MANPATH
:: Prefix of the current opam switch
set "OPAM_SWITCH_PREFIX=${BASEDIR}/root/fake"
:: Current opam switch man dir
set "MANPATH=%MANPATH%:${BASEDIR}/root/fake/man"
:: Binary dir for opam switch fake
set "PATH=${BASEDIR}/root/fake/bin:%PATH%"
### cat root/opam-init/variables.ps1
### cat root/opam-init/variables.ps1 | grep -v man | grep -v MANPATH
# Prefix of the current opam switch
$env:OPAM_SWITCH_PREFIX='${BASEDIR}/root/fake'
# Current opam switch man dir
$env:MANPATH="$env:MANPATH" + ':${BASEDIR}/root/fake/man'
# Binary dir for opam switch fake
$env:PATH='${BASEDIR}/root/fake/bin:' + "$env:PATH"
### : Env hook scripts :
Expand Down

0 comments on commit 421682a

Please sign in to comment.