summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2013-11-27tests: Remove waffle-unittest runnerChad Versace3-58/+0
All unittests have now been moved into separate executables, one executable per unit. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-11-27core: Move wcore_error unittests to separate executableChad Versace2-4/+0
Pull the unittests for wcore_error out of the waffle-unittest executable and place them into a new separate executable, 'tests/wcore_error_unittests'. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-11-27core: Move wcore_config_attrs unittests to separate executableChad Versace2-4/+0
Pull the unittests for wcore_config_attrs out of the waffle-unittest executable and place them into a new separate executable, 'tests/wcore_config_attrs_unittests'. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-11-27core: Move wcore_attrib_list unittests to separate executableChad Versace2-3/+0
Pull the unittests for wcore_attrib_list out of the waffle-unittest executable and place them into a new separate executable, 'tests/wcore_attrib_list_unittests'. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-11-27waffle_test: Move source from 'tests' to 'src' and 'include'Chad Versace8-604/+0
This moves the waffle_test sources into a more canonical location. Instead of keeping it jailed as a subdir of 'tests' as 'tests/waffle_test', its source is now in 'src/waffle_test' and its public headers in 'include/waffle_test'. Keeping things in canonical locations makes it easier to find things if you don't yet know where they reside. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-11-27cmake: Move targets check, check-func to top dirChad Versace3-19/+15
By moving 'check' to the top dir, each subdirectory can now add dependencies to 'check'. Ditto for 'check-func'. This change will allow us to build each unittest file as a separate executable, as well as maintain the CMake rules for the unittest in in the same directory as its sources. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-09-19cmake,android: Define WAFFLE_API_EXPERIMENTALChad Versace1-1/+4
This is required before actually marking any API as experimental to prevent the build from breaking. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-09-18Merge branch 'window-resize'Chad Versace1-0/+2
2013-09-18tests/gl_basic/cgl: Test various GL context flavorsChad Versace1-0/+182
A recent commit added to CGL better support for handling requested context flavors. So, we should now do the same degree of testing of context flavors on CGL that we do for all the other platforms. Test all OpenGL context versions 1.0 through 3.1; and core and compatibility profile 3.2 through 4.3. chadv: Tested on Mac OS 10.7 Lion. CC: Nigel Stewart <nigels.com@gmail.com> CC: Jeff Bland <jksb@linux.com> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-09-18cgl: Fix build, missing semicolonChad Versace1-1/+1
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-09-18tests/gl_basic: Fix order of CGL testsChad Versace1-7/+7
The order which test functions are defined should match the order listed in ${platform}_testsuite. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-09-18waffle: Add feature test macro WAFFLE_API_VERSIONChad Versace1-0/+2
This macro controls the API exposed by Waffle's headers. Use it to guard the new API added in waffle 1.3. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-09-17cgl: Fix build, missing semicolonChad Versace1-1/+1
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-09-16tests/gl_basic: Fix order of CGL testsChad Versace1-7/+7
The order which test functions are defined should match the order listed in ${platform}_testsuite. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-09-16tests/gl_basic: Add tests for debug contextsChad Versace1-3/+46
Add the following tests. Tests marked with '*' were validated on Mesa 9.3.0-devel (git-24765c5) with Intel Ivybridge. gl_basicl.cgl_gl_debug_is_unsupported gl_basicl.glx_gl_debug * gl_basicl.wayland_gl_debug * gl_basicl.x11_egl_gl_debug * Dont' add any tests for OpenGL ES debug contexts, because Mesa's GLX and EGL do not correctly handle requests OpenGL ES debug contexts. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-09-16tests/gl_basic: Add tests for forward-compatible contextsChad Versace1-1/+226
Add the following tests. Tests marked with '*' were verified with Mesa 9.3.0-devel (git-24765c5). cgl_gl_fwdcompat_bad_attribute for platform in [glx, wayland, x11_egl]: ${platform}_gl21_fwdcompat_bad_attribute * ${platform}_gl30_fwdcompat * ${platform}_gl31_fwdcompat * ${platform}_gl32_core_fwdcompat ${platform}_gles1_fwdcompat_bad_attribute * ${platform}_gles2_fwdcompat_bad_attribute * ${platform}_gles3_fwdcompat_bad_attribute * Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-09-16tests/gl_basic: Replace .expect_unsupported with .expect_errorChad Versace1-7/+7
If gl_basic_draw was called with .expect_unsupported=true, then the test passed only if waffle_config_choose() emitted WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM. Future tests will need to also check for WAFFLE_ERROR_BAD_ATTRIBUTE, so let's generalize by replacing the .expect_unsupported with .expect_error. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-09-16tests/gl_basic: Give gl_basic_draw() a default argument listChad Versace2-535/+273
By using default function arguments, we avoid updating every call to gl_basic_draw() when adding new tests. This will make it easier to add tests for forward-compatible contexts. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-19cmake: Refactor detection of operating systemChad Versace1-1/+1
Add new module WaffleDefineOS that defines booleans `waffle_on_linux` and `waffle_on_mac`. Replace each check on CMAKE_SYSTEM_NAME with a check on one of these new bools. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-19cmake: Refactor targets 'check', 'check-func'Chad Versace1-0/+19
They were defined in the toplevel CMakeLists.txt. Move them to `tests/CMakeLists.txt.` This change belongs to a series that cleans up the toplevel CMakeLists by decomposing it. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-05-09core: Update unittests for wcore_attrib_listChad Versace2-3/+3
Update waffle_attrib_list unittests to become wcore_attrib_list unittests. If possible, we should avoid unittesting public API. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-27waffle: Declare loop iterators the C99 wayChad Versace2-5/+2
That is, declare all loop iterators like this: for (int i = 0; ...) rather than: int i; ... for (i = 0; ...) Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-12tests/gl_basic: Add ES3 testsChad Versace1-0/+97
for platform in [glx, x11_egl, wayland]: Add test gl_basic.$platform_gles3_rgb Add test gl_basic.$platform_gles3_rgba Add test gl_basic.$platform_gles30 Tested against Mesa 9.1-devel. All tests skip. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-12tests/gl_basic: Add testcases for versions and profilesChad Versace1-30/+803
for platform in [glx, x11_egl, wayland]: // Add pre-profile OpenGL tests for version in 10..31: gl_basic.$platform_gl$version // Add post-profile OpenGL tests for version in 32..43: for profile in [core, compat]: gl_basic.$platform_gl$version_$profile // Add OpenGL ES1 tests gl_basic.$platform_gles10 gl_basic.$platform_gles11 // Add OpenGL ES2 test gl_basic.$platform_gles20 Tested against: - Mesa 9.1-devel with Intel Sandybridge, which supports GL <= 3.1, GLES1, and GLES2. - Xorg 1.12, which lacks GLX_ARB_create_context and GLX_EXT_create_context_es*_profile. All GLX, XEGL, and Wayland tests pass or skip as expected. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-12tests/gl_basic: Allow more skip conditionsChad Versace1-4/+18
If context creation fails due to WAFFLE_ERROR_UNKNOWN, then assume that the native platform rejected the requested context flavor and skip the test. Waffle should really be emitting WAFFLE_ERROR_NATIVE in those situations, but that error code doesn't exist yet. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-12tests/gl_basic: Add new params for version and profileChad Versace1-0/+56
Add to new parameters to gl_basic_draw(), context_version and context_profile. If the value of each param is WAFFLE_DONT_CARE, then it is ignored. This patch changes no behavior. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-12tests/gl_basic: Refactor filling of config attrib listChad Versace1-12/+15
Replace the array literal with a sequence of array assignments like `attrib_list[i++] = x`. This will provide more flexibility in a future commit. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-12tests/gl_basic: Add cases glx_basic.gles1_{rgb,rgba}Chad Versace1-7/+14
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-29tests/gl_basic: Check that CGL does not support ES1 and ES2Chad Versace1-0/+18
Add tests: gl_basic.cgl_gles1_unsupported gl_basic.cgl_gles2_unsupported Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-29tests/gl_basic: Check that GLX does not support GLES1Chad Versace1-14/+8
Replace tests gl_basic.glx_gles1_rgb gl_basic.glx_gles1_rgba with gl_basic.glx_gles1_unsupported Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-29tests/gl_basic: Refactor with new param, 'expect_config_unsupported'Chad Versace1-22/+68
Add a new param to gl_basic_draw, `bool expect_config_unsupported`. This refactor should change no behavior, because all calls to gl_basic_draw set expect_config_unsupported=false. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-18tests/gl_basic: Disable GBM testsChad Versace1-53/+0
The gl_basic testsuite can never pass if the gbm tests are run. When a display manager, such as X or Weston, owns the drm device, it's impossible to run the gbm tests as non-root. This makes `check-func` always fail. It's possible to run the gbm tests as a normal user if no display manager currently owns drm, but then the other tests fail. Until we find a better solution for gbm initialization, it's best to leave the gbm tests out and just manually tests it with `examples/gl_basic`. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-04gbm: initial skeleton for gbm supportJordan Justen1-0/+52
All routines in this skeleton will fail. Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-23waffle: Use a static libwaffle for unittestsChad Versace1-1/+1
The unittest executable needs access to waffle's internal symbols. Yet, the sources in libwaffle.so will soon be compiled with -fvisibility=hidden. One solution is to additionally build a static libwaffle and let the unittest executable link to that. Visibility options do not apply to static libraries; that is, all symbols are public and hence available to the unit tests. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-23all: Replace <> with "" for internal #include'sChad Versace2-2/+2
Now all internal includes consistently use `#include "..."`. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-23all: Make relative some include pathsChad Versace1-1/+1
Replace all includes of form #include <waffle/waffle_${x}.h> wth #include "waffle_${x}.h" Note: This prepares for the 1.0 release. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-23cmake, pkgconfig: Remove hardcoded libnameChad Versace2-2/+2
Define variable waffle_libname. Replace all references to the hardcoded libname "waffle" with ${waffle_libname}. In the 1.0 release, the libname will be "waffle-1". This will allow multiple major versions of Waffle to be installed in parallel. Note: This prepares for the 1.0 release. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-19include: Rename error to WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORMChad Versace1-2/+2
The new name is more clearly conveys the error meaning than the old name, WAFFLE_ERROR_UNSUPPORTED. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-06-10include: Rename error enumsChad Versace1-2/+2
For consistency, rename each token in `enum waffle_error` with the prefix WAFFLE_ERROR. The exception is WAFFLE_NO_ERROR, which is not renamed. This changes follows the precedent of Wayland, and makes it much easier to grep for error cases. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-06-05tests: Relocate unit test sourcesChad Versace4-678/+3
Move each unit test sourcefile into the same directory as the implementation sourcefile. For example, the wcore_error_unittest.c is now located at $WAFFLE_TOP/src/waffle/core/wcore_error_unitttest.c. The likelihood that a developer will write new tests is proportional to the proximity of the test sources to the implementation sources. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-06-05Revert "tests: Remove unused header, gl_basic_cocoa.h"Chad Versace2-0/+34
This reverts commit 08b16e9fe244cab2d8a8161616c85c2a72afa1c1. The reverted commit was a silly mistake. The header was in fact used, and its removal broke the Apple build.
2012-06-05tests: Remove unused header, gl_basic_cocoa.hChad Versace2-34/+0
I accidentally commited this when adding Apple support to gl_basic_test.c. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-30license: Convert from Apache 2.0 to BSDChad Versace13-117/+260
Jordan Justen brought to my attention that, according to the Apache and GNU websites, Apache 2.0 is incompatible with GPLv2 because GPLv2 lacks a patent indemnification clause. (It is compatible with GPLv3, however). See [1] [2] [3]. By the same logic, a lawyer could argue that Apache 2.0 is also incompatible, in one direction only, with minimal gift licenses such as BSD and MIT. I do not want license incompatibility to prevent any project from using Waffle's code, so I'm converting the project to use the most liberal license possible, BSD 2-clause [4]. [1] http://www.apache.org/licenses/GPL-compatibility.html [2] http://www.gnu.org/licenses/license-list.html#apache2 [3] http://en.wikipedia.org/wiki/Apache_License#GPL_compatibility [4] http://www.opensource.org/licenses/bsd-license.php CC: Jordan Justen <jljusten@gmail.com> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-30tests/gl_basic: Add tests for CGLChad Versace4-1/+130
Add tests: gl_basic.cgl_init gl_basic.cgl_gl The tests were verified to pass on MacOS 10.7. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-30gl_basic_test: Add test that config with alpha worksPauli Nieminen1-29/+83
With X11 backend waffle fails to create window for egl config with alpha. The problem is 32 bit X visual (id 0x66) that is special composite translucent visual. As mesa only support alpha bit with translucent window waffle choose config with the problematic visual. Does waffle provide application control to select between opaque and translucent window even if selecting config with alpha bit? Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-30core: Add field wcore_config_attrs.rgb_sizeChad Versace1-0/+4
GLX and EGL need rgba_size. CGL needs rgb_size. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-30core: Rename wcore_config_attrs.color_buffer_size -> rgba_sizeChad Versace1-2/+2
The name color_buffer_size was ambiguous. Is alpha included? Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-28Define XOPEN_SOURCE only on LinuxChad Versace2-2/+6
If XOPEN_SOURCE is defined on MacOS, then string.h does not define strdup(). This is the opposite behavior that occurs on Linux. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-28core: Replace pthread_barrier_t with pthread_cond_tChad Versace1-12/+40
MacOS doesn't support pthread_barrier_t. The replacement is in test wcore_error.thread_local. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-28core: Remove hard-coded number in test wcore_error.thread_localChad Versace1-6/+11
Number 3 was hard-coded in multiple places. Replace it with NUM_THREADS. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>