-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simple framework for update-policy-like thing in grammarware
- Loading branch information
1 parent
a889685
commit 1d134d3
Showing
12 changed files
with
151 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
all: | ||
make build | ||
make test | ||
|
||
build: | ||
cp ../../convergence/xbgf/fl/snapshot/rascal.bgf tests/bad-f/g1.bgf | ||
cp ../../convergence/xbgf/fl/snapshot/rascal.bgf tests/bad-d/g1.bgf | ||
cp ../../convergence/xbgf/fl/snapshot/rascal.bgf tests/independent/g1.bgf | ||
cp ../../convergence/xbgf/fl/snapshot/rascal.bgf tests/input/g1.bgf | ||
cp ../../convergence/xbgf/fl/snapshot/rascal.bgf tests/incompatible/g1.bgf | ||
|
||
test: | ||
./testperform bad-f || echo "Ok" | ||
./testperform bad-d || echo "Ok" | ||
./testperform independent || echo "Ok" | ||
./testperform input || echo "Ok" | ||
./testperform incompatible || echo "Ok" | ||
|
||
quiet: | ||
make test 2> /dev/null | grep OUTCOME | ||
|
||
clean: | ||
rm -f tests/*/g?.bgf tests/*/*.cbgf tests/*/d-1*.xbgf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/sh | ||
|
||
echo [Test Update] $1 | ||
../../../shared/tools/checkxml xbgf tests/$1/f.xbgf || exit -1 | ||
../../../shared/tools/checkxml xbgf tests/$1/d.xbgf || exit -1 | ||
../../../shared/tools/checkxml bgf tests/$1/g1.bgf || exit -1 | ||
# let's try f of G1 | ||
../../../shared/tools/xbgf tests/$1/f.xbgf tests/$1/g1.bgf tests/$1/g2.bgf | ||
if [ $? -ne 0 ] | ||
then | ||
echo "OUTCOME for $1: Impossible output — bad f." | ||
exit -1 | ||
fi | ||
# let's try ∆ of G1 | ||
../../../shared/tools/xbgf tests/$1/d.xbgf tests/$1/g1.bgf tests/$1/g3.bgf | ||
if [ $? -ne 0 ] | ||
then | ||
echo "OUTCOME for $1: Impossible output — incompatible ∆." | ||
exit -1 | ||
fi | ||
# let's try f of ∆ of G1 and ∆ of f of G1 | ||
../../../shared/tools/xbgf tests/$1/f.xbgf tests/$1/g3.bgf tests/$1/g4.bgf && ../../../shared/tools/xbgf tests/$1/d.xbgf tests/$1/g2.bgf tests/$1/g5.bgf && gdt tests/$1/g4.bgf tests/$1/g5.bgf | ||
if [ $? -eq 0 ] | ||
then | ||
echo "OUTCOME for $1: f and ∆ are independent; any composition is valid." | ||
exit -1 | ||
fi | ||
# let's try f of ∆ of G1 and ∆ of f of G1 | ||
../../../shared/tools/xbgf2cbgf tests/$1/d.xbgf tests/$1/d.cbgf tests/$1/g1.bgf | ||
../../../shared/tools/cbgf2xbgf tests/$1/d.cbgf /dev/null tests/$1/d-1.xbgf | ||
../../../shared/tools/appendxbgf tests/$1/d-1-f.xbgf tests/$1/d-1.xbgf tests/$1/f.xbgf | ||
../../../shared/tools/xbgf tests/$1/d-1-f.xbgf tests/$1/g3.bgf tests/$1/g6.bgf && gdt tests/$1/g2.bgf tests/$1/g6.bgf | ||
if [ $? -eq 0 ] | ||
then | ||
echo "OUTCOME for $1: ∆ messes with input of f; a composition with reversed ∆ is valid." | ||
exit -1 | ||
fi | ||
echo "OUTCOME for $1: f and ∆ are incompatible." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xbgf:sequence xmlns:bgf="http://planet-sl.org/bgf" xmlns:xbgf="http://planet-sl.org/xbgf"> | ||
<xbgf:rename> | ||
<nonterminal> | ||
<from>Prg</from> | ||
<to>Program</to> | ||
</nonterminal> | ||
</xbgf:rename> | ||
</xbgf:sequence> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xbgf:sequence xmlns:bgf="http://planet-sl.org/bgf" xmlns:xbgf="http://planet-sl.org/xbgf"> | ||
<xbgf:rename> | ||
<nonterminal> | ||
<from>Expr</from> | ||
<to>Expression</to> | ||
</nonterminal> | ||
</xbgf:rename> | ||
</xbgf:sequence> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xbgf:sequence xmlns:bgf="http://planet-sl.org/bgf" xmlns:xbgf="http://planet-sl.org/xbgf"> | ||
<xbgf:rename> | ||
<nonterminal> | ||
<from>Expr</from> | ||
<to>Expression</to> | ||
</nonterminal> | ||
</xbgf:rename> | ||
</xbgf:sequence> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xbgf:sequence xmlns:bgf="http://planet-sl.org/bgf" xmlns:xbgf="http://planet-sl.org/xbgf"> | ||
<xbgf:rename> | ||
<nonterminal> | ||
<from>Prg</from> | ||
<to>Program</to> | ||
</nonterminal> | ||
</xbgf:rename> | ||
</xbgf:sequence> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xbgf:sequence xmlns:bgf="http://planet-sl.org/bgf" xmlns:xbgf="http://planet-sl.org/xbgf"> | ||
<xbgf:rename> | ||
<nonterminal> | ||
<from>Function</from> | ||
<to>Expression</to> | ||
</nonterminal> | ||
</xbgf:rename> | ||
</xbgf:sequence> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xbgf:sequence xmlns:bgf="http://planet-sl.org/bgf" xmlns:xbgf="http://planet-sl.org/xbgf"> | ||
<xbgf:rename> | ||
<nonterminal> | ||
<from>Expr</from> | ||
<to>Expression</to> | ||
</nonterminal> | ||
</xbgf:rename> | ||
</xbgf:sequence> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xbgf:sequence xmlns:bgf="http://planet-sl.org/bgf" xmlns:xbgf="http://planet-sl.org/xbgf"> | ||
<xbgf:rename> | ||
<nonterminal> | ||
<from>Name</from> | ||
<to>Identifier</to> | ||
</nonterminal> | ||
</xbgf:rename> | ||
</xbgf:sequence> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xbgf:sequence xmlns:bgf="http://planet-sl.org/bgf" xmlns:xbgf="http://planet-sl.org/xbgf"> | ||
<xbgf:rename> | ||
<nonterminal> | ||
<from>Expr</from> | ||
<to>Expression</to> | ||
</nonterminal> | ||
</xbgf:rename> | ||
</xbgf:sequence> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xbgf:sequence xmlns:bgf="http://planet-sl.org/bgf" xmlns:xbgf="http://planet-sl.org/xbgf"> | ||
<xbgf:rename> | ||
<nonterminal> | ||
<from>Expr</from> | ||
<to>Exp</to> | ||
</nonterminal> | ||
</xbgf:rename> | ||
</xbgf:sequence> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xbgf:sequence xmlns:bgf="http://planet-sl.org/bgf" xmlns:xbgf="http://planet-sl.org/xbgf"> | ||
<xbgf:rename> | ||
<nonterminal> | ||
<from>Expr</from> | ||
<to>Expression</to> | ||
</nonterminal> | ||
</xbgf:rename> | ||
</xbgf:sequence> |