Files
revng-revng/tests/tools/pipeline/MultiStepPipelineTest.sh
Alessandro Di Federico da7701bd4e Move all executables except revng to libexec/revng
We used to collect all binaries into the `bin/` directory. However this
led to confusions since certain commands where available both as
`revng-command` and `revng command`.

This commit moves all the executables except `revng` into
`libexec/revng`, which, according to FHS, is dedicated to "internal
binaries that are not intended to be executed directly by users or shell
scripts".
2022-03-17 14:10:50 +01:00

44 lines
1000 B
Bash
Executable File

#!/bin/bash
set -e
set -o pipefail
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
OUTPUT="$PWD/MultiStepPipelineOut.txt"
WORKING_DIRECTORY="$PWD/MultiStepPipelineTestDir/"
REFERENCE_OUTPUT="$SCRIPT_DIR/MultiStepPipelineOutput.txt"
function run() {
"$PWD/libexec/revng/revng-pipeline" \
-P="$SCRIPT_DIR/MultiStepPipeline.yml" \
Strings3:Root:Root \
-i "FirstStep:Strings1:$SCRIPT_DIR/MultiStepPipelineInput.txt" \
-o "End:Strings3:$OUTPUT" \
-p "$WORKING_DIRECTORY" \
-s \
"$@"
}
# Cleanup
rm -rf "$WORKING_DIRECTORY"
mkdir -p "$WORKING_DIRECTORY"
# Produce $OUTPUT
run "$@"
diff "$OUTPUT" "$REFERENCE_OUTPUT"
# Produce $OUTPUT again and make sure it has not changed
run "$@"
diff "$OUTPUT" "$REFERENCE_OUTPUT"
# Drop an interemdiate results and recompute
rm "$WORKING_DIRECTORY/SecondStep/Strings1"
run "$@"
diff "$OUTPUT" "$REFERENCE_OUTPUT"
# Recreate the output again
rm "$OUTPUT"
run "$@"
diff "$OUTPUT" "$REFERENCE_OUTPUT"