]> git.earman.xyz Git - sensor-watch.git/blob
a51438a380fabe485a2066471007dfcf841c8f73
[sensor-watch.git] /
1 require 'ceedling/plugin'
2 require 'ceedling/defaults'
3
4 class StdoutGtestlikeTestsReport < Plugin
5
6   def setup
7     @result_list = []
8     @plugin_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
9     template = @ceedling[:file_wrapper].read(File.join(@plugin_root, 'assets/template.erb'))
10     @ceedling[:plugin_reportinator].register_test_results_template( template )
11   end
12
13   def post_test_fixture_execute(arg_hash)
14     return if not (arg_hash[:context] == TEST_SYM)
15
16     @result_list << arg_hash[:result_file]
17   end
18
19   def post_build
20     return if not (@ceedling[:task_invoker].test_invoked?)
21
22     results = @ceedling[:plugin_reportinator].assemble_test_results(@result_list)
23     hash = {
24       :header => '',
25       :results => results
26     }
27
28     @ceedling[:plugin_reportinator].run_test_results_report(hash)
29   end
30
31   def summary
32     result_list = @ceedling[:file_path_utils].form_pass_results_filelist( PROJECT_TEST_RESULTS_PATH, COLLECTION_ALL_TESTS )
33
34     # get test results for only those tests in our configuration and of those only tests with results on disk
35     hash = {
36       :header => '',
37       :results => @ceedling[:plugin_reportinator].assemble_test_results(result_list, {:boom => false})
38     }
39
40     @ceedling[:plugin_reportinator].run_test_results_report(hash)
41   end
42
43 end