Otherwise commented lines look like ---- My comment
instead of -- -- My comment. This wasn't a problem before the
intentation fix commit, but it is now.
Commit a944636c02 "bashified" tests/run.sh for some reason.
Afterwards, commit 4abd820051 fixed some of the fall-out.
However, there is still a problem left.
We have "set -e" in this script. Thus, whenever some command exits with
status 0, the script abort. When the variable errors is zero/unset, the
command "((errors++))" has exit status zero. Thus, this instruction
caused the shell script to abort. This was not intended.
Fix this by using "((++errors))" instead.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Before this, the test runner used a timer which fired every 0.1 seconds
to "do its thing". Many of these waits seem unnecessary.
This commit makes the test runner wait 0 seconds for the first call of a
step function. Only following calls will have a timeout of 0.1 seconds
applied.
A full run of the test suite (tests/run.sh without further arguments)
took about 100 seconds before this change. After this change, we are
down to 60 seconds. This is almost factor two faster! (Well, five thirds
is the exact number, so factor 1.66)
(The numbers are best out of three runs. The "before" number is rounded
down while the "after" number is rounded up.)
Signed-off-by: Uli Schlachter <psychon@znc.in>
This function should only be necessary for the test suite. It makes sure
that the X11 server received and handled all previous requests that
awesome sent. This will be needed, for example, in tests that use
root.fake_input().
After a call to awesome.sync(), we are sure that "faking input" has been
done and the next main loop iteration will handle the input event.
Without the sync, it could happen that the X11 server did not yet fake
the input in the next iteration.
Signed-off-by: Uli Schlachter <psychon@znc.in>
When menubar.refresh() is called, it tries to update the menubar widget.
The call chain looks like this: menulist_update -> common.list_update ->
get_current_page. get_current_page then tries to query information about
the size of the menubar.
Since there is not much point in this, just skip the whole callback in
this case.
Side note: What is the point of menubar.get()? It seems quite useless to
me.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Previously we got the following unhelpful error message:
tests/_client.lua:98: bad argument #2 to 'assert' (string expected, got
userdata)
Signed-off-by: Uli Schlachter <psychon@znc.in>
When the child process in tests/_client.lua breaks and exits (for
example: Remove the call to Gtk.main), we get a broken pipe. When trying
to write to the pipe that connects awesome to the child process, we get
a SIGPIPE signal that causes awesome to exit without any good error
message.
Fix this by ignoring SIGPIPE. We do not want to be killed by it anyway.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This uses DOC_HIDE magic in the actual test code, except for the
template.lua files which do not have it.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The following commits will add DOC_HIDE uses that are not at the end of
the line, but the beginning. Hence, drop the requirement that it appears
at the end of the line and change the ".+" at the beginning into ".*".
Signed-off-by: Uli Schlachter <psychon@znc.in>
io.open returns nil, an error message and an error code on failure. This
perfectly fits assert which will make the script fail with the error
message. Previously it would fail with "attempted to index a nil value".
Reference: https://www.reddit.com/r/awesomewm/comments/5kyqji/cant_build_git_awesome/
Signed-off-by: Uli Schlachter <psychon@znc.in>
The documentation for CMake's add_custom_command()-command says the
following for USES_TERMINAL:
The command will be given direct access to the terminal if possible.
With the ``Ninja`` generator, this places the command in the
``console`` ``pool``.
The result is that one can see the progress of tests/run.sh, because
messages appear immediately instead of delayed (instead all other
parallel steps are delayed; in practice this means luacheck output
appears only after tests/run.sh is done).
Signed-off-by: Uli Schlachter <psychon@znc.in>
This adds a short text with some hopefully helpful pointers to the top
of the index.html generated by ldoc.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This document is based on the "my first awesome"-page in the old wiki.
Large parts of it are taken almost verbatim from it while others were
handled more freely. For example, instead of referring to the man page
for an overview of the available key bindings, this now mentions Mod4+S.
The "Add widgets"-section is just a todo. The wiki page refers to
Vicious which does not really work for our api documentation. However, I
also didn't want to just drop this part.
Signed-off-by: Uli Schlachter <psychon@znc.in>