Commit Graph

23 Commits

Author SHA1 Message Date
Daniel Stone 759712ba05 zuc: Delete support for forking tests
ZUC's default mode is to fork for every test case. Unfortunately on
AArch64, fork in an ASan-traced program usually takes around 3.6 entire
seconds. This was leading to the config-parser test timing out.

As none of our remaining ZUC tests even need to fork, just remove all
support for it.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2022-07-05 10:15:49 +01:00
Daniel Stone ccb64f301c tests: Bump alignment for test structures to 64 bytes
Our core test structure is 36 bytes wide. Declaring it with a 32-bit
alignment should thus stripe it to 64 bytes. For some reason, clang+lld
lays them out with a 96-byte stride within the section (does it want an
entire 32-bit word when building with ASan?), getting the code wildly
confused when it tries to step through the structures.

So we could fix all our tests to avoid the fragile section dance, or we
could just waste another 4 bytes per test definition by bumping the
alignment up to 64 bytes, which seems to do enough to magically accord
with what clang+lld+ASan expect.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 18:42:25 +01:00
Pekka Paalanen d913363394 gl-renderer: move vertex shader into new file
This patch adds the tooling for incorporating files as C data, so that
files can be built into the binaries. The tool is in Python to avoid
adding extra dependencies like xxd.

xxd.py is copied from Mesa as-is, from commit
b729cd58d76f97f3fc04a67569535ee5ef2f5278 (master branch on 2021-01-26),
a.k.a 21.0-branchpoint-635-gb729cd58d76.

Moving the GLSL vertex shader into a separate file is not that
interesting, the purpose of this commit is to provide a simple
demonstration of the tooling. The real benefits come in a following
patch where the fragment shaders are re-written and externalized.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-25 13:16:02 +02:00
Daniel Stone dd8219b3fb option-parser: Make bools boolean
When option-parser is confronted with a boolean option, have it write a
bool rather than treating the value as a pointer to an int32.

(lib)weston already heavily uses bool types internally, so this has the
nice side effect of eliminating quite a few local variables which only
existed as integer shadows of internal boolean variables.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2019-11-28 19:24:13 +00:00
- 45d38856c8 zunitc: Fix undeclared identifier 'NULL'
Since v6 release, -Dtest-junit-xml=false build regressed because its
ifdef branch no longer includes stddef.h and thus NULL, either directly
or through another header. Using musl-1.1.22 and llvm-8.0.0.
2019-05-02 17:35:29 +00:00
Pekka Paalanen ecbdcfd373 Rename zalloc.h to libweston/zalloc.h
It is a public installed header used by libweston.h.

See "Rename compositor.h to libweston/libweston.h" for rationale.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-04-18 12:31:46 +03:00
Pekka Paalanen 91b1010de9 Rename config-parser.h to libweston/config-parser.h
It is a public installed header used by libweston.h.

See "Rename compositor.h to libweston/libweston.h" for rationale.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-04-18 12:31:46 +03:00
Emmanuel Gil Peyrot 426c24673f Fix typos all around (thanks codespell!) 2019-02-20 16:47:35 +01:00
Emmanuel Gil Peyrot 7092090de9 tests: Mark tests as used so they don’t get removed at link time
Without this attribute, the test macros were making Weston fail to
build with LTO enabled.

Signed-off-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: Emmanuel Gil Peyrot <emmanuel.peyrot@collabora.com>
Tested-by: Emmanuel Gil Peyrot <emmanuel.peyrot@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-01 16:53:53 +00:00
Abdur Rehman 3caed395ec zunitc: fix a typo in a comment
Signed-off-by: Abdur Rehman <arehmanq199@gmail.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
2017-01-03 11:59:15 +00:00
Abdur Rehman 6f7f9468f1 zunitc: fix a couple of typos
- even -> event
- attatch -> attach

Signed-off-by: Abdur Rehman <arehmanq199@gmail.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
2017-01-03 11:59:12 +00:00
Quentin Glidic 9c36eb912e
zunitc/junit-reporter: Silence pointer-sign warning
/usr/x86_64-pc-linux-gnu/include/libxml2/libxml/xmlstring.h:35:18:
warning: pointer targets in passing argument 3 of 'xmlStrPrintf' differ
in signedness [-Wpointer-sign]
 #define BAD_CAST (xmlChar *)
                  ^
tools/zunitc/src/zuc_junit_reporter.c:77:41: note: in expansion of macro
'BAD_CAST'
  xmlStrPrintf(scratch, sizeof(scratch), BAD_CAST %d, value);
                                         ^~~~~~~~
/usr/x86_64-pc-linux-gnu/include/libxml2/libxml/xmlstring.h:98:17: note:
expected 'const char *' but argument is of type 'xmlChar * {aka unsigned
char *}'
                 xmlStrPrintf             (xmlChar *buf,

Warning produced by GCC 5.3, 6.1 and Clang 3.8.

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Armin Krezović <krezovic.armin@gmail.com>
Tested-by: Armin Krezović <krezovic.armin@gmail.com>
2016-09-24 11:46:36 +02:00
Emmanuel Gil Peyrot 1764d22f91 zunitc: use platform-independent macros for integer formatting
Fixes warnings and potential issues on 32-bit platforms, tested only on
ARM but I’d expect the same issue on i686.

Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-05-19 17:15:56 -07:00
Eric Engestrom 11a7a4bc30 zunitc: fix spelling mistake
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-04-05 16:00:15 -07:00
Eric Engestrom f8cdb24959 zunitc: remove `break` after `return`
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
2016-04-05 15:57:30 -07:00
Jon Cruz ecf819b82e zunitc: made name of test fixture parameter explicit.
Instead of using the implicit name 'data', changed the test
with fixture macro ZUC_TEST_F() to use an additional value
to explicitly set the name to use for test data from the
fixture.

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-10-23 14:57:09 -07:00
Jon Cruz 2ffb0afecb zunitc: Clarify documentation on return behavior.
* Clarify documentation on ZUC_ASSERT_* behavior in regards to return
   vs. abort()
* Added overview section on return behavior.
* Fixed spelling
* Removed outdated reference to tap function.

Changes since v1:

* Incorporated grammatical feedback.

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-10-23 13:50:56 -07:00
Dawid Gajownik 74a635b1ec Coding style fixes
- opening braces are on the same line as the if statement
- opening braces are not on the same line as the function name
- space between for/while/if and opening parenthesis

Signed-off-by: Dawid Gajownik <gajownik@gmail.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2015-08-07 12:01:22 -07:00
Jon A. Cruz 646aef543e Enables output in the JUnit XML format.
Adds basic support for optionally outputting in the XML format
commonly used by JUnit compatible tools.

This format is supported by default by many tools, including
the Jenkins build system. It also is more detailed and
captures more information than the more simplistic TAP
format.

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-07-17 13:27:39 +03:00
Bryce Harrington 35e7b10d44 zunitc: Fix minor typo
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-07-14 09:26:55 +03:00
Bryce Harrington 966cc4b5db zunitc: Fix some minor grammatical errors in dox
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-07-14 09:26:50 +03:00
Bryce Harrington 66f2a383c4 zunitc: wrap dox to 80 columns
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-07-14 09:26:08 +03:00
Jon A. Cruz 5a75a41d07 Added simple unit/integration test framework and corresponding test program.
Added a simple C-based test framework and an example program
that uses it to run through some simple unit tests.

This is new code inspired primarily by the approaches of Google
Test, Boost Test, JUnit and TestNG. Factors of others were also
considered during design and implementation.

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-07-07 15:47:08 +03:00