0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-22 08:40:03 +01:00
posthog/hogvm/test.sh

33 lines
819 B
Bash
Raw Normal View History

#!/bin/bash
set -e
2024-07-10 15:11:15 +02:00
cd typescript
pnpm run build
cd ..
cd ..
2024-07-10 15:11:15 +02:00
rm -f hogvm/__tests__/__snapshots__/*.stdout.nodejs
rm -f hogvm/__tests__/__snapshots__/*.stdout.python
for file in hogvm/__tests__/*.hog; do
echo "Testing $file"
# from hogvm/__tests__/*.hog get hogvm/__tests__/__snapshots__/*
basename="${file%.hog}"
basename="${basename##*/}"
basename="hogvm/__tests__/__snapshots__/$basename"
./bin/hoge $file $basename.hoge
./bin/hog --nodejs $basename.hoge > $basename.stdout.nodejs
./bin/hog --python $basename.hoge > $basename.stdout.python
set +e
diff $basename.stdout.nodejs $basename.stdout.python
if [ $? -eq 0 ]; then
mv $basename.stdout.nodejs $basename.stdout
rm $basename.stdout.python
else
echo "Test failed"
fi
set -e
done