New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run wrench on travis CI with OSMesa #649
Merged
+386
−97
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.
Some generated files are not rendered by default. Learn more.
Oops, something went wrong.
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| root: | ||
| items: | ||
| - | ||
| bounds: 0 0 1024 768 | ||
| items: | ||
| - | ||
| bounds: 0 0 1024 768 | ||
| color: green | ||
| type: rect | ||
| type: stacking_context | ||
| z_index: 1 |
| @@ -0,0 +1,65 @@ | ||
| #!/usr/bin/python | ||
|
|
||
| import contextlib | ||
| import os | ||
| import subprocess | ||
| import sys | ||
| import hashlib | ||
| from os import path | ||
| from glob import glob | ||
|
|
||
|
|
||
| @contextlib.contextmanager | ||
| def cd(new_path): | ||
| """Context manager for changing the current working directory""" | ||
| previous_path = os.getcwd() | ||
| try: | ||
| os.chdir(new_path) | ||
| yield | ||
| finally: | ||
| os.chdir(previous_path) | ||
|
|
||
|
|
||
| def find_dep_path_newest(package, bin_path): | ||
| deps_path = path.join(path.split(bin_path)[0], "build") | ||
| with cd(deps_path): | ||
| candidates = glob(package + '-*') | ||
| candidates = (path.join(deps_path, c) for c in candidates) | ||
| candidate_times = sorted(((path.getmtime(c), c) for c in candidates), reverse=True) | ||
| if len(candidate_times) > 0: | ||
| return candidate_times[0][1] | ||
| return None | ||
|
|
||
|
|
||
| def is_windows(): | ||
| """ Detect windows, mingw, cygwin """ | ||
| return sys.platform == 'win32' or sys.platform == 'msys' or sys.platform == 'cygwin' | ||
|
|
||
|
|
||
| def is_macosx(): | ||
| return sys.platform == 'darwin' | ||
|
|
||
|
|
||
| def is_linux(): | ||
| return sys.platform.startswith('linux') | ||
|
|
||
|
|
||
| def set_osmesa_env(bin_path): | ||
| """Set proper LD_LIBRARY_PATH and DRIVE for software rendering on Linux and OSX""" | ||
| if is_linux(): | ||
| osmesa_path = path.join(find_dep_path_newest('osmesa-src', bin_path), "out", "lib", "gallium") | ||
| print(osmesa_path) | ||
| os.environ["LD_LIBRARY_PATH"] = osmesa_path | ||
| os.environ["GALLIUM_DRIVER"] = "softpipe" | ||
| elif is_macosx(): | ||
| osmesa_path = path.join(find_dep_path_newest('osmesa-src', bin_path), | ||
| "out", "src", "gallium", "targets", "osmesa", ".libs") | ||
| glapi_path = path.join(find_dep_path_newest('osmesa-src', bin_path), | ||
| "out", "src", "mapi", "shared-glapi", ".libs") | ||
| os.environ["DYLD_LIBRARY_PATH"] = osmesa_path + ":" + glapi_path | ||
| os.environ["GALLIUM_DRIVER"] = "softpipe" | ||
|
|
||
|
|
||
| set_osmesa_env('../target/release/') | ||
glennw
Author
Member
|
||
| subprocess.check_call(['../target/release/wrench', '-t', '1', '-h', 'show', sys.argv[1]]) | ||
| print('md5 = ' + hashlib.md5(open('screenshot.png', 'rb').read()).hexdigest()) | ||
Oops, something went wrong.
ProTip!
Use n and p to navigate between commits in a pull request.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
is our executable built by
cargo testguaranteed to be inreleasefolder?