Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not handle Test Suite names with spaces #15

Open
e28eta opened this issue Jun 18, 2013 · 0 comments
Open

Does not handle Test Suite names with spaces #15

e28eta opened this issue Jun 18, 2013 · 0 comments

Comments

@e28eta
Copy link
Contributor

e28eta commented Jun 18, 2013

I'm having trouble with one of my projects, because it has a test suite with a space in the name.

Here's an example of the relevant output:

[DEBUG] Test Suite 'All tests' started at 2013-06-18 00:59:57 +0000
Test Suite '/Users/e28eta/source/MyApp/build/Ad Hoc-iphonesimulator/MyAppTests.octest(Tests)' started at 2013-06-18 00:59:57 +0000
Test Suite 'MyApp Tests' started at 2013-06-18 00:59:57 +0000
Test Case '-[MyAppTest someTestCase]' started.

Results in the following error:

/Users/e28eta/bin/ocunit2junit.rb:158:in `handle_test_passed': undefined method `+' for nil:NilClass (NoMethodError)
    from /Users/e28eta/bin/ocunit2junit.rb:80:in `parse_input'
    from /Users/e28eta/bin/ocunit2junit.rb:50:in `each'
    from /Users/e28eta/bin/ocunit2junit.rb:50:in `parse_input'
    from /Users/e28eta/bin/ocunit2junit.rb:44:in `initialize'
    from /Users/e28eta/bin/ocunit2junit.rb:186:in `new'
    from /Users/e28eta/bin/ocunit2junit.rb:186

It dies on @total_passed_test_cases += 1 because:

  • handle_start_test_suite was never called, because the Test Suite name regex doesn't accept spaces
  • and, all three of the initial Test Suite lines in my output have a space.

The reason I have a space in 'MyApp Tests' is because we're manually setting up a suite:

SenTestSuite *suite = [SenTestSuite testSuiteWithName:@"MyApp Tests"];

So it looks like I can work around it (remove the space). However, it'd be nice if that wasn't necessary.

I'm too unfamiliar with OCUnit's output to know whether it's safe to simply change the Test Suite regex to something like this:

when /Test Suite '([^']+)'.*started at\s+(.*)/

or if that would break something else. Do you know?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant