Commit 246048d8 authored by o9000's avatar o9000

Regression tests

parent 3a7fb097
#################################
#
# Backend
#
#################################
# Backend to use: "xrender" or "glx".
# GLX backend is typically much faster but depends on a sane driver.
backend = "glx";
#################################
#
# GLX backend
#
#################################
glx-no-stencil = true;
# GLX backend: Copy unmodified regions from front buffer instead of redrawing them all.
# My tests with nvidia-drivers show a 10% decrease in performance when the whole screen is modified,
# but a 20% increase when only 1/4 is.
# My tests on nouveau show terrible slowdown.
# Useful with --glx-swap-method, as well.
glx-copy-from-front = false;
# GLX backend: Use MESA_copy_sub_buffer to do partial screen update.
# My tests on nouveau shows a 200% performance boost when only 1/4 of the screen is updated.
# May break VSync and is not available on some drivers.
# Overrides --glx-copy-from-front.
# glx-use-copysubbuffermesa = true;
# GLX backend: Avoid rebinding pixmap on window damage.
# Probably could improve performance on rapid window content changes, but is known to break things on some drivers (LLVMpipe).
# Recommended if it works.
# glx-no-rebind-pixmap = true;
# GLX backend: GLX buffer swap method we assume.
# Could be undefined (0), copy (1), exchange (2), 3-6, or buffer-age (-1).
# undefined is the slowest and the safest, and the default value.
# copy is fastest, but may fail on some drivers,
# 2-6 are gradually slower but safer (6 is still faster than 0).
# Usually, double buffer means 2, triple buffer means 3.
# buffer-age means auto-detect using GLX_EXT_buffer_age, supported by some drivers.
# Useless with --glx-use-copysubbuffermesa.
# Partially breaks --resize-damage.
# Defaults to undefined.
glx-swap-method = "undefined";
#################################
#
# Shadows
#
#################################
# Enabled client-side shadows on windows.
shadow = true;
# Don't draw shadows on DND windows.
no-dnd-shadow = true;
# Avoid drawing shadows on dock/panel windows.
no-dock-shadow = true;
# Zero the part of the shadow's mask behind the window. Fix some weirdness with ARGB windows.
clear-shadow = true;
# The blur radius for shadows. (default 12)
shadow-radius = 10;
# The left offset for shadows. (default -15)
shadow-offset-x = -12;
# The top offset for shadows. (default -15)
shadow-offset-y = -12;
# The translucency for shadows. (default .75)
shadow-opacity = 0.75;
# Set if you want different colour shadows
# shadow-red = 0.0;
# shadow-green = 0.0;
# shadow-blue = 0.0;
# The shadow exclude options are helpful if you have shadows enabled. Due to the way compton draws its shadows, certain applications will have visual glitches
# (most applications are fine, only apps that do weird things with xshapes or argb are affected).
# This list includes all the affected apps I found in my testing. The "! name~=''" part excludes shadows on any "Unknown" windows, this prevents a visual glitch with the XFWM alt tab switcher.
shadow-exclude = [
"! name~=''",
"name = 'Notification'",
"name = 'Plank'",
"name = 'Docky'",
"name = 'Kupfer'",
"name = 'xfce4-notifyd'",
"name *= 'VLC'",
"name *= 'compton'",
"name *= 'Chromium'",
"name *= 'Chrome'",
"name *= 'Firefox'",
"class_g = 'Conky'",
"class_g = 'Kupfer'",
"class_g = 'Synapse'",
"class_g ?= 'Notify-osd'",
"class_g ?= 'Cairo-dock'",
"class_g ?= 'Xfce4-notifyd'",
"class_g ?= 'Xfce4-power-manager'"
];
# Avoid drawing shadow on all shaped windows (see also: --detect-rounded-corners)
shadow-ignore-shaped = false;
#################################
#
# Opacity
#
#################################
menu-opacity = 1;
inactive-opacity = 1;
active-opacity = 1;
frame-opacity = 1;
inactive-opacity-override = false;
alpha-step = 0.06;
# Dim inactive windows. (0.0 - 1.0)
# inactive-dim = 0.2;
# Do not let dimness adjust based on window opacity.
# inactive-dim-fixed = true;
# Blur background of transparent windows. Bad performance with X Render backend. GLX backend is preferred.
# blur-background = true;
# Blur background of opaque windows with transparent frames as well.
# blur-background-frame = true;
# Do not let blur radius adjust based on window opacity.
blur-background-fixed = false;
blur-background-exclude = [
"window_type = 'dock'",
"window_type = 'desktop'"
];
#################################
#
# Fading
#
#################################
# Fade windows during opacity changes.
fading = false;
# The time between steps in a fade in milliseconds. (default 10).
fade-delta = 4;
# Opacity change between steps while fading in. (default 0.028).
fade-in-step = 0.03;
# Opacity change between steps while fading out. (default 0.03).
fade-out-step = 0.03;
# Fade windows in/out when opening/closing
# no-fading-openclose = true;
# Specify a list of conditions of windows that should not be faded.
fade-exclude = [ ];
#################################
#
# Other
#
#################################
# Try to detect WM windows and mark them as active.
mark-wmwin-focused = true;
# Mark all non-WM but override-redirect windows active (e.g. menus).
mark-ovredir-focused = true;
# Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused instead of using FocusIn/Out events.
# Usually more reliable but depends on a EWMH-compliant WM.
use-ewmh-active-win = true;
# Detect rounded corners and treat them as rectangular when --shadow-ignore-shaped is on.
detect-rounded-corners = true;
# Detect _NET_WM_OPACITY on client windows, useful for window managers not passing _NET_WM_OPACITY of client windows to frame windows.
# This prevents opacity being ignored for some apps.
# For example without this enabled my xfce4-notifyd is 100% opacity no matter what.
detect-client-opacity = true;
# Specify refresh rate of the screen.
# If not specified or 0, compton will try detecting this with X RandR extension.
refresh-rate = 0;
# Set VSync method. VSync methods currently available:
# none: No VSync
# drm: VSync with DRM_IOCTL_WAIT_VBLANK. May only work on some drivers.
# opengl: Try to VSync with SGI_video_sync OpenGL extension. Only work on some drivers.
# opengl-oml: Try to VSync with OML_sync_control OpenGL extension. Only work on some drivers.
# opengl-swc: Try to VSync with SGI_swap_control OpenGL extension. Only work on some drivers. Works only with GLX backend. Known to be most effective on many drivers. Does not actually control paint timing, only buffer swap is affected, so it doesn’t have the effect of --sw-opti unlike other methods. Experimental.
# opengl-mswc: Try to VSync with MESA_swap_control OpenGL extension. Basically the same as opengl-swc above, except the extension we use.
# (Note some VSync methods may not be enabled at compile time.)
vsync = "opengl-swc";
# Enable DBE painting mode, intended to use with VSync to (hopefully) eliminate tearing.
# Reported to have no effect, though.
dbe = false;
# Painting on X Composite overlay window. Recommended.
paint-on-overlay = true;
# Limit compton to repaint at most once every 1 / refresh_rate second to boost performance.
# This should not be used with --vsync drm/opengl/opengl-oml as they essentially does --sw-opti's job already,
# unless you wish to specify a lower refresh rate than the actual value.
sw-opti = false;
# Unredirect all windows if a full-screen opaque window is detected, to maximize performance for full-screen windows, like games.
# Known to cause flickering when redirecting/unredirecting windows.
# paint-on-overlay may make the flickering less obvious.
unredir-if-possible = true;
# Specify a list of conditions of windows that should always be considered focused.
focus-exclude = [ ];
# Use WM_TRANSIENT_FOR to group windows, and consider windows in the same group focused at the same time.
detect-transient = true;
# Use WM_CLIENT_LEADER to group windows, and consider windows in the same group focused at the same time.
# WM_TRANSIENT_FOR has higher priority if --detect-transient is enabled, too.
detect-client-leader = true;
#################################
#
# Window type settings
#
#################################
wintypes:
{
tooltip =
{
# fade: Fade the particular type of windows.
fade = false;
# shadow: Give those windows shadow
shadow = false;
# opacity: Default opacity for the type of windows.
opacity = 1;
# focus: Whether to always consider windows of this type focused.
focus = true;
};
};
This diff is collapsed.
#---- Generated by tint2conf 6abf ----
# See https://gitlab.com/o9000/tint2/wikis/Configure for
# full documentation of the configuration options.
#-------------------------------------
# Gradients
#-------------------------------------
# Backgrounds
# Background 1: Executor
rounded = 0
border_width = 0
border_sides = TBLR
background_color = #ff0000 100
border_color = #000000 0
background_color_hover = #000000 0
border_color_hover = #000000 0
background_color_pressed = #000000 0
border_color_pressed = #000000 0
#-------------------------------------
# Panel
panel_items = EF
panel_size = 100% 30
panel_margin = 0 0
panel_padding = 0 0 0
panel_background_id = -1
wm_menu = 0
panel_dock = 0
panel_position = top center horizontal
panel_layer = normal
panel_monitor = all
panel_shrink = 0
autohide = 0
autohide_show_timeout = 0
autohide_hide_timeout = 0
autohide_height = 1
strut_policy = follow_size
panel_window_name = tint2
disable_transparency = 0
mouse_effects = 0
font_shadow = 0
mouse_hover_icon_asb = 100 0 10
mouse_pressed_icon_asb = 100 0 0
#-------------------------------------
# Taskbar
taskbar_mode = single_desktop
taskbar_hide_if_empty = 0
taskbar_padding = 0 0 0
taskbar_background_id = -1
taskbar_active_background_id = -1
taskbar_name = 0
taskbar_hide_inactive_tasks = 0
taskbar_hide_different_monitor = 0
taskbar_hide_different_desktop = 0
taskbar_always_show_all_desktop_tasks = 0
taskbar_name_padding = 0 0
taskbar_name_background_id = -1
taskbar_name_active_background_id = -1
taskbar_name_font_color = #000000 100
taskbar_name_active_font_color = #000000 100
taskbar_distribute_size = 0
taskbar_sort_order = none
task_align = left
#-------------------------------------
# Task
task_text = 0
task_icon = 0
task_centered = 0
urgent_nb_of_blink = 0
task_maximum_size = 0 0
task_padding = 0 0 0
task_tooltip = 0
mouse_left = toggle_iconify
mouse_middle = none
mouse_right = close
mouse_scroll_up = none
mouse_scroll_down = none
#-------------------------------------
# System tray (notification area)
systray_padding = 0 0 0
systray_background_id = -1
systray_sort = ascending
systray_icon_size = 0
systray_icon_asb = 100 0 0
systray_monitor = primary
systray_name_filter =
#-------------------------------------
# Launcher
launcher_padding = 0 0 0
launcher_background_id = -1
launcher_icon_background_id = -1
launcher_icon_size = 0
launcher_icon_asb = 100 0 0
launcher_icon_theme_override = 0
startup_notifications = 0
launcher_tooltip = 0
#-------------------------------------
# Clock
time1_format =
time2_format =
time1_timezone =
time2_timezone =
clock_font_color = #000000 100
clock_padding = 0 0
clock_background_id = -1
clock_tooltip =
clock_tooltip_timezone =
clock_lclick_command =
clock_rclick_command =
clock_mclick_command =
clock_uwheel_command =
clock_dwheel_command =
#-------------------------------------
# Battery
battery_tooltip = 1
battery_low_status = 0
battery_low_cmd =
battery_full_cmd =
battery_font_color = #000000 100
bat1_format =
bat2_format =
battery_padding = 0 0
battery_background_id = -1
battery_hide = 0
battery_lclick_command =
battery_rclick_command =
battery_mclick_command =
battery_uwheel_command =
battery_dwheel_command =
ac_connected_cmd =
ac_disconnected_cmd =
#-------------------------------------
# Executor 1
execp = new
execp_command = cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 4 | head -n 1
execp_interval = 1
execp_has_icon = 0
execp_cache_icon = 1
execp_continuous = 0
execp_markup = 1
execp_lclick_command =
execp_rclick_command =
execp_mclick_command =
execp_uwheel_command =
execp_dwheel_command =
execp_font = DejaVu Sans Ultra-Light 10
execp_font_color = #000000 100
execp_padding = 0 0
execp_background_id = 1
execp_centered = 0
execp_icon_w = 0
execp_icon_h = 0
#-------------------------------------
# Tooltip
tooltip_show_timeout = 0
tooltip_hide_timeout = 0
tooltip_padding = 0 0
tooltip_background_id = -1
tooltip_font_color = #000000 100
Net/ThemeName "ChromeDark"
Net/IconThemeName "elementary-xfce-dark"
Xft/Antialias 1
#Xft/DPI 100352
Xft/HintStyle "hintmedium"
Xft/Hinting 1
Xft/RGBA "none"
Xft/lcdfilter "none"
Gtk/FontName "Liberation Sans 10"
#!/usr/bin/env python2
import sys
reload(sys)
sys.setdefaultencoding('utf8')
import datetime
import os
import signal
import subprocess
import time
display = "99"
devnull = open(os.devnull, "r+")
ok = ":white_check_mark:"
warning = ":warning:"
error = ":negative_squared_cross_mark:"
stress_duration = 1
def run(cmd, output=False):
return subprocess.Popen(cmd,
stdin=devnull,
stdout=devnull if not output else subprocess.PIPE,
stderr=devnull if not output else subprocess.STDOUT,
shell=isinstance(cmd, basestring),
close_fds=True,
preexec_fn=os.setsid)
def stop(p):
os.killpg(os.getpgid(p.pid), signal.SIGTERM)
def sleep(n):
while n > 0:
sys.stderr.write(".")
sys.stderr.flush()
time.sleep(1)
n -= 1
def start_xvfb():
stop_xvfb()
xvfb = run(["Xvfb", ":{0}".format(display), "-screen", "0", "1280x720x24", "-nolisten", "tcp", "-dpi", "96"])
if xvfb.poll() != None:
raise RuntimeError("Xvfb failed to start")
os.environ["DISPLAY"] = ":{0}".format(display)
return xvfb
def stop_xvfb():
run("kill $(netstat -ap 2>/dev/null | grep X{0} | grep LISTENING | grep -o '[0-9]*/Xvfb' | head -n 1 | cut -d / -f 1) 1>/dev/null 2>/dev/null ".format(display)).wait()
def start_xsettings():
return run(["xsettingsd", "-c", "./configs/xsettingsd.conf"])
def start_wm():
return run(["openbox", "--replace", "--config-file", "./configs/openbox.xml"])
def start_compositor():
return run(["compton", "--config", "./configs/compton.conf"])
def start_stressors():
stressors = []
stressors.append(run(["./workspaces-stress.sh"]))
return stressors
def stop_stressors(stressors):
for s in stressors:
stop(s)
def compute_min_med_fps(out):
samples = []
for line in out.split("\n"):
if "fps = " in line:
fps = float(line.split("fps = ", 1)[-1].split(" ")[0])
samples.append(fps)
samples.sort()
return min(samples), samples[len(samples)/2]
def get_mem_usage(pid):
value = None
with open("/proc/{0}/status".format(pid)) as f:
for line in f:
if line.startswith("VmRSS:"):
rss = line.split(":", 1)[-1].strip()
value, multiplier = rss.split(" ")
value = float(value)
if multiplier == "kB":
value *= 1024
else:
raise RuntimeError("Could not parse /proc/[pid]/status")
if not value:
raise RuntimeError("Could not parse /proc/[pid]/status")
return value * 1.0e-6
def find_asan_leaks(out):
traces = []
trace = None
for line in out.split("\n"):
line = line.strip()
if " leak of " in line and " allocated from:" in line:
trace = []
if trace != None:
if line.startswith("#"):
trace.append(line)
else:
if any([ "tint2" in frame for frame in trace ]):
traces.append(trace)
trace = None
return traces
def test(tint2path, config):
start_xvfb()
sleep(1)
start_xsettings()
start_wm()
sleep(1)
os.environ["DEBUG_FPS"] = "1"
os.environ["ASAN_OPTIONS"] = "detect_leaks=1"
tint2 = run(["tint2", "-c", config], True)
if tint2.poll() != None:
raise RuntimeError("tint2 failed to start")
sleep(1)
# Handle late compositor start
compton = start_compositor()
sleep(2)
# Stress test with compositor on
stressors = start_stressors()
sleep(stress_duration)
stop_stressors(stressors)
# Handle compositor stopping
stop(compton)
# Stress test with compositor off
stressors = start_stressors()
sleep(stress_duration)
stop_stressors(stressors)
# Handle WM restart
start_wm()
# Stress test with new WM
stressors = start_stressors()
sleep(stress_duration)
stop_stressors(stressors)
# Collect info
mem = get_mem_usage(tint2.pid)
stop(tint2)
out, _ = tint2.communicate()
exitcode = tint2.returncode
if exitcode != 0:
print "tint2 crashed with exit code {0}!".format(exitcode)
print "Output:"
print "```"
print out
print "```"
return
min_fps, med_fps = compute_min_med_fps(out)
leaks = find_asan_leaks(out)
sys.stderr.write("\n")
mem_status = ok if mem < 20 else warning if mem < 40 else error
print "Memory usage: %.1f %s %s" % (mem, "MB", mem_status)
leak_status = ok if not leaks else error
print "Memory leak count:", len(leaks), leak_status
for leak in leaks:
print "Memory leak:"
for line in leak:
print line
fps_status = ok if min_fps > 60 else warning if min_fps > 40 else error
print "FPS:", "min:", min_fps, "median:", med_fps, fps_status
if mem_status != ok or leak_status != ok or fps_status != ok:
print "Output:"
print "```"
print out
print "```"
stop_xvfb()
def main():
utc_datetime = datetime.datetime.utcnow()
print "Last updated:", utc_datetime.strftime("%Y-%m-%d %H:%M UTC")
out, _ = run("git show -s '--format=%H %s'", True).communicate()
print "Last commit:", out.strip()
diff, _ = run("git diff", True).communicate()
diff = diff.strip()
diff_staged, _ = run("git diff --staged", True).communicate()
diff_staged = diff_staged.strip()
if diff or diff_staged:
print "Repository not clean", warning
if diff:
print "Diff:"
print "```"
print diff
print "```"
if diff_staged:
print "Diff staged:"
print "```"
print diff_staged
print "```"
print ""
print "# Compilation"
cmake_flags = "-DCMAKE_BUILD_TYPE=Debug -DENABLE_ASAN=ON"
print "Flags:", cmake_flags
start = time.time()
c = run("rm -rf build; mkdir build; cd build; cmake {0} ../../ ; make -j7".format(cmake_flags), True)
out, _ = c.communicate()
duration = time.time() - start
if c.returncode != 0:
print "Status: Failed!", error
print "Output:"
print "```"
print out
print "```"
return
if "warning:" in out:
print "Status: Succeeded with warnings!", warning
print "Warnings:"
print "```"
for line in out.split("\n"):
if "warning:" in line:
print line
print "```"
else:
print "Status: Succeeded in %.1f seconds" % (duration,), ok
configs = []
configs += ["./configs/tint2/" +s for s in os.listdir("./configs/tint2") ]
configs += ["../themes/" + s for s in os.listdir("../themes")]
index = 0
for config in configs:
index += 1
print ""
print "# Test", index
print "Config:", config.split("/")[-1].replace(".tint2rc", "")
test("./build/tint2", config)
if __name__ == "__main__":
main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment