#!/bin/bash

# Always run the tests from this script's folder
cd "$(dirname "$0")" || exit 1

# Read default configuration
# shellcheck source=test/_include.sh
source ../_include.sh

# Test files user supplied files ($@) otherwise test everything
# shellcheck disable=SC2068
for file_path in ${@:-../parsing/*.sed}
do

    output_file=$(basename "$file_path").txt

    # Generate the tokenized version
    test_message "Generating $output_file"
    $sedsed --tokenize -f "$file_path" > "$output_file" || failed=1
done

tests_git_status
tests_exit
