mirror of https://github.com/Wilfred/difftastic/
add integration test CI (#32)
parent
a935608722
commit
7b7628230e
@ -0,0 +1,24 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
usage() {
|
||||
echo "$0"
|
||||
echo ""
|
||||
echo "Tests that the parser does not create error nodes"
|
||||
echo "when tested against real Gleam repos"
|
||||
echo ""
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ $# -ne 0 ]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
repos="gleam-lang/stdlib gleam-lang/json gleam-lang/http gleam-lang/example-todomvc gleam-lang/bitwise gleam-lang/erlang gleam-lang/otp gleam-lang/cowboy gleam-lang/hackney gleam-lang/httpc gleam-lang/elli gleam-lang/javascript gleam-lang/example-echo-server gleam-lang/plug"
|
||||
|
||||
for repo in $repos; do
|
||||
./scripts/parse_repo.sh $repo
|
||||
done
|
||||
@ -0,0 +1,29 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
usage() {
|
||||
echo "$0 owner/repository"
|
||||
echo ""
|
||||
echo "Runs the parser against Gleam files in a GitHub repository"
|
||||
echo ""
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
gh_repo="$1"
|
||||
dir="test/integration/${gh_repo//[\/-]/_}"
|
||||
|
||||
if [[ ! -d "$dir" ]]; then
|
||||
mkdir -p "$(dirname "$dir")"
|
||||
git clone --depth 1 "https://github.com/$gh_repo.git" "$dir"
|
||||
fi
|
||||
|
||||
echo "Running parser against $gh_repo"
|
||||
|
||||
npx tree-sitter parse --quiet --stat "$dir/**/*.gleam"
|
||||
@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
||||
Loading…
Reference in New Issue