Skip to content

Convert all tests to use TIMED_TEST_SUITE_INITIALIZE/CLEANUP#546

Open
parth21999 wants to merge 9 commits intomasterfrom
paaggarwal/add-timed-test-suite-to-all-tests
Open

Convert all tests to use TIMED_TEST_SUITE_INITIALIZE/CLEANUP#546
parth21999 wants to merge 9 commits intomasterfrom
paaggarwal/add-timed-test-suite-to-all-tests

Conversation

@parth21999
Copy link
Member

Converts all test files from TEST_SUITE_INITIALIZE/CLEANUP to TIMED_TEST_SUITE_INITIALIZE/CLEANUP using the existing timed_test_suite.h from master.

Changes:

  • 90 .c files: macro replacement
  • 62 PCH files: added c_pal/timed_test_suite.h (before ENABLE_MOCKS)
  • 35 int/perf .c files: added c_pal/timed_test_suite.h

This PR uses the master version of timed_test_suite.h (no testrunnerswitcher changes required).

Replace TEST_SUITE_INITIALIZE/CLEANUP with TIMED_TEST_SUITE_INITIALIZE/
TIMED_TEST_SUITE_CLEANUP across all test files. Add c_pal/timed_test_suite.h
to PCH files (before ENABLE_MOCKS) and integration test files.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@parth21999
Copy link
Member Author

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Tests using TIMED_TEST_SUITE_INITIALIZE need to link against c_pal
for the process_watchdog_init/deinit implementations.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@parth21999
Copy link
Member Author

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@parth21999
Copy link
Member Author

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@parth21999
Copy link
Member Author

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

…_util_ut

These tests include timed_test_suite.h which needs c_pal/process_watchdog.h.
Without c_pal in ADDITIONAL_LIBS, the include path is not available.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@parth21999 parth21999 force-pushed the paaggarwal/add-timed-test-suite-to-all-tests branch from 17ce93c to 4041ef7 Compare March 5, 2026 00:50
@parth21999
Copy link
Member Author

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Repo validation requires all source files to end with CRLF newline.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@parth21999 parth21999 force-pushed the paaggarwal/add-timed-test-suite-to-all-tests branch from f5f90e9 to 0ec1371 Compare March 5, 2026 21:44
@parth21999
Copy link
Member Author

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@parth21999
Copy link
Member Author

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

The TIMED_TEST_SUITE macros call process_watchdog_init/deinit, which
internally use interlocked functions. In unit tests, interlocked is
mocked, causing crashes when the watchdog runs during suite cleanup
after umock is torn down.

Fix: add real_process_watchdog reals and include the renames in
timed_test_suite.h so the watchdog always uses real (non-mocked)
implementations of its dependencies.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@parth21999 parth21999 force-pushed the paaggarwal/add-timed-test-suite-to-all-tests branch from 1f07822 to 1c19738 Compare March 6, 2026 04:46
@parth21999
Copy link
Member Author

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

The renames header must be on the same include path as timed_test_suite.h
so all test targets can find it, not just those linking win32_reals.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@parth21999
Copy link
Member Author

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@parth21999
Copy link
Member Author

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

The renames header is always unconditional (for use by real_.c files),
but timed_test_suite.h only includes it when UMOCK_C_H is defined,
i.e. in unit tests with mocks. Integration tests call process_watchdog
directly without going through reals.

Also fix include order in 3 PCH files where timed_test_suite.h was
included before umock_c.h.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@parth21999
Copy link
Member Author

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@parth21999
Copy link
Member Author

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Make the real_process_watchdog renames unconditional in timed_test_suite.h
and add c_pal_reals to ADDITIONAL_LIBS in all 48 test CMakeLists.txt that
were missing it. This ensures real_process_watchdog_init/deinit are always
available regardless of whether the test is a unit test or integration test.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@parth21999
Copy link
Member Author

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant