summaryrefslogtreecommitdiff
path: root/gpsfake
Commit message (Collapse)AuthorAgeFilesLines
* gpsfake: Disable timeout when debugging.Fred Wright2018-12-271-0/+2
| | | | | | | | | | | | Since debugging typically involves stopping at breakpoints, the timeout tends to get in the way. This adds an implied -W0 to the -g and -G options to avoid that. If for some reason the timeout is actually wanted, it can be reenabled by providing a -W option after the -g or -G. TESTED: Verified that -G disables the timeout. Did not test -g, though the code is the same for it.
* gpsfake: Add option for debugging with lldb.Fred Wright2018-12-271-2/+7
| | | | | | | | | | This adds the -G option, which is like the -g option but using lldb rather than gdb. It's not quite equivalent, since lldb doesn't have the "-tui" option, although some versions of lldb have a gui mode that can be entered via command. TESTED: Verified that -G launches with lldb as expected.
* gpsfake: Allow timeout to be specified.Fred Wright2018-12-271-2/+10
| | | | | | | | | | | This adds an argument to allow overriding the default 60-second timeout on gpsd's activity. A value of 0 disables the timeout completely. Note that the timeout mechanism is somewhat sloppy, and typically adds about 20s to the value. TESTED: Ran with unspecified (default) timeout, a short timeout, a long timeout, and no timeout, all with reasonable results.
* gpsfake: Improve usage() output.Gary E. Miller2018-11-231-22/+22
|
* gpsfake: Add test for PYTHONPATHGary E. Miller2018-11-161-2/+9
|
* Update version to 3.19-dev. back to dev cycle.dev-3.19aGary E. Miller2018-10-191-1/+1
|
* Chnage version to 3.18.1release-3.18.1Gary E. Miller2018-10-191-1/+1
|
* 3.19!dev: Change revisions for 3.19~dev cycle.Gary E. Miller2018-10-021-1/+1
|
* Version bump to 3.18 for release.release-3.18Gary E. Miller2018-10-021-1/+1
|
* Python clients: Opps 3.18~dev, not 3.18-dev.Gary E. Miller2018-10-011-1/+1
| | | | A tilda, not a dash.
* gpsfake: pylint cleanupsGary E. Miller2018-09-211-10/+16
|
* gpsfake, gpsfake, gpsprof: pep8 tweaks.Gary E. Miller2018-09-211-0/+1
|
* gpsfake: cleanup getopt(). Add -V option.Gary E. Miller2018-09-211-10/+36
|
* add gps module version check to Python programsGary E. Miller2018-09-211-0/+6
|
* SPDXify the licerse references.Eric S. Raymond2018-03-081-1/+1
|
* gpsfake: fix two pylint complaints of variable type changing.Gary E. Miller2017-07-261-2/+2
|
* Fixes some pylint issues.Fred Wright2017-07-141-2/+3
| | | | | | | | | | | This doesn't fix all complaints by pylint, but significantly reduces their number. Ditto for pep8 complaints. Also makes a couple of related cosmetic edits. TESTED: Ran "scons build-all check" with no errors. Both "pylint" and "pep8" targets report fewer issues.
* gpsfake: pep8 cleanup.Gary E. Miller2017-07-011-10/+22
|
* Adds missing -q option to gpsfake -h.Fred Wright2017-03-171-2/+4
| | | | | | | Also fixes long lines and indentation. TESTED: Observed corrected -h output.
* More quietness for gpsfakeRobert Norris2017-03-171-1/+2
| | | | | | | | | Don't print 'log cycle begins' lines for quiet runs. TESTED: 'gpsfake -q test/daemon/garmin17n.log' does not print anything. Signed-off-by: Fred Wright <fw@fwright.net>
* Enable gpsfake to list all optionsRobert Norris2017-03-171-1/+3
| | | | | | | | | | | | Output a succinct list of all options available for gpsfake. This includes fixing the incorrect double hyphen for the debug level. Note that gpsfake can handle multiple log files. TESTED: The list is displayed on 'gpsfake -h' Signed-off-by: Fred Wright <fw@fwright.net>
* Makes "silent" build quieter.Fred Wright2017-03-041-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | This suppresses all "success chatter" from the daemon regression tests when building in --silent (or -s) mode. Failing cases still output the usual messages (except for "Processing..."). Other regression chatter is still present, but this puts a big dent in it. This involves three changes: 1) It adds a -q option to gpsfake, to suppress the "Processing" messages. 2) It adds a -Q option to regress-driver, which passes -q to gpsfake and also suppresses its own output in the success case. Failure output is unaffected. 3) It adds the -Q option to regress-driver invocations when the build is running in silent mode. TESTED: Ran regress-driver in normal, -q, and -Q modes. Ran "scons build-all check", with and without -s. Also tested an error case with a garbled .chk file.
* Changes fake.py stream type to 'bytes'.Fred Wright2016-12-251-3/+3
| | | | | | | | | | | | | | | | | | | Given that the data returned bye fake.py may include binary data, 'bytes' is a more appropriate type. Unlike the client API, where it's easy to provide both return types, it would be less convenient to do that here, so 'bytes' is preferred as the one choice (and is consistent with network sockets). When sending such data to stdout (or stderr), the straightforward method is to write to sys.stdXXX.buffer rather than sys.stdXXX. That doesn't exist in Python 2, but a helper function is now provided to get the appropriate 'bytes' stream for stdXXX. Since no previous *release* of GPSD is compatible with Python 3, changing this now doesn't break anything based on released code. TESTED: Ran "scons check" on OSX with all supported Python versions.
* Fixes Python programs to use new-style classes.Fred Wright2016-04-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Although this isn't strictly a Python 3 requirement, using the new-style class definition syntax improves consistency between Python 2 and Python 3. Old-style classes have been deprecated since Python 2.2, but many such definitions linger on. Python 3 eliminates old-style classes, but instead of complaining about old-style definitions, it simply unconditionally and silently makes all classes new-style. The only incompatible differences are quite subtle and rarely matter in practice, but things are more consistent across versions if the new-style definitions are used. Also, the preferred method for subclasses to invoke parent init methods is via the super() construct, which is only available with new-style classes. Using super() is especially useful with multiple inheritance, which it handles automatically (provided that the init methods have compatible signatures). TESTED: Using an SConstruct patched to run the build helpers with the target Python, ran "scons build-all check ", as well as gpsprof and xgps, with all six supported Python versions (except 2.6 for xgps).
* Makes "future imports" and Python version comments consistent.Fred Wright2016-04-101-1/+1
| | | | | | | | | | | | | | | | | | | | This makes the "future import" statements consistently specify absolute_import, print_function, and division, for maximum consistency between Python 2 and Python 3. Although absolute_import is probably a don't care for top-level programs, if unit tests were ever implemented for the programs they would be imported as modules, making the module import behavior relevant. Note that previous Python 3 fixes are a prerequisite for this change. Also makes the "polyglot comment" consistent across sources. TESTED: Using a version of SConstruct patched to use the target Python for build helpers, ran "scons build-all check valgrind-audit www/hardware.html" with all six supported Python versions. Also ran gegps, gpscat, gpsprof, xgps, and xgpsspeed with both Python 2 and Python 3.
* Fixes fake.py and gpsfake for Python 3.Fred Wright2016-04-091-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This incorporates the following changes: 1) Adds definitions for polystr(), polybytes(), and make_std_wrapper() to misc.py (the most logical place for code needed by multiple modules), using dummy definitions in the Python 2 case. For more info, see the Practical Python Porting guide. 2) Reworks the logfile->daemon data path in fake.py to use 'bytes' consistently. 3) Uses polybytes() in fake.py to construct control-socket commands as 'bytes', as expected by the socket I/O. 4) Uses make_std_wrapper() in gpsfake, to ensure that binary data is correctly written to stdout. 5) Adds 'division' to the future imports in gpsfake for consistency, though it doesn't actually matter in practice. Also updates the compatibility comments in all three files, and fixes a minor typo in misc.py. TESTED: Ran "scons build-all check" with Python 2.7, and ran all daemon regression tests with Python 2.6 and with Python 3.2-3.5 (with appropriately built extensions; not yet a build option).
* gpsfake now runs polyglot under Python 2 or 3.Eric S. Raymond2016-03-221-1/+2
|
* Forward-port Python utilities to run polyglot under either Python 2 or 3.Eric S. Raymond2016-03-221-27/+33
| | | | | | For the moment most shebang lines still say 'python2' rather than just 'python'. This is because the client code in gps/ hasn't been touched yet; the internal imports break under Python 3 and that needs to be fixed.
* Makes gpsfake -T take -S into account.Fred Wright2016-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | This makes it possible to view the "slow" as well as the normal WRITE_PAD values with gpsfake -T, without having to look at the source code. It adds a new GetDelay() function to fake.py, which returns the proper delay value, taking into account both the possible environment variable and the "slow" option. This is now used for all hree uses of WRITE_PAD. Because the environment override is now part of the function, the WRITE_PAD constant is no longer modified by the environment value, but instead reflects the platform default. TESTED: Ran the full set of regression tests, with both default and acceptably shortened WRITE_PAD. Also verified that a zero value causes trouble (OSX), and that adding -S to the zero value makes it work. Signed-off-by: Jon Schlueter <jon.schlueter@gmail.com>
* Fixes gpsfake -v to use stderr instead of stdout.Fred Wright2016-02-291-1/+1
| | | | | | | TESTED: Ran a quick gpsfake -v with >/dev/null, and observed output. Signed-off-by: Jon Schlueter <jon.schlueter@gmail.com>
* Add more startup delay in gpsfake, and explain why.Eric S. Raymond2016-02-091-1/+5
| | | | | Part of a the isync patch series from Michael Brown <mbrown@fensystems.co.uk>, which failed to apply properly and had to be hand-atched a bit.
* Change Python hashbang lines to invoke 'python2'Eric S. Raymond2015-07-191-1/+1
| | | | | | We've learned that Ubuntu 15.10 will have python3 as default. The ugly transition gas befun; our only recourse is to hape that all our deployment targets have 'pyton2' do the right thing. Works on 14.10.
* gpsfake: pylint cleanup. Regression tests (using gpsfake) pass.Eric S. Raymond2015-02-221-1/+1
|
* gpsfake code fell out of sync with documentation. Fix this.Eric S. Raymond2015-02-131-1/+1
| | | | All regression tests pass.
* pylint cleanup in gpsfake for superfluous-parensJon Schlueter2015-02-131-21/+21
| | | | in python you don't need parens around values for if elseif statements
* more pep8 cleanup in gpsfake for whitespaceJon Schlueter2015-02-131-3/+6
| | | | whitespace around operators and before function delcarations
* pep8 cleanup in gpsfakeJon Schlueter2015-02-131-1/+1
| | | | use "is None" instead of ""== None"
* Split up imports in gpsfake and remove unusedJon Schlueter2015-02-131-2/+10
| | | | random was imported but never used
* Revert "Significantly speed up testing."Eric S. Raymond2015-02-131-4/+7
| | | | It creates a race condition.
* Significantly speed up testing.Eric S. Raymond2015-02-131-7/+4
| | | | | | A delay in gpsfake is replaced by a watch for acknowledgment. All regression tests pass.
* Fix inexpplicably corrupted Python code.Eric S. Raymond2015-02-131-2/+2
|
* Don't allocate a private port when cycling logs for client testing.Eric S. Raymond2015-02-131-0/+4
| | | | All regression tests pass.
* Change the way EOF is injected in hopes of beating a *BSD timing problem.Eric S. Raymond2015-02-111-1/+1
| | | | All regression tests pass.
* CLOSE_DELAY is gone. Test source termination is now deterministic.Eric S. Raymond2015-02-091-1/+1
| | | | All regression tests pass.
* In the test framework, use the bind-to-port-0 trick to get a random unused port.Eric S. Raymond2015-02-021-13/+1
| | | | | | This makes the -f option of gpsfake obsolete, and it has been removed. All regression tests pass.
* Open ttys with CLOCAL, following a suggestion by Hal Murray.Eric S. Raymond2015-02-021-1/+1
| | | | | | Also, zero in on shorter delays in the regression tests. All regression tests pass.
* Use %.3f for WRITE_PAD, because 0.004 is a typical value.Greg Troxel2015-01-271-1/+1
|
* Fix an erroneous format literal.Eric S. Raymond2015-01-271-1/+1
|
* Print sys.platform and platform.platform().Greg Troxel2015-01-251-1/+1
| | | | | They are different! This code printed one, and the if statement in gps/fake.py used the other.
* Dump platform ID and delay parameters before doing test runs.Eric S. Raymond2015-01-251-2/+5
|