Skip to content

Conversation

@yungyuc
Copy link
Member

@yungyuc yungyuc commented Oct 29, 2022

No description provided.

@yungyuc yungyuc added the test testing and continuous integration label Oct 29, 2022
@yungyuc yungyuc self-assigned this Oct 29, 2022
Copy link
Member Author

@yungyuc yungyuc left a comment

Choose a reason for hiding this comment

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

Increase clang-tidy coverage by moving from the Python-only extension to viewer.

run: make cinclude

- name: make buildext
- name: make viewer
Copy link
Member Author

Choose a reason for hiding this comment

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

Build the viewer binary

${JOB_MAKE_ARGS} \
CMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} \
CJOB_MAKE_ARGS="-DPYTHON_EXECUTABLE=$(which python3)"
CMAKE_ARGS="-DPYTHON_EXECUTABLE=$(which python3)"
Copy link
Member Author

Choose a reason for hiding this comment

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

Fix a typo.

- name: make run_viewer_pytest
run: |
make pytest \
make run_viewer_pytest \
Copy link
Member Author

Choose a reason for hiding this comment

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

Use the viewer binary to test.

clean:
rm -f $(MODMESH_ROOT)/modmesh/_modmesh$(pyextsuffix)
make -C $(BUILD_PATH) clean
.PHONY: cmake
Copy link
Member Author

Choose a reason for hiding this comment

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

Reorder the targets.


.PHONY: buildext
buildext: cmake
cmake --build $(BUILD_PATH) --target _modmesh_py VERBOSE=$(VERBOSE) $(MAKE_PARALLEL)
Copy link
Member Author

Choose a reason for hiding this comment

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

Change to use cmake targets.

if(CLANG_TIDY_EXE AND USE_CLANG_TIDY)
set_target_properties(
viewer PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
Copy link
Member Author

Choose a reason for hiding this comment

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

Use clang-tidy to viewer binary.


# Hack: add a .clang-tidy file in the generated .rcc directory.
# See https://gitlab.kitware.com/cmake/cmake/-/merge_requests/777
file(WRITE "${viewer_BINARY_DIR}/.rcc/.clang-tidy" "---
Copy link
Member Author

Choose a reason for hiding this comment

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

There should be a better way to do it, but that's what I can find after dinner.

public:

RScene(Qt3DCore::QNode * parent = nullptr)
explicit RScene(Qt3DCore::QNode * parent = nullptr)
Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks to clang-tidy.

@@ -0,0 +1,2 @@
Checks: >
-cppcoreguidelines-owning-memory No newline at end of file
Copy link
Member Author

Choose a reason for hiding this comment

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

qt tends to have way too many raw pointers so I have to turn this off.

}

RApplication::~RApplication()
{
Copy link
Member Author

Choose a reason for hiding this comment

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

Python finalization is taken care of elsewhere.

@yungyuc yungyuc merged commit d690bac into solvcon:master Oct 29, 2022
@yungyuc yungyuc deleted the feature/clang-tidy-viewer branch October 29, 2022 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test testing and continuous integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant