https://gitlab.com/tezos/tezos
Raw File
Tip revision: 5084ae444fe15be60387fb29b7b9736547e343ba authored by mattiasdrp on 03 April 2024, 15:09:34 UTC
Lib_context/Tests: test_context now uses Tezt
Tip revision: 5084ae4
manifezt.sh
#!/bin/sh

cd "$(git rev-parse --show-toplevel)" || exit 1

# ORIGIN can be specified to replace the comparison point.
if [ -z "$ORIGIN" ]; then
  ORIGIN=master
fi

make -C manifest manifest
CHANGES="$(git diff --name-only $(git merge-base HEAD "$ORIGIN"))"

if [ -z "$CHANGES" ]; then
  echo "No changes => no tests to run."
  echo "(But if you have untracked files, 'git add' them and try again.)"
  exit 0
fi

# Call the manifest in Manifezt mode.
# "--" ensures that if a filename starts with a dash, it is not interpreted as an option.
# Do not put quotes around $CHANGES since we need files to be separate arguments.
# shellcheck disable=SC2086
TSL="$(manifest/manifest --manifezt -- $CHANGES)"

if [ "$TSL" = "false" ]; then
  echo "There are changes, but no tests are affected."
  echo "(But if you have untracked files, 'git add' them and try again.)"
  exit 0
fi

if [ "$RECOMPILE_TEZT" = "no" ]; then
  _build/default/tezt/tests/main.exe "$TSL" "$@"
else
  dune exec tezt/tests/main.exe -- "$TSL" "$@"
fi
back to top