The default bug view has changed. See this FAQ.

Add some tests for binding codegen

RESOLVED FIXED

Status

()

Core
DOM
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: bz, Unassigned)

Tracking

(Blocks: 1 bug)

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments, 2 obsolete attachments)

Need to at least:

1)  Have some test IDL.
2)  Make sure it gets parsed by the IDL parser.
3)  Make sure we can generate code from it.

and preferably:

4)  Make sure the code compiles against some C++ headers (and that the headers
    try to check that the code is somewhat correct in terms of the types it
    uses).

and ideally:

5)  Make sure the runtime behavior is correct.

I'll try to do at least 1-3, maybe #4 here; won't worry about #5 too much so far.

Updated

5 years ago
OS: Mac OS X → All
Hardware: x86 → All
Version: unspecified → Trunk
Created attachment 624263 [details] [diff] [review]
part 1.  Add infrastructure for binding codegen tests.
Attachment #624263 - Flags: review?(peterv)
Attachment #624263 - Flags: review?(khuey)
Created attachment 624278 [details] [diff] [review]
part 2.  Exercise integer types a bit.
Attachment #624278 - Flags: review?(peterv)
Created attachment 624305 [details] [diff] [review]
part 3.  Exercise castable interface types a bit.

I'll add some sequence tests in the bug where I convert those to dom::Sequence.  I'll also add some tests of the infallible stuff in the bug on moving that annotation to the IDL.  In general, people should feel free to add more stuff here!
Attachment #624305 - Flags: review?(peterv)
Created attachment 624306 [details] [diff] [review]
part 3.  Exercise castable interface types a bit.
Attachment #624306 - Flags: review?(peterv)
Attachment #624305 - Attachment is obsolete: true
Attachment #624305 - Flags: review?(peterv)
One more note.  I don't know exactly how to write tests for something like bug 754457...  If anyone has bright ideas, let me know.
Created attachment 625208 [details] [diff] [review]
Part 1 disentangled from the CSS declaration stuff
Attachment #625208 - Flags: review?(peterv)
Attachment #625208 - Flags: review?(khuey)
Attachment #624263 - Attachment is obsolete: true
Attachment #624263 - Flags: review?(peterv)
Attachment #624263 - Flags: review?(khuey)
Blocks: 755636
Attachment #625208 - Attachment description: Disentangled from the CSS declaration stuff → Part 1 disentangled from the CSS declaration stuff
Blocks: 753517
Comment on attachment 625208 [details] [diff] [review]
Part 1 disentangled from the CSS declaration stuff

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

Yuck, but ok.

::: dom/Makefile.in
@@ +106,5 @@
>    $(NULL)
>  endif
>  
> +# bindings/test is here, because it needs to build after bindings, and
> +# we build kids before ourselves.

s/kids/subdirectories/ please.

Also, please say 'bindings/' instead of 'bindings' so it's clear we're referring to a directory

::: dom/bindings/Makefile.in
@@ +39,5 @@
> +ifdef ENABLE_TESTS
> +test_webidl_files := TestCodeGen.webidl
> +else
> +test_webidl_files := $(NULL)
> +endif

Can we stick test_webidl_files in WebIDL.mk please?
Attachment #625208 - Flags: review?(khuey) → review+
Made the changes comment 7 asks for.  In dom/bindings/test/Makefile.in, I now do this:

  # And need this for $(test_webidl_files)
  include $(topsrcdir)/dom/webidl/WebIDL.mk

  # But the webidl actually lives in our parent dir
  test_webidl_files := $(addprefix ../,$(test_webidl_files))

to make the paths work out.
Attachment #625208 - Flags: review?(peterv) → review+
Attachment #624278 - Flags: review?(peterv) → review+
Attachment #624306 - Flags: review?(peterv) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/24f6cf7eece9
https://hg.mozilla.org/integration/mozilla-inbound/rev/13e1c5f61e38
https://hg.mozilla.org/integration/mozilla-inbound/rev/afb26ea68c7f

Please pretty please everyone go and add tests!  But after I manage to check in bug 743906, so we don't conflict up the wazoo...
https://hg.mozilla.org/mozilla-central/rev/24f6cf7eece9
https://hg.mozilla.org/mozilla-central/rev/13e1c5f61e38
https://hg.mozilla.org/mozilla-central/rev/afb26ea68c7f

Leaving open for the rest :-)
Nah, this is fixed.  More work should happen in separate bugs.
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.