After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 595987 - Add some structure for interactive tests of UI components
Add some structure for interactive tests of UI components
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2009-09-22 18:50 UTC by Owen Taylor
Modified: 2009-10-01 19:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add some structure for interactive tests of UI components (9.65 KB, patch)
2009-09-22 18:50 UTC, Owen Taylor
none Details | Review
run-test.sh: support running tests under gdb (999 bytes, patch)
2009-09-22 18:51 UTC, Owen Taylor
none Details | Review
Add some structure for interactive tests of UI components (9.69 KB, patch)
2009-09-30 00:04 UTC, Owen Taylor
committed Details | Review
run-test.sh: support running tests under gdb (999 bytes, patch)
2009-09-30 00:04 UTC, Owen Taylor
committed Details | Review

Description Owen Taylor 2009-09-22 18:50:00 UTC
js/ui/environment.js: Split out initial UI setup (Tweener initialization,
  Nbtk monkey-patching) into a separate file we can import from tests.

tests/: Directory for various types of tests
tests/run-test.sh: Shell script that to run tests with an appropriate
  environment set up.

tests/testcommon/: Common modules and data for tests
tests/interactive/: Interactive tests

tests/interactive/box-layout.js: A sample test of NbtkLayout
Comment 1 Owen Taylor 2009-09-22 18:50:04 UTC
Created attachment 143722 [details] [review]
Add some structure for interactive tests of UI components
Comment 2 Owen Taylor 2009-09-22 18:51:02 UTC
Created attachment 143723 [details] [review]
run-test.sh: support running tests under gdb

As with the 'gnome-shell' -g/--debug can be passed to run under
the debugger.
Comment 3 Owen Taylor 2009-09-30 00:04:01 UTC
Created attachment 144313 [details] [review]
Add some structure for interactive tests of UI components

js/ui/environment.js: Split out initial UI setup (Tweener initialization,
  ClutterContainer monkey-patching) into a separate file we can import from tests.

tests/: Directory for various types of tests
tests/run-test.sh: Shell script that to run tests with an appropriate
  environment set up.

tests/testcommon/: Common modules and data for tests
tests/interactive/: Interactive tests

tests/interactive/box-layout.js: A sample test of StLayout
Comment 4 Owen Taylor 2009-09-30 00:04:30 UTC
Created attachment 144314 [details] [review]
run-test.sh: support running tests under gdb

As with the 'gnome-shell' -g/--debug can be passed to run under
the debugger.
Comment 5 Dan Winship 2009-09-30 14:39:42 UTC
Comment on attachment 144313 [details] [review]
Add some structure for interactive tests of UI components

How are you running the tests? When I try to run "jhbuild run ./run-test.sh interactive/box-layout.js", it can't find St-1.0.typelib, and if I set GI_TYPELIB_PATH by hand, then it can't find the shared library, etc.

>+++ b/tests/Makefile.am
>+# We substitute in bindir so it works as an autostart
>+# file when built in a non-system prefix
>+run-test.sh: run-test.sh.in

That comment makes no sense here. (It was copied along with the sed command from data/Makefile.am.)

>+*.red {
>+    background-color: red;
>+}

I think standard CSS style is to omit the "*" there.
Comment 6 Owen Taylor 2009-09-30 15:25:10 UTC
(In reply to comment #5)
> (From update of attachment 144313 [details] [review])
> How are you running the tests? When I try to run "jhbuild run ./run-test.sh
> interactive/box-layout.js", it can't find St-1.0.typelib, and if I set
> GI_TYPELIB_PATH by hand, then it can't find the shared library, etc.

Hmm. What version are you testing against? do they work on the tip of the shell-toolkit branch? The command above looks right to me.... I'm usually doing it within 'jhbuild shell' but should be pretty much the same. (And just checked with jhbuild run and it works too.)

> >+++ b/tests/Makefile.am
> >+# We substitute in bindir so it works as an autostart
> >+# file when built in a non-system prefix
> >+run-test.sh: run-test.sh.in
> 
> That comment makes no sense here. (It was copied along with the sed command
> from data/Makefile.am.)

Good catch, fixed in my local tree now.

> >+*.red {
> >+    background-color: red;
> >+}
> 
> I think standard CSS style is to omit the "*" there.

It's a workaround for a NbtkStylesheet bug; after the port to StTheme later in the branch, I removed the workaround.
Comment 7 Owen Taylor 2009-09-30 16:15:32 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > (From update of attachment 144313 [details] [review] [details])
> > How are you running the tests? When I try to run "jhbuild run ./run-test.sh
> > interactive/box-layout.js", it can't find St-1.0.typelib, and if I set
> > GI_TYPELIB_PATH by hand, then it can't find the shared library, etc.
> 
> Hmm. What version are you testing against? do they work on the tip of the
> shell-toolkit branch? The command above looks right to me.... I'm usually doing
> it within 'jhbuild shell' but should be pretty much the same. (And just checked
> with jhbuild run and it works too.)

From private conversation this was an unitialized variable crash combined with some confusion about run-test.sh vs. running with jhbuild run when debugging it.
Comment 8 Owen Taylor 2009-10-01 19:26:13 UTC
Attachment 144313 [details] pushed as 5549789 - Add some structure for interactive tests of UI components
Attachment 144314 [details] pushed as 3c646ec - run-test.sh: support running tests under gdb