ThrowTheSwitch / Ceedling

Ruby-based unit testing and build system for C projects

Home Page:http://throwtheswitch.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Non-US-ASCII characters stop ceedling's rake in an unhelpful way

jnz86 opened this issue · comments

I copied a string from the browser, a made it into a C const, my tests stopped working. I commented out all changes, but that wasn't enough, a non-US-ASCII character existing in the file even as a comment was enough to stop tests from working.

Turns out, the curly apostrophe is a killer. I found people complaining about this with Ruby, and Rake. The error that could be more helpful:

--------------------
OVERALL TEST SUMMARY
--------------------

No tests executed.


stderr:
rake aborted!
ArgumentError: invalid byte sequence in US-ASCII
/var/lib/gems/3.0.0/gems/ceedling-0.31.1/lib/ceedling/test_includes_extractor.rb:80:in `gsub'
/var/lib/gems/3.0.0/gems/ceedling-0.31.1/lib/ceedling/test_includes_extractor.rb:80:in `extract_source_include_from_file'
/var/lib/gems/3.0.0/gems/ceedling-0.31.1/lib/ceedling/test_includes_extractor.rb:24:in `parse_test_file_source_include'
...

While not a Ceedling "issue", there may be solutions. There are specified encodings and a "magic encoding' option for people using Ruby with other languages, among others I'm sure.

Even if not addressed in Ceedling, this is at least a head's up for anyone with the same issue.