generated_tests: Except error for os.makedirs

Currently we check for the existence of a directory, and if it doesn't
exist we create it. This would be fine, except that multiple generators
can create the same directory trees. When os.makedirs tries to create a
tree that already exists it raises and OSError exception, with the errno
set to 17 (the File Exists Error). Since between the time that a check
is made and the time the os.makedirs completes a second generator can
create the directory tree we can have exceptions raised sporadically,
especially as the number of threads being used to generate goes up.

We maintain the check for existence before trying to create the
directories because os.makedirs is slow, so not even trying is better
than trying in vain.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
arb_timer_query: Add missing header

v2: protect the include with guards

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Vinson Lee <vlee@freedesktop.org>
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
util: Define usleep for MSVC only.

MinGW has usleep.

Fixes MinGW build error introduced in previous commit.

piglit-util.h:76:30: error: expected declaration specifiers or '...' before '(' token
 #define usleep(__usec) Sleep(((__usec) + 999)/1000)
                              ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
teximage-colors: Remove self assignment.

Fix self assignment defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-By: Jason Ekstrand <jason.ekstrand@intel.com>
utils: add initial WAFFLE_WGL support

This will allow us to use waffle with its upcoming WGL support for
Windows. With that done, the final step to removing glut is to convert
piglit to use waffle for MacOS.

Current implementation does not have input handling/event loop, and as
such one needs to pass "-auto" when running individual tests, otherwise
the test will abort after being displayed for 8 seconds.

Waffle 1.5.0 is the first version that has WGL support.

TODO:
 - Add input handling (event_loop).

v2: Updated the instructions in the README.
v3: Update against upstream Waffle (no API breakage)
v4: s/Sleep/fprintf()+getchar()/ in the event_loop. Suggested by Jose.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
util/dispatch: move "to waffle or not to waffle" decision in the caller

piglit-dispatch.c is about to get hairy even without this hunk. Also
moving the code in piglit-dispatch-init.c will allow us to have a clear
visual as we start removing the non-waffle (glut) support.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
cl-api-enqueue-map-buffer: Initialize variable.

Fix uninitialized scalar variable defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
cl-api-get-device-info: Fix memory leak.

Fix resource leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
gl-1.0-logicop: Fix memory leak.

Fix resource leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
gl-1.0-readpixsanity: Initialize variables.

Fix uninitialized scalar variable defects reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
teximage-colors: Add comment to silence Coverity defect.

Silences Coverity report about missing break in switch.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Correct typos in README

Reviewed-by: Dylan Baker <dylanx.c.baker@intel.com>
glsl-deriv-varyings: Added checks for derivatives on parameters with negative or abs modifiers

Exposes a bug in the i965 driver.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82991
Reviewed-by: Matt Turner <mattst88@gmail.com>
ssa: Add a test for the classic "swap problem" in out-of-SSA translation

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-By: Glenn Kennard <glenn.kennard@gmail.com>
ssa: Add a test for the classic "lost copy problem" in out-of-SSA translation

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-By: Glenn Kennard <glenn.kennard@gmail.com>
ssa: Add a test for an edge case in into-SSA translation

In particular, we want to test the case

a = ...
if (foo) {
    a = ...
} else {
    break;
}
... = a;

We had a bug in one of the into-ssa passes that caused the use of a at the
end to use the first definition of a instead of the second.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-By: Glenn Kennard <glenn.kennard@gmail.com>
framework: Use WGL by default on Windows.

Like done with GLX on Linux.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
cmake: Don't rely on pkg-config for all Windows builds.

Instead of just MSVC builds.

Because pkg-config is not commonly available when compiling natively on
Windows, and gives the wrong results (the host package instead of target
package) when cross-compiling to Windows.

Reviewed-by: Brian Paul <brianp@vmware.com>
cmake: Don't check WAFFLE_VERSION on Windows.

The version number must be manually on command line, hence this
version check is just an hindrance for Windows.

Reviewed-by: Brian Paul <brianp@vmware.com>
cmake: Improve experience detecting waffle on Windows.

- Use find_path/find_library so one can see the variables on cmake-gui

- Provide better error message.

Reviewed-by: Brian Paul <brianp@vmware.com>