Attention une mise à jour du service Gitlab va être effectuée le mardi 30 novembre entre 17h30 et 18h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes. Cette mise à jour intermédiaire en version 14.0.12 nous permettra de rapidement pouvoir mettre à votre disposition une version plus récente.

Commit c9813dd2 authored by POTTIER Francois's avatar POTTIER Francois
Browse files

Add [promote.sh] to promote a specific test (or to add a new test).

parent 344d760f
Pipeline #115995 passed with stages
in 25 seconds
......@@ -55,10 +55,15 @@ speed:
versions:
@ dune build --workspace dune-workspace.versions @all @test
# [make expected] updates the contents of the reference files (those
# [make expected] updates the contents of *all* reference files (those
# that contain the expected output of every test). This command should
# be run only when you trust that every test produces correct output.
# [make expected] can *update* existing reference files, but will not
# *create* them when they do not exist. Also, it updates *all* files;
# it cannot be used to refresh a few specific files. Both of these
# limitations can be worked around by using the script [promote.sh].
.PHONY: expected
expected:
@ dune build @test --auto-promote
......
#!/bin/bash
set -euo pipefail
# This script promotes a specific test, named on the command line.
# To promote a test means to create or update its expected-output files.
# Examples:
# ./promote.sh good/mezzo
# ./promote.sh bad/option
# If this is a newly created test, then [make depend] should be run first
# for dune to know about this test.
for name in "$@"
do
if [[ $name =~ ^good/.* ]] ; then
# A positive test.
echo "Promoting $name..."
# Create the expected-output files if they are missing.
touch test/static/$name.opp.exp
touch test/static/$name.exp
base=${name#good/}
# Ask dune to update the expected-output files.
dune build @$base --auto-promote
elif [[ $name =~ ^bad/.* ]] ; then
# A negative test.
echo "Promoting $name..."
# Create the expected-output file if it is missing.
touch test/static/$name.expected
base=${name#bad/}
# Ask dune to update the expected-output file.
dune build @$base --auto-promote
else
# Unrecognized.
echo "Don't know what to do with '$name'."
echo "This script handles tests whose name begins with good/ or bad/."
exit 1
fi
done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment