diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2022-06-15 17:09:55 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2022-06-15 18:27:22 -0500 |
commit | 223606fcd02e6d15e065d1e108e17c8848d35f9f (patch) | |
tree | 577b3187354582fd2c1c8edcbd8e16ac86624b87 /src/libs | |
parent | c4090531d4caac4b8cb3356cb971ff2e1c9f8704 (diff) | |
download | wix-223606fcd02e6d15e065d1e108e17c8848d35f9f.tar.gz wix-223606fcd02e6d15e065d1e108e17c8848d35f9f.tar.bz2 wix-223606fcd02e6d15e065d1e108e17c8848d35f9f.zip |
Update some skipped tests to be dynamically skipped.
Diffstat (limited to 'src/libs')
-rw-r--r-- | src/libs/dutil/test/DUtilUnitTest/DUtilTests.cpp | 42 |
1 files changed, 35 insertions, 7 deletions
diff --git a/src/libs/dutil/test/DUtilUnitTest/DUtilTests.cpp b/src/libs/dutil/test/DUtilUnitTest/DUtilTests.cpp index 70e5a256..5e2d69e1 100644 --- a/src/libs/dutil/test/DUtilUnitTest/DUtilTests.cpp +++ b/src/libs/dutil/test/DUtilUnitTest/DUtilTests.cpp | |||
@@ -5,26 +5,49 @@ | |||
5 | using namespace System; | 5 | using namespace System; |
6 | using namespace Xunit; | 6 | using namespace Xunit; |
7 | using namespace WixBuildTools::TestSupport; | 7 | using namespace WixBuildTools::TestSupport; |
8 | using namespace WixBuildTools::TestSupport::XunitExtensions; | ||
8 | 9 | ||
9 | namespace DutilTests | 10 | namespace DutilTests |
10 | { | 11 | { |
12 | [Collection("Dutil_TraceErrorSource")] | ||
11 | public ref class DUtil | 13 | public ref class DUtil |
12 | { | 14 | { |
13 | public: | 15 | public: |
14 | [Fact(Skip="Flaky")] | 16 | [SkippableFact] |
15 | void DUtilTraceErrorSourceFiltersOnTraceLevel() | 17 | void DUtilTraceErrorSourceFiltersOnTraceLevel() |
16 | { | 18 | { |
17 | DutilInitialize(&DutilTestTraceError); | 19 | DutilInitialize(&DutilTestTraceError); |
18 | 20 | ||
19 | CallDutilTraceErrorSource(); | 21 | try |
22 | { | ||
23 | CallDutilTraceErrorSource(); | ||
20 | 24 | ||
21 | Dutil_TraceSetLevel(REPORT_DEBUG, FALSE); | 25 | Dutil_TraceSetLevel(REPORT_DEBUG, FALSE); |
22 | 26 | ||
23 | Action^ action = gcnew Action(this, &DUtil::CallDutilTraceErrorSource); | 27 | Exception^ traceErrorException = nullptr; |
24 | // See the comments in WixBuildTools.WixAssert for details. | ||
25 | WixAssert::Throws<Exception^>(action); | ||
26 | 28 | ||
27 | DutilUninitialize(); | 29 | try |
30 | { | ||
31 | CallDutilTraceErrorSource(); | ||
32 | } | ||
33 | catch (Exception^ e) | ||
34 | { | ||
35 | traceErrorException = e; | ||
36 | } | ||
37 | |||
38 | if (traceErrorException == nullptr) | ||
39 | { | ||
40 | WixAssert::Skip("Dutil_TraceErrorSource did not call the registered callback."); | ||
41 | } | ||
42 | else | ||
43 | { | ||
44 | WixAssert::StringEqual("hr = 0x80004005, message = Error message", traceErrorException->Message, false); | ||
45 | } | ||
46 | } | ||
47 | finally | ||
48 | { | ||
49 | DutilUninitialize(); | ||
50 | } | ||
28 | } | 51 | } |
29 | 52 | ||
30 | private: | 53 | private: |
@@ -33,4 +56,9 @@ namespace DutilTests | |||
33 | Dutil_TraceErrorSource(__FILE__, __LINE__, REPORT_DEBUG, DUTIL_SOURCE_EXTERNAL, E_FAIL, "Error message"); | 56 | Dutil_TraceErrorSource(__FILE__, __LINE__, REPORT_DEBUG, DUTIL_SOURCE_EXTERNAL, E_FAIL, "Error message"); |
34 | } | 57 | } |
35 | }; | 58 | }; |
59 | |||
60 | [CollectionDefinition("Dutil_TraceErrorSource", DisableParallelization = true)] | ||
61 | public ref class Dutil_TraceErrorSourceCollectionDefinition | ||
62 | { | ||
63 | }; | ||
36 | } | 64 | } |