[vcpkg] Small touchups for vcpkg unit tests (#11068)

* Do not disable expression decomposition in some optional tests

The tests are trivial enough that it is unlikely to come useful,
but the old usage is bad practice.

* Run tests in random order

This should prevent committing tests that are run-order dependent,
or at least shake them out eventually in CI.
This commit is contained in:
Martin Hořeňovský 2020-04-29 21:00:50 +02:00 committed by GitHub
parent ce8b01a14b
commit 6ef805c2a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -120,7 +120,7 @@ if (BUILD_TESTING)
enable_testing()
add_executable(vcpkg-test ${VCPKGTEST_SOURCES} $<TARGET_OBJECTS:vcpkglib>)
add_test(NAME default COMMAND vcpkg-test)
add_test(NAME default COMMAND vcpkg-test --order rand --rng-seed time)
if (VCPKG_BUILD_BENCHMARKING)
target_compile_options(vcpkg-test PRIVATE -DCATCH_CONFIG_ENABLE_BENCHMARKING)

View File

@ -19,9 +19,9 @@ TEST_CASE ("equal", "[optional]")
using vcpkg::Optional;
CHECK(Optional<int>{} == Optional<int>{});
CHECK(!(Optional<int>{} == Optional<int>{42}));
CHECK(!(Optional<int>{42} == Optional<int>{}));
CHECK(!(Optional<int>{1729} == Optional<int>{42}));
CHECK_FALSE(Optional<int>{} == Optional<int>{42});
CHECK_FALSE(Optional<int>{42} == Optional<int>{});
CHECK_FALSE(Optional<int>{1729} == Optional<int>{42});
CHECK(Optional<int>{42} == Optional<int>{42});
}