-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update test script to check output (#336)
* formatting the test, removing old code * new test case with less going on * updating primops test case to use local vars not fields * scala style, whitespace, a new util function, comments, variable declaration first cut * updating bool literal test to refer to a local rather than a field * no prizes for guessing where i copied this file from * assign instead of declare; removing type annotations from declarations output with a comment about why * whitespace * similar enough case for decls, so might as well * updating ifthenelse test case to use locals not fields, fixing a bug in the output code * adding case for if, since it\'s so similar to ifthenelse * intconst test to locals not fields * removing sstore for local variables * fixing scaladocs * updating simplecall test to not use fields * adding a top level return to simple call so its testable * scala style * adding a slightly hacky script to run all the ganache tests locally in one pass, emulating what will happen in Travis without quite as much overhead * scraps * better shell scripting practices * more shell tweaks * Adding some logic to make local testing of specific files easier * shell script hacking; this will likely break on travis beacuse of unresolved issues with jq * moving a comment around; it's valid scala to have it where it was, but the IDE doesn't know how to parse it * whitespace and comments in testing script * adding a call to eth_call and a check on the result * updating travis build to include sha3 utility * fixed a type in a bash variable name, updated the hash implemention i'm using, now computing the right hash at least * possibly better travis install commands * apt command change * adding rhash to the build, to see if that works better * more hashing attempts * code to pick between which hash implementation based on uname * cutting hash to first 8 bytes in travis, adding messages * updating call to use the contract address * stripping quotes off the contract address, adding a dire warning about missing JSON fields, moving latest out of the dictionary part of the params object * guarded hack for running something locally, but i still want to spin up travis for the end of the day * Adding more gas; updating check on testexp and expected so it warns (at least textually; return value is unchanged); updating hostname check so it works * found a duplicated 0x with michael * checking against expected * comments * Adding check on getTransactionRecipt status code * Adding check on getTransactionRecipt status code * updating comments on testing script * removing redundant braces, some binaries from solidity code for local testing, using an easier allocation function * commenting out the failure count incrementer so i can check travis for all the tests * off by one error * removing binaries for local testing and commented line from travis script * fixed a bug with not assigning back to the temp var in the function call case; the simplecall test now passes * fixing Return test * updating Travis travis script to only make a call to eth_call if the JSON describing a test includes an expression to call and to mark it as an error if eth_call gets an error back * adding test expected values to other simple tests * test script output * breaking primops test up into one test per operator * copy paste typos * typos, small fixes * splitting subtraction test into two cases * typos * adding a rough summary of what passed and failed to the output for readability in travis * quick summary * updating codegen to fix logical negation, which entailed fixing bugs in if-then-else and the call to translate expression from translate statement * actually fixing the bug in if-then-else; adding a new test case that showed it to me * removing the json file for a failing test per #337 and #335 * removing JSON per #338 * adding a simple script that tells me which tests are defined but without json so they aren't being run * adding a warning about skipped tests * Adding comments to convenience shell scripts
- Loading branch information
Showing
53 changed files
with
621 additions
and
140 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
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,14 @@ | ||
#!/bin/bash | ||
|
||
|
||
# this is a wrapper on the run_obs_yul script, which produces yul for the ganache tests programs | ||
# without actually running them, that runs it on all of the test programs in a batch mode. it is | ||
# kind of a hack but it works for now and saves a rewrite of the run_obs_yul script. | ||
|
||
for f in $(run_obs_yul.sh | tail -n +2) | ||
do | ||
echo "---------------------------" | ||
echo $f | ||
echo "---------------------------" | ||
run_obs_yul.sh "$f" | ||
done |
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,6 @@ | ||
#!/bin/bash | ||
|
||
# when run from the top level of the repo, this prints out the names of the obsidian files | ||
# in the ganache tests that do not also have a json file paired with them -- that means that | ||
# they won't be run by travis. this also appears in the output of the travis script at the very top. | ||
comm -13 <(ls resources/tests/GanacheTests/*.json | xargs basename -s '.json') <(ls resources/tests/GanacheTests/*.obs | xargs basename -s '.obs') |
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
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
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
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 |
---|---|---|
|
@@ -4,4 +4,8 @@ main contract BoolLiteral{ | |
x = true; | ||
x = false; | ||
} | ||
|
||
transaction main() returns bool { | ||
return false; | ||
} | ||
} |
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
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
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
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
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
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 |
---|---|---|
@@ -1,7 +1,11 @@ | ||
main contract IntConst{ | ||
transaction intconst() { | ||
int x; | ||
x = 4; | ||
x = 12; | ||
return; | ||
} | ||
|
||
transaction main() returns int { | ||
return 12; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,8 @@ | ||
{ | ||
"gas" : 30000000, | ||
"gasprice" : "0x9184e72a000", | ||
"startingeth" : 5000000, | ||
"numaccts" : 1, | ||
"testexp" : "primopsadd()", | ||
"expected" : "13" | ||
} |
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,5 @@ | ||
main contract PrimOpsAdd{ | ||
transaction primopsadd() returns int { | ||
return(5+8); | ||
} | ||
} |
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,8 @@ | ||
{ | ||
"gas" : 30000000, | ||
"gasprice" : "0x9184e72a000", | ||
"startingeth" : 5000000, | ||
"numaccts" : 1, | ||
"testexp" : "primopsand()", | ||
"expected" : "0" | ||
} |
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,5 @@ | ||
main contract PrimOpsAnd{ | ||
transaction primopsand() returns bool { | ||
return(true && false); | ||
} | ||
} |
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,8 @@ | ||
{ | ||
"gas" : 30000000, | ||
"gasprice" : "0x9184e72a000", | ||
"startingeth" : 5000000, | ||
"numaccts" : 1, | ||
"testexp" : "primopsdiv()", | ||
"expected" : "2" | ||
} |
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,5 @@ | ||
main contract PrimOpsDiv{ | ||
transaction primopsdiv() returns int { | ||
return(4/2); | ||
} | ||
} |
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,8 @@ | ||
{ | ||
"gas" : 30000000, | ||
"gasprice" : "0x9184e72a000", | ||
"startingeth" : 5000000, | ||
"numaccts" : 1, | ||
"testexp" : "primopseq()", | ||
"expected" : "0" | ||
} |
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,5 @@ | ||
main contract PrimOpsEq{ | ||
transaction primopseq() returns bool { | ||
return(5 == 9); | ||
} | ||
} |
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,8 @@ | ||
{ | ||
"gas" : 30000000, | ||
"gasprice" : "0x9184e72a000", | ||
"startingeth" : 5000000, | ||
"numaccts" : 1, | ||
"testexp" : "primopsgreater()", | ||
"expected" : "0" | ||
} |
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,5 @@ | ||
main contract PrimOpsGreater{ | ||
transaction primopsgreater() returns bool { | ||
return(12 > 19); | ||
} | ||
} |
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,8 @@ | ||
{ | ||
"gas" : 30000000, | ||
"gasprice" : "0x9184e72a000", | ||
"startingeth" : 5000000, | ||
"numaccts" : 1, | ||
"testexp" : "primopsgreatereq()", | ||
"expected" : "1" | ||
} |
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,5 @@ | ||
main contract PrimOpsGreaterEq{ | ||
transaction primopsgreatereq() returns bool { | ||
return(12 >= 12); | ||
} | ||
} |
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,8 @@ | ||
{ | ||
"gas" : 30000000, | ||
"gasprice" : "0x9184e72a000", | ||
"startingeth" : 5000000, | ||
"numaccts" : 1, | ||
"testexp" : "primopsless()", | ||
"expected" : "1" | ||
} |
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,5 @@ | ||
main contract PrimOpsLess{ | ||
transaction primopsless() returns bool { | ||
return(9 < 10); | ||
} | ||
} |
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,8 @@ | ||
{ | ||
"gas" : 30000000, | ||
"gasprice" : "0x9184e72a000", | ||
"startingeth" : 5000000, | ||
"numaccts" : 1, | ||
"testexp" : "primopslesseq()", | ||
"expected" : "1" | ||
} |
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,5 @@ | ||
main contract PrimOpsLessEq{ | ||
transaction primopslesseq() returns bool { | ||
return(9 <= 19); | ||
} | ||
} |
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,8 @@ | ||
{ | ||
"gas" : 30000000, | ||
"gasprice" : "0x9184e72a000", | ||
"startingeth" : 5000000, | ||
"numaccts" : 1, | ||
"testexp" : "primopsmod()", | ||
"expected" : "5" | ||
} |
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,5 @@ | ||
main contract PrimOpsMod{ | ||
transaction primopsmod() returns int { | ||
return(13 % 8); | ||
} | ||
} |
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,8 @@ | ||
{ | ||
"gas" : 30000000, | ||
"gasprice" : "0x9184e72a000", | ||
"startingeth" : 5000000, | ||
"numaccts" : 1, | ||
"testexp" : "primopsmul()", | ||
"expected" : "20" | ||
} |
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,5 @@ | ||
main contract PrimOpsMul{ | ||
transaction primopsmul() returns int { | ||
return(5*4); | ||
} | ||
} |
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,8 @@ | ||
{ | ||
"gas" : 30000000, | ||
"gasprice" : "0x9184e72a000", | ||
"startingeth" : 5000000, | ||
"numaccts" : 1, | ||
"testexp" : "primopsneq()", | ||
"expected" : "1" | ||
} |
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,5 @@ | ||
main contract PrimOpsNEq{ | ||
transaction primopsneq() returns bool { | ||
return(5 != 9); | ||
} | ||
} |
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,5 @@ | ||
main contract PrimOpsNeg{ | ||
transaction primopsneg() returns int { | ||
return(-20); | ||
} | ||
} |
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,8 @@ | ||
{ | ||
"gas" : 30000000, | ||
"gasprice" : "0x9184e72a000", | ||
"startingeth" : 5000000, | ||
"numaccts" : 1, | ||
"testexp" : "primopsnotfalse()", | ||
"expected" : "1" | ||
} |
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,5 @@ | ||
main contract PrimOpsNotFalse{ | ||
transaction primopsnotfalse() returns bool { | ||
return(! false); | ||
} | ||
} |
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,8 @@ | ||
{ | ||
"gas" : 30000000, | ||
"gasprice" : "0x9184e72a000", | ||
"startingeth" : 5000000, | ||
"numaccts" : 1, | ||
"testexp" : "primopsnottrue()", | ||
"expected" : "0" | ||
} |
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,5 @@ | ||
main contract PrimOpsNotTrue{ | ||
transaction primopsnottrue() returns bool { | ||
return(! true); | ||
} | ||
} |
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,8 @@ | ||
{ | ||
"gas" : 30000000, | ||
"gasprice" : "0x9184e72a000", | ||
"startingeth" : 5000000, | ||
"numaccts" : 1, | ||
"testexp" : "primopsor()", | ||
"expected" : "1" | ||
} |
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,5 @@ | ||
main contract PrimOpsOr{ | ||
transaction primopsor() returns bool { | ||
return(true || false); | ||
} | ||
} |
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,5 @@ | ||
main contract PrimOpsSubNeg{ | ||
transaction primopssubneg() returns int { | ||
return(5-20); | ||
} | ||
} |
Oops, something went wrong.