[chirp_devel] [PATCH 12/12] Allow run_tests to be run from anywhere (#2343)

Zach Welch
Fri Feb 27 02:24:49 PST 2015


# HG changeset patch
# User Zach Welch <zach at mandolincreekfarm.com>
# Fake Node ID ec876b2c27ad8f72d1881fe505edcb8985c693ec

Allow run_tests to be run from anywhere (#2343)

Find the path to run_tests, then chdir into the tests directory.

diff --git a/tests/run_tests b/tests/run_tests
index 0c3b15b..2dae5e5 100755
--- a/tests/run_tests
+++ b/tests/run_tests
@@ -19,7 +19,10 @@ import traceback, sys, os, shutil, glob, tempfile, time
 from optparse import OptionParser
 from serial import Serial
 
-# Assume we're running in the tests/ directory of the archive
+# change to the tests directory
+scriptdir = os.path.dirname(sys.argv[0])
+os.chdir(scriptdir)
+
 sys.path.insert(0, "../")
 
 from chirp import CHIRP_VERSION




More information about the chirp_devel mailing list