Skip to content

Commit c393466

Browse files
committed
Merge branch 'develop'
* develop: Improved error reporting.
2 parents 25140f0 + 4160b94 commit c393466

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

bin/alcove

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ if options.search_directory
8080
else
8181
search_directory = alcove.get_search_directory
8282
end
83-
alcove.copy_input_files_to_temp(search_directory, options.product_name)
83+
unless alcove.copy_input_files_to_temp(search_directory, options.product_name)
84+
STDERR.puts " 🚫 Failed to find files to process. Make sure that --product-name is correct and that you've recently run tests. (Searched for files related to #{options.product_name} in #{search_directory}.)".red
85+
exit_with_code(1)
86+
end
8487

8588
gi_filename_absolute = File.join(Alcove::TEMP_DIR, "alcove-info.temp")
8689
gen_success = alcove.gen_info_files(gi_filename_absolute)

lib/alcove.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,15 @@ def get_search_directory
3939
def copy_input_files_to_temp(search_directory, product_name)
4040
puts " 📦 Gathering .gcno and .gcda files..." if @verbose
4141
puts " Searching in #{search_directory}..." if @verbose
42+
found_files = false
4243
Find.find(search_directory) do |path|
4344
if path.match(/#{product_name}.*\.gcda\Z/) || path.match(/#{product_name}.*\.gcno\Z/)
45+
found_files = true
4446
puts " 👍 .#{path.sub(search_directory, "")}".green if @verbose
4547
FileUtils.cp(path, "#{Alcove::TEMP_DIR}/")
4648
end
4749
end
50+
return found_files
4851
end
4952

5053
# Public: Calls the geninfo command to generate information files for
@@ -87,8 +90,8 @@ def genhtml(lcov_file_path, output_directory)
8790

8891
stdout, stderr, exit_status = Open3.capture3(genhtml_cmd)
8992
puts stdout if @verbose
93+
puts stderr if stderr.length > 0
9094
summary_string = extract_percent_from_summary(stdout)
91-
9295
return exit_status.success?, summary_string
9396
end
9497

lib/alcove/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
class Alcove
2-
VERSION = '0.2.0'
2+
VERSION = '0.2.1'
33
end

0 commit comments

Comments
 (0)