awesome/tests
Uli Schlachter 489aa4dc24 Improve behaviour of GC'd objects
Before this commit: When we are GC'ing an object, we clear its metatable, since
otherwise crashes could occur in various places. This means that if someone
tries to use such an object, they get an unhelpful error message like "attempt
to index userdata object" and they don't understand what the problem is. Also,
this means that foo.valid does not actually work after GC.

This commit changes this behaviour. Instead of setting an empty metatable, we
now create a metatable with an __index and __newindex method. These metamethods
produce better error messages that they sat the underlying object was already
garbage collected. Better yet, the __index metamethod makes foo.valid be false
instead of causing an error, so that the existing machinery for detecting
invalid objects continues to work.

This commit also adds a functional test that verifies this behaviour.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-24 14:37:07 +02:00
..
examples Has the example test runner unset env variables that would interfere (#1106) 2016-09-20 19:36:23 +02:00
_client.lua tests/_client.lua: Don't use GtkApplication 2016-05-08 14:52:31 +02:00
_multi_screen.lua tests: Add a framework to make it easier to test multiple screens. 2016-09-05 17:13:53 -04:00
_runner.lua Make tests more reliable on "early errors" 2016-03-06 10:20:45 +01:00
_wibox_helper.lua textclock: Move to wibox.widget 2016-05-30 17:51:19 -04:00
run.sh Travis: fix codecov (#1105) 2016-09-20 19:53:10 +02:00
test-awesomerc.lua awful.tag: Rename nmaster to master_count 2016-04-11 23:54:28 -04:00
test-awful-client.lua tests: Fix awful.screen tests 2016-09-24 00:19:10 -04:00
test-awful-layout.lua tests: Test all client layouts 2016-04-18 04:20:23 -04:00
test-awful-rules.lua tests: Try to detect client "manage" signal race conditions. 2016-09-04 02:52:16 -04:00
test-awful-screen.lua tests: Test awful.screen against regressions 2016-04-11 23:54:28 -04:00
test-awful-tag.lua tests: Test moving tags between screens. 2016-09-05 17:13:53 -04:00
test-awful-widget-button.lua tests: Test recursive signals on mouse events. 2016-08-20 15:41:12 -04:00
test-awful-widget-watch.lua Make tests more reliable on "early errors" 2016-03-06 10:20:45 +01:00
test-benchmark.lua Make tests more reliable on "early errors" 2016-03-06 10:20:45 +01:00
test-current-desktop.lua Fix the test that the previous commit added 2016-06-04 17:05:42 +02:00
test-dbus-error.lua Test & fix a bug with dbus.disconnect_signal (#1096) 2016-09-18 12:50:40 +02:00
test-drawable-bgimage.lua Add a test for drawable:set_bgimage() 2016-07-09 10:28:42 +02:00
test-focus.lua Make tests more reliable on "early errors" 2016-03-06 10:20:45 +01:00
test-geometry.lua tests: Test geometry changes 2016-04-20 00:11:04 -04:00
test-leak-client.lua Make tests more reliable on "early errors" 2016-03-06 10:20:45 +01:00
test-leaks.lua textclock: Move to wibox.widget 2016-05-30 17:51:19 -04:00
test-maximize.lua change test value for client.border_width 2016-07-27 13:43:28 +02:00
test-miss-handlers.lua tests: Test the declarative widget system on wiboxes 2016-08-01 16:10:53 -04:00
test-resize.lua tests: Test mouse.move on odd sized clients. 2016-08-12 17:02:33 -04:00
test-screen-changes.lua test-screen-changes.lua: Also test moves 2016-06-04 17:39:51 +02:00
test-signal.lua Add awesome.{kill,unix_signal} 2016-05-27 19:22:41 +02:00
test-spawn-snid.lua Add awesome.hostname 2016-05-27 19:22:42 +02:00
test-spawn.lua tests: Test spawn empty command corner case 2016-08-09 18:50:34 -04:00
test-struts.lua tests: Test wibox attachment, wibars and struts 2016-05-15 17:17:12 -04:00
test-tooltip.lua tests: Test tooltips 2016-08-20 16:21:48 -04:00
test-urgent.lua Default config: Remove tags table 2016-04-26 09:36:53 +02:00
test-use-after-gc.lua Improve behaviour of GC'd objects 2016-09-24 14:37:07 +02:00