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

Initialize cpp test with gtest and github action #13

Merged
merged 10 commits into from
Apr 22, 2022
Merged

Initialize cpp test with gtest and github action #13

merged 10 commits into from
Apr 22, 2022

Conversation

ZenoTan
Copy link
Member

@ZenoTan ZenoTan commented Apr 21, 2022

No description provided.

Copy link
Contributor

@yaoyaowd yaoyaowd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a little search on how other open source project organize repos with c++ code. I think we should change the directory a little bit to

cmake
pyg_lib
  csrc
    // different packages.
    // for each package, we can put *.h, *.cc together.
    pyg
      library.h
      library.cc
test

I think it is similar to how pytorch organize their code. WDYT?

pyg_lib/test/cpp/test_cuda_version.cpp Outdated Show resolved Hide resolved
@rusty1s rusty1s requested a review from yaoyaowd April 22, 2022 05:36
@rusty1s
Copy link
Member

rusty1s commented Apr 22, 2022

@yaoyaowd
Copy link
Contributor

Yes, I think what you originally planned make sense to me. This PR changed the organization a little bit. We can move cmake and test to top level directory. And we can put cc file and h file together in the csr directory or different packages in csr directory.
I see separate header in include directory in other projects but I think for this one we should follow the pytorch family style.

@ZenoTan
Copy link
Member Author

ZenoTan commented Apr 22, 2022

Yes, I think what you originally planned make sense to me. This PR changed the organization a little bit. We can move cmake and test to top level directory. And we can put cc file and h file together in the csr directory or different packages in csr directory. I see separate header in include directory in other projects but I think for this one we should follow the pytorch family style.

I will try to follow the torch style

@rusty1s rusty1s added the test label Apr 22, 2022
CMakeLists.txt Outdated
@@ -5,6 +5,8 @@ set(PYG_VERSION 0.0.0)

option(WITH_CUDA "Enable CUDA support" OFF)
option(USE_PYTHON "Link to Python when building" ON)
option(BUILD_TEST "Enable testing" ON)
option(TEST_WITH_CUDA "CUDA testing" OFF)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this here? IMO, WITH_CUDA is already sufficient.

CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated
@@ -31,3 +35,11 @@ endif()
set_target_properties(${PROJECT_NAME} PROPERTIES
EXPORT_NAME PyG
INSTALL_RPATH ${TORCH_INSTALL_PREFIX}/lib)

IF(TEST_WITH_CUDA)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is safe to drop. Let me know if you disagree.

test/cpp/test_cuda_version.cpp Outdated Show resolved Hide resolved
test/cpp/test_cuda_version.cpp Outdated Show resolved Hide resolved
Copy link
Member

@rusty1s rusty1s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also add some quick documentation on how to build and test in CONTRIBUTING.md? Just a few code lines are sufficient.

cmake/test.cmake Outdated Show resolved Hide resolved
ZenoTan and others added 3 commits April 22, 2022 17:37
Co-authored-by: Matthias Fey <matthias.fey@tu-dortmund.de>
Co-authored-by: Matthias Fey <matthias.fey@tu-dortmund.de>
Co-authored-by: Matthias Fey <matthias.fey@tu-dortmund.de>
ZenoTan and others added 2 commits April 22, 2022 17:48
Co-authored-by: Matthias Fey <matthias.fey@tu-dortmund.de>
@rusty1s
Copy link
Member

rusty1s commented Apr 22, 2022

It looks like we need to move the test file now (no tests found reported :))

@rusty1s rusty1s changed the title Initialize cpp test with gtest and github action Initialize cpp test with gtest and github action Apr 22, 2022
@ZenoTan ZenoTan merged commit d20c0e8 into master Apr 22, 2022
@ZenoTan ZenoTan deleted the gtest branch April 22, 2022 17:20
@rusty1s rusty1s mentioned this pull request Apr 25, 2022
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants