diff options
author | chriseth <c@ethdev.com> | 2016-11-02 19:32:55 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-11-12 02:59:31 +0800 |
commit | 061b50ae19b0f8b9dcffc8dab5f08c4e26e884fb (patch) | |
tree | 0a641e8964614d486dd425869a38f9c97bd13b99 | |
parent | a40dcfef1257c4b159eb8248ecb0f837b42d8ead (diff) | |
download | dexon-solidity-061b50ae19b0f8b9dcffc8dab5f08c4e26e884fb.tar dexon-solidity-061b50ae19b0f8b9dcffc8dab5f08c4e26e884fb.tar.gz dexon-solidity-061b50ae19b0f8b9dcffc8dab5f08c4e26e884fb.tar.bz2 dexon-solidity-061b50ae19b0f8b9dcffc8dab5f08c4e26e884fb.tar.lz dexon-solidity-061b50ae19b0f8b9dcffc8dab5f08c4e26e884fb.tar.xz dexon-solidity-061b50ae19b0f8b9dcffc8dab5f08c4e26e884fb.tar.zst dexon-solidity-061b50ae19b0f8b9dcffc8dab5f08c4e26e884fb.zip |
Add tests for the std files.
-rwxr-xr-x | scripts/tests.sh | 17 | ||||
-rw-r--r-- | std/StandardToken.sol | 2 | ||||
-rw-r--r-- | std/Token.sol | 2 | ||||
-rw-r--r-- | std/mortal.sol | 2 | ||||
-rw-r--r-- | std/owned.sol | 2 | ||||
-rw-r--r-- | std/std.sol | 2 |
6 files changed, 25 insertions, 2 deletions
diff --git a/scripts/tests.sh b/scripts/tests.sh index 93afd2d2..5fa75d4d 100755 --- a/scripts/tests.sh +++ b/scripts/tests.sh @@ -28,8 +28,21 @@ set -e -# There is an implicit assumption here that we HAVE to run from root directory. -REPO_ROOT=$(pwd) +REPO_ROOT="$(dirname "$0")"/.. + + # Compile all files in std and examples. + +for f in "$REPO_ROOT"/std/*.sol +do + echo "Compiling $f..." + set +e + output=$("$REPO_ROOT"/build/solc/solc "$f" 2>&1) + failed=$? + output=$(echo "$output" | grep -v 'pre-release') + echo "$output" + set -e + test -z "$output" -a "$failed" -eq 0 +done # This conditional is only needed because we don't have a working Homebrew # install for `eth` at the time of writing, so we unzip the ZIP file locally diff --git a/std/StandardToken.sol b/std/StandardToken.sol index 41f2d709..4ff1b8f9 100644 --- a/std/StandardToken.sol +++ b/std/StandardToken.sol @@ -1,3 +1,5 @@ +pragma solidity ^0.4.0; + import "./Token.sol"; contract StandardToken is Token { diff --git a/std/Token.sol b/std/Token.sol index 396dbf9e..59566f26 100644 --- a/std/Token.sol +++ b/std/Token.sol @@ -1,3 +1,5 @@ +pragma solidity ^0.4.0; + contract Token { event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); diff --git a/std/mortal.sol b/std/mortal.sol index 8de019ab..f0a6f4ce 100644 --- a/std/mortal.sol +++ b/std/mortal.sol @@ -1,3 +1,5 @@ +pragma solidity ^0.4.0; + import "./owned.sol"; contract mortal is owned { diff --git a/std/owned.sol b/std/owned.sol index 3d7674f5..bbb8d957 100644 --- a/std/owned.sol +++ b/std/owned.sol @@ -1,3 +1,5 @@ +pragma solidity ^0.4.0; + contract owned { address owner; diff --git a/std/std.sol b/std/std.sol index c3f66b1b..4d65bef2 100644 --- a/std/std.sol +++ b/std/std.sol @@ -1,3 +1,5 @@ +pragma solidity ^0.4.0; + import "./owned.sol"; import "./mortal.sol"; import "./Token.sol"; |