mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	Merge pull request #10146 from ethereum/stop-after-parsing-script
Fix test/stopAfterParseTests.sh for macos.
This commit is contained in:
		
						commit
						b6f7640801
					
				| @ -1,6 +1,12 @@ | ||||
| #!/usr/bin/env bash | ||||
| 
 | ||||
| REPO_ROOT=$(readlink -f "$(dirname "$0")"/..) | ||||
| set -e | ||||
| 
 | ||||
| READLINK=readlink | ||||
| if [[ "$OSTYPE" == "darwin"* ]]; then | ||||
| 	READLINK=greadlink | ||||
| fi | ||||
| REPO_ROOT=$(${READLINK} -f "$(dirname "$0")"/..) | ||||
| SOLIDITY_BUILD_DIR=${SOLIDITY_BUILD_DIR:-${REPO_ROOT}/build} | ||||
| SOLC=${SOLIDITY_BUILD_DIR}/solc/solc | ||||
| SPLITSOURCES=${REPO_ROOT}/scripts/splitSources.py | ||||
| @ -11,15 +17,18 @@ cd "$FILETMP" || exit 1 | ||||
| 
 | ||||
| function testFile() | ||||
| { | ||||
| 	set +e | ||||
| 	ALLOUTPUT=$($SOLC --combined-json ast,compact-format --pretty-json "$@" --stop-after parsing 2>&1) | ||||
| 	if test $? -ne 0; then | ||||
| 	local RESULT=$? | ||||
| 	set -e | ||||
| 	if test ${RESULT} -ne 0; then | ||||
| 		# solc returned failure. Compilation errors and unimplemented features | ||||
| 		# are okay, everything else is a failed test (segfault) | ||||
| 		if ! echo "$ALLOUTPUT" | grep -e "Unimplemented feature:" -e "Error:" -q; then | ||||
| 			echo -n "Test failed on "; | ||||
| 			echo -n "Test failed on " | ||||
| 			echo "$@" | ||||
| 			echo "$ALLOUTPUT" | ||||
| 			return 1; | ||||
| 			return 1 | ||||
| 		fi | ||||
| 	else | ||||
| 		echo -n . | ||||
| @ -29,8 +38,10 @@ function testFile() | ||||
| } | ||||
| 
 | ||||
| while read -r file; do | ||||
| 	set +e | ||||
| 	OUTPUT=$($SPLITSOURCES "$file") | ||||
| 	RETURN_CODE=$? | ||||
| 	set -e | ||||
| 	FAILED=0 | ||||
| 
 | ||||
| 	if [ $RETURN_CODE -eq 0 ] | ||||
| @ -38,8 +49,7 @@ while read -r file; do | ||||
| 		# shellcheck disable=SC2086 | ||||
| 		testFile $OUTPUT | ||||
| 		FAILED=$? | ||||
| 
 | ||||
| 		rm "${FILETMP:?}/"* -r | ||||
| 		rm -r "${FILETMP:?}"/* | ||||
| 	elif [ $RETURN_CODE -eq 1 ] | ||||
| 	then | ||||
| 		testFile "$file" | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user