Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix invalid WORKING_DIRECTORY for tests #870

Merged
merged 1 commit into from
Feb 13, 2023
Merged

Conversation

phprus
Copy link
Contributor

@phprus phprus commented Aug 8, 2022

Description

Fix invalid WORKING_DIRECTORY for tests and multi-config CMake Generator (like Microsoft Visual Studio).

In a multi-configuration environment, the ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} variable may not correspond to the actual directory where the executables will be.

Error:

      Test #137: test_malloc_overload_disable .............***Failed    0.03 sec
'test_malloc_overload_disable.exe' is not recognized as an internal or external command,
operable program or batch file.
[doctest] doctest version is "2.4.7"
[doctest] run with "--help" for options
Test error: unable to run the command: test_malloc_overload_disable.exe

...

The following tests FAILED:
	137 - test_malloc_overload_disable (Failed)

See:

https://github.com/oneapi-src/oneTBB/blob/323260671b40db33c9fc0d66d1f1eed6ecc82ce2/CMakeLists.txt#L156-L172

Fixes # - issue number(s) if exists

  • - git commit message contains an appropriate signed-off-by string (see CONTRIBUTING.md for details)

Type of change

Choose one or multiple, leave empty if none of the other choices apply

Add a respective label(s) to PR if you have permissions

  • bug fix - change that fixes an issue
  • new feature - change that adds functionality
  • tests - change in tests
  • infrastructure - change in infrastructure and CI
  • documentation - documentation update

Tests

  • added - required for new features and some bug fixes
  • not needed

Documentation

  • updated in # - add PR number
  • needs to be updated
  • not needed

Breaks backward compatibility

  • Yes
  • No
  • Unknown

Notify the following users

List users with @ to send notifications

Other information

@phprus
Copy link
Contributor Author

phprus commented Sep 14, 2022

ping?

@phprus
Copy link
Contributor Author

phprus commented Oct 1, 2022

Rebased onto current master.

@phprus
Copy link
Contributor Author

phprus commented Nov 5, 2022

Rebased

@pavelkumbrasev
Copy link

Hi @phprus, how to reproduce this problem?

@phprus
Copy link
Contributor Author

phprus commented Nov 16, 2022

@pavelkumbrasev

I apologize for the delay and incorrect commands in the deleted comment.

See CI results for commit phprus@dddd550
For example: https://github.com/phprus/oneTBB/actions/runs/3481119210/jobs/5821796042

      Test #137: test_malloc_overload_disable .............***Failed    0.02 sec
'test_malloc_overload_disable.exe' is not recognized as an internal or external command,
operable program or batch file.
[doctest] doctest version is "2.4.7"
[doctest] run with "--help" for options
Test error: unable to run the command: test_malloc_overload_disable.exe

Or local:

cmake -G "Visual Studio 16 2019" -A x64 -T v142 ../..
cmake --build . --config Release
ctest -C Release --output-on-failure

Error:

137/138 Test #137: test_malloc_overload_disable .............***Failed    0.04 sec
"test_malloc_overload_disable.exe" ?? ????? ???????? ??? ?????
????????, ??????? ?????? ??? ?????? ????.
[doctest] doctest version is "2.4.7"
[doctest] run with "--help" for options
Test error: unable to run the command: test_malloc_overload_disable.exe

@phprus
Copy link
Contributor Author

phprus commented Nov 25, 2022

Ping?

@phprus
Copy link
Contributor Author

phprus commented Dec 13, 2022

@pavelkumbrasev, @isaevil what do you think about this PR?

@isaevil
Copy link
Contributor

isaevil commented Dec 14, 2022

@phprus I don't quite like the idea that we are actually bypassing the value of RUNTIME_OUTPUT_DIRECTORY because right now we have a single control point at root CMakeLists.txt. RUNTIME_OUTPUT_DIRECTORY can use generator-expressions. Maybe we can just use generator-expression like you did at root CMake file where RUNTIME_OUTPUT_DIRECTORY is set? What do you think?

@phprus
Copy link
Contributor Author

phprus commented Dec 14, 2022

@isaevil
RUNTIME_OUTPUT_DIRECTORY supports generator expressions since CMake 3.4.
We can create the TBB_TEST_WORKING_DIRECTORY variable in the root CMakeLists.txt.

I will update the PR a bit later...

@isaevil
Copy link
Contributor

isaevil commented Dec 14, 2022

@isaevil RUNTIME_OUTPUT_DIRECTORY supports generator expressions since CMake 3.4. We can create the TBB_TEST_WORKING_DIRECTORY variable in the root CMakeLists.txt.

I will update the PR a bit later...

We can also use RUNTIME_OUTPUT_DIRECTORY_<CONFIG>.

@phprus
Copy link
Contributor Author

phprus commented Dec 14, 2022

…tor (like Microsoft Visual Studio).

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
@phprus
Copy link
Contributor Author

phprus commented Jan 10, 2023

@pavelkumbrasev, @isaevil ping?

Rebased and changed copyright year in files.

@isaevil isaevil merged commit 9bd4d06 into uxlfoundation:master Feb 13, 2023
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.

3 participants