mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Added a script to run tests continuously
This commit is contained in:
		
							
								
								
									
										44
									
								
								scripts/run-tests.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								scripts/run-tests.sh
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,44 @@ | ||||
| #!/bin/bash | ||||
|  | ||||
| FILE=../bin/ArduinoJsonTests.exe | ||||
| MD5="" | ||||
|  | ||||
| file_changed() { | ||||
| 	[[ ! -f  "$FILE" ]] && return 1 | ||||
| 	NEW_MD5=$(md5sum $FILE) | ||||
| 	[[ "$MD5" == "$NEW_MD5" ]] && return 1 | ||||
| 	MD5=$NEW_MD5 | ||||
| 	return 0 | ||||
| } | ||||
|  | ||||
| test_succeed() { | ||||
| 	echo -en "\007"{,} | ||||
| } | ||||
|  | ||||
| test_failed() { | ||||
| 	echo -en "\007"{,,,,,,,,,,,} | ||||
| } | ||||
|  | ||||
| run_tests() { | ||||
| 	$FILE | ||||
| 	case $? in | ||||
| 	0) | ||||
| 		test_succeed | ||||
| 		;; | ||||
| 	1)	 | ||||
| 		test_failed | ||||
| 		;; | ||||
| 	esac | ||||
| } | ||||
|  | ||||
| while true | ||||
| do | ||||
| 	if file_changed | ||||
| 	then	 | ||||
| 		run_tests | ||||
| 	else | ||||
| 		sleep 2 | ||||
| 	fi | ||||
| done | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user