Skip to content

Commit

Permalink
#3: simple integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 authored and deemp committed Jan 10, 2024
1 parent 0ddcdd9 commit ba2cad0
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/itest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: itest
on:
push:
branches: master
pull_request:
branches: master
jobs:
itest:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 20
- run: npm install -g eolang
- run: ./pipeline.sh
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.eoc
before.txt
after.txt
app.eo
*.bak
eo-phi-normalizer/src/Language/EO/Phi/Syntax/Lex.hs
eo-phi-normalizer/src/Language/EO/Phi/Syntax/Par.hs
Expand Down
40 changes: 40 additions & 0 deletions pipeline.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash
set -x
set -e

EO=0.34.2

cat > app.eo <<EOT
[args] > app
QQ.io.stdout > @
"Hello, world!\n"
EOT

eoc "--parser=${EO}" clean
eoc "--parser=${EO}" link
eoc "--parser=${EO}" --alone dataize app > before.txt

eoc "--parser=${EO}" phi

# Now, you modify/normalize this file:
# .eoc/phi/app.phi

eoc "--parser=${EO}" unphi

cp .eoc/unphi/app.xmir .eoc/2-optimize/app.xmir

eoc "--parser=${EO}" print

cp .eoc/print/app.eo app.eo

eoc "--parser=${EO}" clean

eoc "--parser=${EO}" link
eoc "--parser=${EO}" --alone dataize app > after.txt

if [ "$(cat before.txt)" == "$(cat after.txt)" ]; then
echo 'SUCCESS'
else
echo 'FAILURE'
exit 1
fi

0 comments on commit ba2cad0

Please sign in to comment.