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

Add support for building the tests with CMake #1043

Closed
wants to merge 2 commits into from

Conversation

Naios
Copy link
Contributor

@Naios Naios commented Sep 17, 2023

Requires a present bake repository in test/ or in a path set via BAKE_REPOSITORY

You can then also add CTest to the github workflow:

cmake -DFLECS_TESTS=ON -DBAKE_REPOSITORY="${PATH_TO_BAKE_REPOSITORY}" .......

ctest -C Debug --verbose

Runs the tests single-threaded in MSVC

Ref #1036

@Naios Naios force-pushed the cmake_test branch 2 times, most recently from 40e9998 to ee66fa6 Compare September 17, 2023 14:52
@SanderMertens
Copy link
Owner

I just tried this out locally, am getting the following error:

~/GitHub/SanderMertens/flecs$ cmake -DFLECS_TESTS=ON -DBAKE_REPOSITORY=~/GitHub/SanderMertens/bake
CMake Warning:
  No source or binary directory provided.  Both will be assumed to be the
  same as the current working directory, but note that this warning will
  become a fatal error in future CMake releases.


-- The C compiler identification is AppleClang 15.0.0.15000040
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- The CXX compiler identification is AppleClang 15.0.0.15000040
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at test/CMakeLists.txt:8 (message):
  The CMake tests require a bake repository at
  '/Users/sandermertens/GitHub/SanderMertens/flecs/test/bake'.

Looks like it's ignoring the argument:

The CMake tests require a bake repository at
'/Users/sandermertens/GitHub/SanderMertens/flecs/test/bake'

@SanderMertens
Copy link
Owner

Ah, it should be BAKE_DIRECTORY

@SanderMertens
Copy link
Owner

Can you add this to the end of .github/workflows/ci.yml?

test-cmake:
    needs: [ build-linux ]
    runs-on: ${{ matrix.os }}
    timeout-minutes: 30
    strategy:
      fail-fast: false
      matrix:
        os: [ ubuntu-latest ]

    steps:
      - uses: actions/checkout@v3
      - name: clone bake
        run: |
          git clone https://github.com/SanderMertens/bake

      - name: build flecs & tests
        run: |
          cmake -DFLECS_TESTS=ON -DBAKE_DIRECTORY=bake
          make -j 8

      - name: run tests
        run: |
          ctest -C Debug --verbose

@Naios
Copy link
Contributor Author

Naios commented Sep 21, 2023

I have updated it accordingly. But I dont have time currently, to fix any resulting build failures.
Maybe it would be a good start to allow the build to fail and keep the support experimental.

@SanderMertens
Copy link
Owner

I couldn't push to this PR, so I branched off and created a new one to add the CI tests. Thanks for the PR!

@Naios
Copy link
Contributor Author

Naios commented Oct 1, 2023

Thank you for merging.

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.

2 participants