Top Level Namespace

Defined Under Namespace

Modules: ActiveRecord, BlueTooth, ColumnGroup, Common, DefaultTests0, DefaultTests1, DefaultTests2, DefaultTests3, DefaultTests4, Enumerable, ExampleCall, Flora, GenericFiles, GenericGrep, GenericJsons, GenericTableAssociation, GenericTableHtml, Generic_Table, NoDB, OpenTableExplorer, OpenTaxFormFiller, Parse, R_Interface Classes: Account, Acquisition, Anchoring, Arp, Battery, BatteryMeasurement, BatteryType, Brand, Bug, CharacterClass, Chemistry, CodeBase, CommandLine, CommandLineOption, CommandLineScript, DHCP, DataFrames, DefaultTestCase0, DefaultTestCase1, DefaultTestCase2, DefaultTestCase3, DefaultTestCase4, Edison, Eeg, ErrorType, ExampleType, FilePattern, FormFactor, Frequency, GenericColumn, GenericRow, GenericType, Gnome, HomeRun, Host, Huelseries, Huelshow, MatchData, MatchedPathName, MethodModel, Minimal, Minimal2, Minimal3, Minimal4, ModelName, Module, NestedArray, Network, NetworkInterface, Object, Ofx, OpenTaxSolver, PCF8591, Port, Production, ProductionFtp, RSession, Rebuild, Regexp, RegexpAlternative, RegexpEmpty, RegexpGeneralization, RegexpMatch, RegexpParen, RegexpParse, RegexpRepetition, RegexpSequence, RegexpToken, RegexpTree, RelatedFile, Release, Repository, Router, Set, ShellCommands, Specification, Station, Stream, StreamLink, StreamMethod, StreamMethodArgument, StreamMethodCall, StreamPattern, StreamPatternArgument, String, Tedprimary, TestRun, Transfer, Udev, UnboundedFixnum, UnboundedRange, Url, UsbBus, Weather, WorkFlow

Constant Summary collapse

ESSID =
ARGV[0]
BSS =
ARGV[1]
BaseTestCase =
ActiveSupport::TestCase

Instance Method Summary collapse

Instance Method Details

#after(s, before, pattern) ⇒ Object

work_flow


45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/tasks/testing.rb', line 45

def after(s,before,pattern)
	if s.scan_until(before).nil? then
		puts "before #{s.rest[0..50]}, #{pattern.to_s} not matched."
	else
		puts "matched at #{s.matched} after #{before}"
		ret=s.scan(pattern)
		if ret.nil? then
			puts "before #{s.rest[0..50]}, #{pattern.to_s} not matched."
			return nil
		else
			return ret
		end
	end
end

#conditional_build(target, sources) ⇒ Object


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/tasks/testing.rb', line 1

def conditional_build(target, sources)
	sources.each do |s|
		if !File.exist?(s) then
			puts "#{s} does not exist."
		elsif !uptodate?(target, s)  then
			puts "not up to date."
			sh ("ls -l #{target}") {|ok, res| } # discard result if file doesn't exist
			sh "ls -l #{s}"
		end
	end #each
	if uptodate?(target, sources) then
		stop=false
	else
#		if !File.exist?(target) then
#			return false
#		end #if
		not_uptodate_sources=sources.select {|s| !File.exist?(target) ||  File.exist?(s) && !uptodate?(target, s)}
		stop=TestRun.ruby_run_and_log(sources[0], target)
		if !stop then
			CodeBase.git_add_successful(not_uptodate_sources)
		end #if
	end #file
	return stop
end

#stageObject

def


59
60
61
62
63
64
65
# File 'lib/tasks/testing.rb', line 59

def stage
	CodeBase.gitStatus do|status,file| 
		if status != 'D' then
			CodeBase.why_not_stage(file,CodeBase.singular_table_from_file(file))
		end #if
	end #gitStatus
end

#view(url) ⇒ Object

def


66
67
68
69
70
71
72
73
74
# File 'lib/tasks/testing.rb', line 66

def view(url)
	uri=URI(url)
	output_file='log/view/test.html'
	old=IO.read('log/production.log')
	sh "curl #{url} -o #{output_file}"
	new=IO.read('log/production.log')
	changes=new[old.size..-1]
	puts "changes=#{changes}"
end

#work_flow(test = nil) ⇒ Object

def


26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/tasks/testing.rb', line 26

def work_flow(test=nil) 
	Dir['log/unit/*.log'].select {|f| !File.size?(f) }.each do |f|
		sh %Q(ls -1 -s #{f})	
		rm f
	end #each
	Dir['log/functional/*.log'].select {|f| !File.size?(f) }.each do |f|
		sh %Q(ls -1 -s #{f})	
		rm f
	end #each
	
#	puts "CodeBase::FILE_MOD_TIMES=#{CodeBase::FILE_MOD_TIMES.inspect}"
	CodeBase.not_uptodate_order do |target_file, sources|
	ruby_source=CodeBase.test_program_from_file(target_file)
		stop=TestRun.ruby_run_and_log(ruby_source,target_file)
		return stop
	end #each

end