History log of /fuchsia/zircon/system/uapp/runtests/runtests.cpp
Revision Date Author Comments
# 556852df 24-Jul-2018 Gary Miguel <garymm@google.com>

[runtests] Accept a file path that specifies tests to run.

Also rename a few things for clarity.

Test: unit tests, manually tested with "runtests -f" on my linux host,
manually tested with no args on Fuchsia, which ran all tests in garnet,
and CQ will run runtests on all tests in Zircon.
Bug: IN-478 #comment
Bug: IN-527 #comment
Change-Id: I6f1485125130dadb70cefa921d80385aa0b1de33


# 29fb0bfa 05-Jul-2018 Benjamin Lerman <qsr@chromium.org>

[zx] Add new API for zx::time

This also change zx::clock to be a class instead of a namespace, because
nested namespaces are banned.

TEST=Everything still compiles, tests still pass.

Change-Id: I954558aaaed554fe088c11ff7bbc7d914eebdf6f


# 2d54b055 04-Jul-2018 Benjamin Lerman <qsr@chromium.org>

[zx] Prepare to use typed clock for zx::time

This CL introduces zx::base_time, zx::time_utc and zx::time_thread as
alias to zx::time.

It also introduces a new templated factory method to produce
zx::base_time.

This is in preparation for the time type to be different depending on
the clock used. After this CL, clients will be able to use both the
current API, as well as the typed API. When all clients have migrated to
the new API, the old API will be removed and the time types will be
enforced.

TEST=Everything still compiles

ZX-2338

Change-Id: I3b6f4eced5df23b8dc4b1310bd8d0a89291b07a8


# cace36ee 18-Jun-2018 Joshua Seaton <joshuaseaton@google.com>

[runtests] Add /pkgfs/packages/*/*/test to the default globs.

BUG: IN-478
Change-Id: I47a624927e8eab33de5522565632d8841abb440b


# 8ebaf8a7 15-Jun-2018 Joshua Seaton <joshuaseaton@google.com>

[runtests] Create host version of runtests.

-Abstract the current runtests main() as a library method.
-Invoke with platform specific choices for
system/uapp/runtests/runtests.cpp
and
system/host/runtests/runtests.cpp

TESTED: runtests-utils-test passes as a host test; host runtests tested
by hand.

BUG: IN-358
Change-Id: Ic9bf53e4418e37d9856a5857b673f5cbd1fe2d4d


# 455b4bbf 01-Jun-2018 Gary Miguel <garymm@google.com>

[runtests] Use relative path for syslog in summary JSON.

The recipe code expects all paths in the summary JSON to be relative to
the output dir. This also makes it consistent with the per-test outputs
mentioned in that file.
Also the file from "syslogs" to "syslog.txt":
* Most of the code refers to it using the singular form, so remove the
s for consistency.
* Added .txt extension, to indicate its contents are plain text.

Bug: INTK-364 #comment
Change-Id: I39972318bac954429465860103f2be1110f7ddca


# 990b5b89 24-May-2018 Joshua Seaton <joshuaseaton@google.com>

[runtests] Prepare runtests tests for cross-platform implementation.

Once we have a host implementation of 'RunTest', the existing suite of
tests will easily be made into a host test target.

BUG: IN-358

Change-Id: Icada7deb475832e3b666f654f2515d01c07a3d36


# b4404bdb 18-May-2018 Ankur Mittal <anmittal@google.com>

[runtests] Add support for reading syslogs.

IN-320 #progress

Change-Id: Icac7a0d5d8d877d444f064f0f8b5a48f12563fdc


# f50bd8d0 22-May-2018 Carlos Pizano <cpu@google.com>

[zircon][clean-api] process return code

To have explicit size, in this case int64_t

Change-Id: I9d5bc3d5564787bd5a6146ae952126f6f856db7b


# e2b0adf1 15-May-2018 Gary Miguel <garymm@google.com>

[runtests] Move most code into runtests-utils and test it.

Use C++ features (rather than pure C) where possible to make
code cleaner.

Change in testing tactics:
Previously the test used its own path as the executable to be used for
testing. Switched to writing shell scripts to MemFS.
This is more flexible; it allows putting binaries in arbitrary
directories.
I think it's also more readable.

Bug: IN-223 #done
Change-Id: I66b31bf129e77be704361275a37cbdd8df9db672


# 67454463 10-May-2018 Gary Miguel <garymm@google.com>

[runtests] Make unit test not depend on external binaries.

In order to do this I changed the interface to allow the caller to
specify the entirety of argv. I think the benefit in testability is
worth the slight added interface complexity.

Bug: IN-223
Change-Id: I6d5a7f0a17d335f90eddf108b7b0acc9ae596768


# 52b171f1 09-May-2018 Doug Evans <dje@google.com>

[uapp][runtests] Ignore directories with last component "helper"

Change-Id: I830e224293beb9c3e64b9e7893353db26ec3f7b1


# a7648ae2 08-May-2018 Gary Miguel <garymm@google.com>

[runtests] More C to C++.

Main changes:
* CamelCase instead of snake_case names, in accordance with our C++
style guide.
* Use fbl::Vector instead of list_node.
* Use fbl::MakeAutoCall and objects that clean themselves up on
destruction instead of "goto fail".
* Potential bug fix: check if get_info() return val != ZX_OK, rather
than previously checking if it was negative.
* Behavior improvement: insert a TestRun into the tests vector for all
failure modes. Previously we would only do this if we got to
launchpad_go(). There's no reason for the result to not be saved if
the failure comes earlier than that.

Bug: IN-223
Change-Id: Ib6cce2682c1ed5b2d15c13d5c193558eae2f8e88


# 299b9d4f 07-May-2018 Gary Miguel <garymm@google.com>

[runtests] Move some of runtests into a library.

Add unit tests for the library.
Unit tests are not exhaustive because AFAIK there's no existing
way to control the behavior of launchpad in unit tests.

Changes to the actual code are minimal because:
* I want to have the tests in place before making any more changes
* To keep this change conceptually focused on just a few things
(moving code + adding testing).

Future changes will make the code take advantage of more C++ features.

Bug: IN-223
Change-Id: I29a8c43e8b96db56b07f84e8f5a00cb6bd232690


# 6c8cb958 03-May-2018 Doug Evans <dje@google.com>

[uapp][runtest] Fix bug in parsing of -w option

Change-Id: Ia22b4d9252ec6b1029933a21699852609a9add6f


# dd70ee53 01-May-2018 Joshua Seaton <joshuaseaton@google.com>

[runtests] Upgrade runtests to use zx::time

Moreover, inclusions were re-organized to have the C standard library
headers in one block, followed by Zircon headers in another.

BUG: IN-223
Change-Id: I0ccfbdc62232eb39fe87b926195c3d68be501d43


# 3db66cce 23-Apr-2018 Doug Evans <dje@google.com>

[ulib][unittest] Add watchdog timer

If the timer goes off before the test completes then the process is terminated.

A new option --w <seconds> is added to runtests to set the timeout.
A value of zero disables the timeout.

This is passed to tests via the RUNTESTS_WATCHDOG_TIMEOUT env var.

New -w option manually tested with:
$ runtests -w
$ runtests -w ""
$ runtests -w -1
$ runtests -w 123foo
$ runtests -w 2147483648
$ runtests -w 0x80000000
All flag an error as expected, and these work:
$ runtests -w 2147483647
$ runtests -w 0x7fffffff
And this works and triggers timeouts:
$ runtests -w 2

ZX-2018 #done

Change-Id: Ia9bc9e29ce93da3973ac58f63393096b5c836d37


# 51aee8c4 25-Apr-2018 Gary Miguel <garymm@google.com>

[runtests] Convert runtests to C++.

Motivation:
* Immediate: More type safety.
* Future: Many useful language features.
* Future: Many useful libraries such as fbl.

Bug: IN-223
Change-Id: I375b69fe4c45d48954c79212408f1c5dcfef2b75