forked from nomovok-opensource/cutedriver-visualizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rakefile.rb
79 lines (69 loc) · 2.39 KB
/
rakefile.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
############################################################################
##
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
## Contact: Nokia Corporation ([email protected])
##
## This file is part of Testability Driver Qt Agent
##
## If you have questions regarding the use of this file, please contact
## Nokia at [email protected] .
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License version 2.1 as published by the Free Software Foundation
## and appearing in the file LICENSE.LGPL included in the packaging
## of this file.
##
############################################################################
desc "Task for testing visualizer"
task :test do
begin
Dir.chdir("test")
result=system( "cucumber features -f TDriverReport::CucumberReporter" )
raise "Feature tests failed" if (result != true) or ($? != 0)
ensure
Dir.chdir("..")
if ENV['CC_BUILD_ARTIFACTS']
#Copy results to build artifacts
Dir.foreach("#{Dir.pwd}/test/tdriver_reports") do |entry|
if entry.include?('test_run')
FileUtils.cp_r "#{Dir.pwd}/test/tdriver_reports/#{entry}", "#{ENV['CC_BUILD_ARTIFACTS']}/#{entry}"
FileUtils::remove_entry_secure("#{Dir.pwd}/test/tdriver_reports/#{entry}", :force => true)
end
end
end
end
exit(0)
end
desc "Task for cruise control"
task :cruise => ['build_visualizer', 'test'] do
exit(0)
end
desc "Task for building the example QT application(s)"
task :build_visualizer do
puts "#########################################################"
puts "### Building visualizer ####"
puts "#########################################################"
make = "make"
sudo = ""
if /win/ =~ RUBY_PLATFORM || /mingw32/ =~ RUBY_PLATFORM
make = "mingw32-make"
else
sudo = "sudo -S "
end
cmd = sudo + " #{make} uninstall"
system(cmd)
cmd = "#{make} distclean"
system(cmd)
cmd = "qmake CONFIG+=release"
failure = system(cmd)
raise "qmake failed" if (failure != true) or ($? != 0)
cmd = "#{make}"
failure = system(cmd)
raise "make release failed" if (failure != true) or ($? != 0)
cmd = sudo + "#{make} install"
failure = system(cmd)
raise "make install failed" if (failure != true) or ($? != 0)
puts "visualizer built"
end