~thomir-deactivatedaccount/+junk/runbench

« back to all changes in this revision

Viewing changes to runbench.py

  • Committer: Thomi Richards
  • Date: 2013-06-27 04:11:01 UTC
  • Revision ID: thomi.richards@canonical.com-20130627041101-qreh68us8sbt3kto
Modify default location of mir display server.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
import argparse
6
6
import json
7
7
import re
 
8
from os.path import join
8
9
import shlex
9
10
import signal
10
11
import subprocess
64
65
        in the glmark2 format on stdout."
65
66
        )
66
67
    parser.add_argument("--mir-server",
67
 
        default="mir_demo_server",
 
68
        default=get_default_mir_server_location(),
68
69
        help="Specify how to run the mir server. The default is 'mir'."
69
70
        )
70
71
    parser.add_argument("--log-to-file",
78
79
    return parser.parse_args()
79
80
 
80
81
 
 
82
def get_default_mir_server_location():
 
83
    multi_arch = subprocess.check_output(
 
84
        ["dpkg-architecture", "-qDEB_HOST_MULTIARCH"]).decode('utf8').strip()
 
85
    full_path = join("/usr/lib/",
 
86
        multi_arch,
 
87
        "mir/examples/mir_demo_server")
 
88
    return full_path
 
89
 
 
90
 
81
91
def configure_logging(log_location):
82
92
    if log_location == "-":
83
93
        logging.basicConfig(level=logging.DEBUG)