Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 44 lines (37 sloc) 1.108 kB
8914ad6 @stefanoverna Travis use rake tast
stefanoverna authored
1 require 'tempfile'
2
6c86f03 @Arkham colorized tests :)
Arkham authored
3 def colorize(text, color_code)
15a2097 @stefanoverna Added tests for TextHelper
stefanoverna authored
4 "#{color_code}#{text}\033[0m"
6c86f03 @Arkham colorized tests :)
Arkham authored
5 end
6
7 def red(text)
8 colorize(text, "\033[31m")
9 end
10
11 def green(text)
12 colorize(text, "\033[32m")
13 end
14
953e8bd @endorama Added desc to rake docs task
endorama authored
15 desc "Create the project documentation using Doxygen."
6f49108 @stefanoverna Using Rake instead of Bash script to generate documentation, added logo
stefanoverna authored
16 task :docs do
17 docs_path = File.join(File.dirname(__FILE__), "docs")
18 directory(docs_path)
19 `doxygen #{File.join(docs_path, "Doxyfile")}`
c7ffd5d @stefanoverna DRYed documentation
stefanoverna authored
20 shortcut_path = File.join(docs_path, "build", "index.html")
21 original_path = File.join(docs_path, "build", "html", "index.html")
22 File.symlink(original_path, shortcut_path) unless File.exists?(shortcut_path)
6f49108 @stefanoverna Using Rake instead of Bash script to generate documentation, added logo
stefanoverna authored
23 end
6c86f03 @Arkham colorized tests :)
Arkham authored
24
25 desc "Run all SimpleTest test suite"
26 task :tests do
27 tests_path = File.join(File.dirname(__FILE__), "tests")
28 Dir.chdir(tests_path) do
8914ad6 @stefanoverna Travis use rake tast
stefanoverna authored
29 temp_file = Tempfile.open('testresults')
30 temp_path = temp_file.path
31 temp_file.close!
32 sh("php all_tests.php 1>#{temp_path} 2>&1") do |ok, res|
33 output = File.read(temp_path)
34 puts output.gsub(/^(OK\n.*)/, green("\\1")).
35 gsub(/^(FAILURES!!!\n.*)/, red("\\1"))
36 ok or fail
37 end
6c86f03 @Arkham colorized tests :)
Arkham authored
38 end
39 end
8914ad6 @stefanoverna Travis use rake tast
stefanoverna authored
40
41 task :cazzo do
42 sh "php all_tests.php"
43 end
Something went wrong with that request. Please try again.