move ceedling tests to test/unit-test
This commit is contained in:
		
							
								
								
									
										22
									
								
								test/unit-test/vendor/ceedling/plugins/beep/README.md
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								test/unit-test/vendor/ceedling/plugins/beep/README.md
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,22 @@ | ||||
| ceedling-beep | ||||
| ============= | ||||
|  | ||||
| This is a simple plugin that just beeps at the end of a build and/or test sequence. Are you getting too distracted surfing | ||||
| the internet, chatting with coworkers, or swordfighting while it's building or testing? The friendly beep will let you know | ||||
| it's time to pay attention again. | ||||
|  | ||||
| This plugin has very few configuration options. At this time it can beep on completion of a task and/or on an error condition. | ||||
| For each of these, you can configure the method that it should beep. | ||||
|  | ||||
| ``` | ||||
| :tools: | ||||
|   :beep_on_done: :bell | ||||
|   :beep_on_error: :bell | ||||
| ``` | ||||
|  | ||||
| Each of these have the following options: | ||||
|  | ||||
|   - :bell - this option uses the ASCII bell character out stdout | ||||
|   - :speaker_test - this uses the linux speaker-test command if installed | ||||
|  | ||||
| Very likely, we'll be adding to this list if people find this to be useful. | ||||
							
								
								
									
										40
									
								
								test/unit-test/vendor/ceedling/plugins/beep/lib/beep.rb
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								test/unit-test/vendor/ceedling/plugins/beep/lib/beep.rb
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,40 @@ | ||||
| require 'ceedling/plugin' | ||||
| require 'ceedling/constants' | ||||
|  | ||||
| class Beep < Plugin | ||||
|  | ||||
|   attr_reader :config | ||||
|  | ||||
|   def setup | ||||
|     @config = { | ||||
|       :on_done  => ((defined? TOOLS_BEEP_ON_DONE)  ? TOOLS_BEEP_ON_DONE  : :bell  ), | ||||
|       :on_error => ((defined? TOOLS_BEEP_ON_ERROR) ? TOOLS_BEEP_ON_ERROR : :bell  ), | ||||
|     } | ||||
|   end | ||||
|  | ||||
|   def post_build | ||||
|     beep @config[:on_done] | ||||
|   end | ||||
|  | ||||
|   def post_error | ||||
|     beep @config[:on_error] | ||||
|   end | ||||
|  | ||||
|   private | ||||
|  | ||||
|   def beep(method = :none) | ||||
|     case method | ||||
|     when :bell | ||||
|       if (SystemWrapper.windows?) | ||||
|         puts "echo '\007'" | ||||
|       else | ||||
|         puts "echo -ne '\007'" | ||||
|       end | ||||
|     when :speaker_test | ||||
|       `speaker-test -t sine -f 1000 -l 1` | ||||
|     else | ||||
|       #do nothing with illegal or :none | ||||
|     end | ||||
|   end | ||||
| end | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 hathach
					hathach