diff options
author | Philip Chimento <philip.chimento@gmail.com> | 2019-05-31 23:40:53 -0700 |
---|---|---|
committer | Philip Chimento <philip.chimento@gmail.com> | 2019-06-08 23:11:29 -0700 |
commit | 01920362be26a2cb4e38b55cc211351391885d1d (patch) | |
tree | e82cc9c7af565610eb756ea5a561dbd83359d9a0 /test/gjs-test-coverage.cpp | |
parent | e9d108c4a67a45bc2caf5429736f164956f6c9dc (diff) | |
download | gjs-01920362be26a2cb4e38b55cc211351391885d1d.tar.gz |
maint: Fix header includes once and for all
Previously #include statements were a bit of a mess across the codebase.
This commit is the result of a pass by the IWYU (Include What You Use)
tool, which suggests headers to add or remove based on what is in the
file, and can also suggest forward-declaring classes instead of
including their headers, if they are only used as a pointer in a
particular file. Cleaning this up should in general speed up compile
times.
IWYU isn't perfect, it produces a number of false positives, so we don't
try to automate this process and we don't accept all of its
recommendations. We do add a script and configuration file to the tools/
directory so that IWYU can be every so often in the future.
We also clean up all the includes according to a consistent style, which
is now described clearly in the C++ style guide.
Diffstat (limited to 'test/gjs-test-coverage.cpp')
-rw-r--r-- | test/gjs-test-coverage.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/test/gjs-test-coverage.cpp b/test/gjs-test-coverage.cpp index 7c0ede7a..d477d5ec 100644 --- a/test/gjs-test-coverage.cpp +++ b/test/gjs-test-coverage.cpp @@ -23,23 +23,19 @@ * Authored By: Sam Spilsbury <sam@endlessm.com> */ -#include <errno.h> -#include <string.h> -#include <stdlib.h> -#include <stdio.h> -#include <unistd.h> +#include <errno.h> // for errno +#include <stdio.h> // for sscanf, size_t +#include <stdlib.h> // for strtol, atoi, mkdtemp +#include <string.h> // for strlen, strstr, strcmp, strncmp, strcspn -#include <sys/types.h> -#include <fcntl.h> -#include <ftw.h> - -#include <glib.h> #include <gio/gio.h> -#include <gjs/gjs.h> +#include <glib-object.h> +#include <glib.h> +#include "gjs/context.h" #include "gjs/coverage.h" #include "gjs/jsapi-util.h" -#include "gjs-test-utils.h" +#include "test/gjs-test-utils.h" // IWYU pragma: keep typedef struct _GjsCoverageFixture { GjsContext *context; |