Closed Bug 1171299 Opened 9 years ago Closed 9 years ago

cppunit tests do not access mozinfo.json

Categories

(Testing :: General, defect)

defect
Not set
normal

Tracking

(firefox39 fixed, firefox40 fixed, firefox41 fixed, firefox-esr38 fixed)

RESOLVED FIXED
mozilla41
Tracking Status
firefox39 --- fixed
firefox40 --- fixed
firefox41 --- fixed
firefox-esr38 --- fixed

People

(Reporter: gbrown, Assigned: gbrown)

References

Details

Attachments

(1 file)

Desktop cppunit tests use mozinfo but do not update the mozinfo dictionary with mozinfo.json.

Remote cppunit tests do not use mozinfo, but use a hack to determine os == 'android' or 'b2g'.

The cppunittests.ini manifest has annotations for os == 'android' and os == 'b2g'.

Attempts to use more complex annotations, like (os == 'android' && debug) fail because mozinfo.json information is missing.

Also, mozinfo.json is not present in the cppunittests directory in the test package.
Blocks: 1140454
This adds mozinfo.json to the cppunittests directory of the tests package and updates the desktop and remote cppunit test harnesses to read mozinfo.json.
Attachment #8615022 - Flags: review?(dminor)
Comment on attachment 8615022 [details] [diff] [review]
add mozinfo.json support to cppunit tests

Review of attachment 8615022 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good to me. Thanks for fixing this!

::: testing/runcppunittests.py
@@ +211,5 @@
> +            break
> +        dirs.add(path)
> +        path = os.path.split(path)[0]
> +    mozinfo.find_and_update_from_json(*dirs)
> +

nit: you should have two newlines before and after functions declarations.

::: testing/testsuite-targets.mk
@@ +519,5 @@
>  endif
>  	cp $(topsrcdir)/testing/runcppunittests.py $(PKG_STAGE)/cppunittests
>  	cp $(topsrcdir)/testing/remotecppunittests.py $(PKG_STAGE)/cppunittests
>  	cp $(topsrcdir)/testing/cppunittest.ini $(PKG_STAGE)/cppunittests
> +	cp $(DEPTH)/mozinfo.json $(PKG_STAGE)/cppunittests

This looks fine to me, but you might want to run it past a build peer as well.
Attachment #8615022 - Flags: review?(dminor) → review+
Comment on attachment 8615022 [details] [diff] [review]
add mozinfo.json support to cppunit tests

Review of attachment 8615022 [details] [diff] [review]:
-----------------------------------------------------------------

The packaging bit is fine.

::: testing/remotecppunittests.py
@@ +255,5 @@
>  
>  
>      options.xre_path = os.path.abspath(options.xre_path)
> +    cppunittests.update_mozinfo()
> +    # this hack should not be necessary, but is retained in case mozinfo.json is not found

I'd be happier if you just removed it. If mozinfo.json isn't found we should probably error.
Thanks Ted, Dan. I'll address the nit and remove the hack for landing.
https://hg.mozilla.org/mozilla-central/rev/42d42889d058
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in before you can comment on or make changes to this bug.