As Mats already pointed out you cannot filter from the scons script. Once they
are built you can run them individually.
This sometimes means tracking down the location of the unit test they are
placed all over the output folder.
Then you can use the --gtest_filter option to selectively turn on or off tests.
Example:
$ export LD_LIBRARY_PATH=<the out folder on you system>
$ cd out/linux/x86_64/debug/resource/csdk/stack/test # <-- as an example
$ ./stacktest --gtest_filter=OCIpv6* # will only run the tests that start with
OCIpv6
$ ./stacktest
--gtest_filter=-*StackStartSuccessClient:*CreateResrouceWithClientStackMode #
run all but the two tests listed (':' is a separator) note the '-' minus sign
at the start.
$ ./stacktest --gtest_filter=*DISABLED* --gtest_also_run_disabled_tests # run
tests that have been disabled in the code.
Google test give a lot of control over what you run and don't run using a lot
of command line options. Run the test with `-h` option to see more options
google test options.
Hope this helps
George
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Steve Saunders
(CableLabs)
Sent: Tuesday, October 3, 2017 2:00 PM
To: Mats Wichmann <[email protected]>
Cc: [email protected]
Subject: Re: [dev] Selectively turn unit tests on/off
Greetings Matt,
Thanks for taking time to respond.
in stacktest.cpp, I have found that if I change SHORT_TEST_TIMEOUT =
std::chrono::seconds(5) to (55), that test does not bail.
But that may be too much of a cheat :)
Cheers!
Steve
> On Oct 3, 2017, at 2:56 PM, Mats Wichmann <[email protected]> wrote:
>
> On 10/03/2017 01:30 PM, Steve Saunders (CableLabs) wrote:
>> Hi All,
>>
>> I am tracking down some out of memory problems, and I am hoping there is an
>> easy way to enable/disable particular unit tests.
>>
>> Is there a master config file etc, that I can use to easily turn on / off
>> unit tests?
>>
>> Thanks
>> Steve
>> CableLabs
>
> No.
>
> It's pretty crude at the moment; if a unittest sconscript contains a
> run_tests() call, it will run the tests if TEST=1. If the second
> argument to run_tests() is not an empty string, the function will take
> that as a filename to store results in and run the test under control
> of valgrind (on linux only). Neither are controllable without editing
> the individual scons scripts.
>
> I have some improvements in the pipeline, but not a selective
> run/don't run option.
>
> However, once things have built, you can manually run any one of the
> tests from a command line. You'll have to set LD_LIBRARY_PATH first.
>
> One of the tests doesn't seem to work reliably on any Linux system
> except the very old Ubuntu 12.04 that the Jenkins builders, and
> possibly some developers, still use. That is the one that ends up at:
>
> out/linux/x86_64/debug/resource/csdk/stack/test/stacktests
>
> if you fix that one you'll get a gold star :)
>
_______________________________________________
iotivity-dev mailing list
[email protected]
https://lists.iotivity.org/mailman/listinfo/iotivity-dev
_______________________________________________
iotivity-dev mailing list
[email protected]
https://lists.iotivity.org/mailman/listinfo/iotivity-dev