History log of /fuchsia/zircon/system/ulib/unittest/all-tests.cpp
Revision Date Author Comments
# 3c0c8f63 02-May-2018 Doug Evans <dje@google.com>

[unittest] Use different timeouts for different test types

Small tests shouldn't have the same timeout as large tests.
So we need a way to have different values per test type.
Plus IWBN to override the default timeouts with one value
instead of one for each test type.

This patch accomplishes both by retasking the timeout value
specified by the user as the "base timeout", and then each
test type's timeout is a multiple of that.

The current values are still pretty conservative until the bots
specify a timeout more suited for them (INTK-312).
Plus there are outliers (ZX-2103, ZX-2107) that needed to be handled.
Fortunately there aren't many.

ZX-2104 #comment patch

Change-Id: Ie90ac09a35b5abf616cf2b4e3d36e9e90febe5af


# 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


# 65476f1d 24-Apr-2018 Doug Evans <dje@google.com>

[ulib][unittest] Include env vars in help output

Change-Id: Ie203bcc1226a5cc4d2b5460eca56d80691056175


# 6c728f51 23-Apr-2018 Doug Evans <dje@google.com>

[ulib][unittest] Add unittest_register_test_help_printer

Change-Id: Ibae04c90892ada88692f01baa39362788bb9d17a


# 929916e1 24-Apr-2018 Doug Evans <dje@google.com>

[ulib][unittest] Add better error messages

... for missing args to --case and --test.

Change-Id: Ic658daf8009828c0a5d126293fbabb15ada041d9


# 25140274 24-Apr-2018 Doug Evans <dje@google.com>

[ulib][unittest] Fix returned value in unittest_run_all_tests

Change-Id: Ia270f1da598131f9d6a7f2c20ae1bdb54d66815c


# 1b31c350 30-Jan-2018 Tricia Landers <planders@google.com>

[sparse] Add blobstore/minfs to sparse file with generic type

Additionally update the fvm-host tests to test this type

Change-Id: I33fab26f7ced5035fe714db6be66161411e4e7ae


# 965290ed 27-Jan-2018 Sean Klein <smklein@google.com>

[unittest] Make '--case' and '--test' arguments explicit, ignore others

Some of our tests (including fs-tests and blktest) use the
"unittest_run_all_tests" function to execute tests using the
standard Zircon test environment, but permit additional arguments
to allow testing additional functionality.

For example, "fs-tests" and "blktest" both allow passing a "-d"
argument to run tests on a real block device, instead of
a ramdisk.

This patch updates ulib/unittest to:
1) Only use the "--case" and "--test" arguments if they are
provided explicitly.
2) Ignore all other parameters (like the "-d" argument).

ZX-1623 #done

Change-Id: I39e10388ccb0c6252b92c2324bc99c64e7083989


# 0728e073 26-Jan-2018 Brett Wilson <brettw@chromium.org>

[tests] Convert unittest library to C++ source.

Run clang-format. NULLs, casts, and some typedefs were updated, but otherwise the
code change should be minimal.

This preserves C compat in the headers and doesn't use any C++ library functions.

Change-Id: I0ac80611bbaf9c0b9adfed65f6ad6fb22afea461