File tree 2 files changed +9
-9
lines changed
2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ def parse(name, source)
39
39
40
40
function_names = [ ]
41
41
42
- all_funcs = parse_functions ( import_source ( source , parse_project ) ) . map { |item | [ item ] }
42
+ all_funcs = parse_functions ( name , import_source ( source , parse_project ) ) . map { |item | [ item ] }
43
43
all_funcs += parse_cpp_functions ( import_source ( source , parse_project , true ) )
44
44
all_funcs . map do |decl |
45
45
func = parse_declaration ( parse_project , *decl )
@@ -358,15 +358,15 @@ def parse_cpp_functions(source)
358
358
funcs
359
359
end
360
360
361
- def parse_functions ( source )
361
+ def parse_functions ( filename , source )
362
362
funcs = [ ]
363
363
source . each { |line | funcs << line . strip . gsub ( /\s +/ , ' ' ) if line =~ @declaration_parse_matcher }
364
364
if funcs . empty?
365
365
case @when_no_prototypes
366
366
when :error
367
- raise 'ERROR: No function prototypes found! '
367
+ raise 'ERROR: No function prototypes found by CMock in #{filename} '
368
368
when :warn
369
- puts 'WARNING: No function prototypes found! ' unless @verbosity < 1
369
+ puts 'WARNING: No function prototypes found by CMock in #{filename} ' unless @verbosity < 1
370
370
end
371
371
end
372
372
funcs
Original file line number Diff line number Diff line change 383
383
begin
384
384
@parser . parse ( "module" , source )
385
385
rescue RuntimeError => e
386
- assert_equal ( "ERROR: No function prototypes found! " , e . message )
386
+ assert_match ( "ERROR: No function prototypes found" , e . message )
387
387
end
388
388
end
389
389
407
407
begin
408
408
@parser . parse ( "module" , source )
409
409
rescue RuntimeError => e
410
- assert_equal ( "ERROR: No function prototypes found! " , e . message )
410
+ assert_match ( "ERROR: No function prototypes found" , e . message )
411
411
end
412
412
end
413
413
435
435
begin
436
436
@parser . parse ( "module" , source )
437
437
rescue RuntimeError => e
438
- assert_equal ( "ERROR: No function prototypes found! " , e . message )
438
+ assert_match ( "ERROR: No function prototypes found" , e . message )
439
439
end
440
440
end
441
441
676
676
begin
677
677
@parser . parse ( "module" , source )
678
678
rescue RuntimeError => e
679
- assert_equal ( "ERROR: No function prototypes found! " , e . message )
679
+ assert_match ( "ERROR: No function prototypes found" , e . message )
680
680
end
681
681
end
682
682
705
705
begin
706
706
@parser . parse ( "module" , source )
707
707
rescue RuntimeError => e
708
- assert_equal ( "ERROR: No function prototypes found! " , e . message )
708
+ assert_match ( "ERROR: No function prototypes found" , e . message )
709
709
end
710
710
end
711
711
You can’t perform that action at this time.
0 commit comments