#! /bin/bash

cd "$(dirname "$0")"

(
cat <<'EOF'
//! This file is generated by running `bash test-cases/generate.sh` - do not manually adjust.
mod common;

EOF
ls | grep -v generate.sh | sort | while IFS= read dir; do
cat <<EOF
#[test]
fn $dir() {
    common::test_case("$dir", include_bytes!("../test-cases/$dir/script.sh"), include_bytes!("../test-cases/$dir/stdout.txt"));
}

EOF
done
) > ../tests/scripts.rs
