Skip to content

Commit

Permalink
[vcpkg] Small touchups for vcpkg unit tests (#11068)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
horenmar committed Apr 29, 2020
1 parent ce8b01a commit 6ef805c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion toolsrc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions toolsrc/src/vcpkg-test/optional.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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});
}

Expand Down

0 comments on commit 6ef805c

Please sign in to comment.