-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] add cicd on github action (#10)
* enable ctest control by CICD_ENABLE * add run_ctest.py to start all test exe * modify cmakepreset to adapte to github action * update cmakepreset
- Loading branch information
Showing
6 changed files
with
98 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
.vscode | ||
build | ||
out | ||
.idea | ||
.idea | ||
log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# -*- coding: utf-8 -*- | ||
import subprocess | ||
import os | ||
import sys | ||
import platform | ||
|
||
def run_binary_test(top_path, cmakeprest_name, submod_name) -> bool: | ||
path_name = "" | ||
if platform.system() == "Linux": | ||
path_name = f"{top_path}/out/build/{cmakeprest_name}/submod/{submod_name}/test/{submod_name}_test" | ||
elif platform.system() == "Windows": | ||
path_name = f"{top_path}/out/build/{cmakeprest_name}/submod/{submod_name}/test/Release/{submod_name}_test.exe" | ||
result = subprocess.run(args=[path_name],shell=True,check=True,capture_output=True) | ||
return result.returncode == 0 | ||
|
||
# main function def | ||
if __name__ == '__main__': | ||
top_path = os.getcwd().replace("\\", "/") | ||
cmakeprest_name = "" | ||
if platform.system() == "Windows": | ||
cmakeprest_name = "MSVC_x64_release" | ||
elif platform.system() == "Linux": | ||
cmakeprest_name = "linux_gcc_x64_release" | ||
|
||
R0 = run_binary_test(top_path, cmakeprest_name, "common") | ||
R0 &= run_binary_test(top_path, cmakeprest_name, "chempars") | ||
R0 &= run_binary_test(top_path, cmakeprest_name, "core") | ||
|
||
sys.exit(0 if R0 else 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
find_package(GTest CONFIG REQUIRED) | ||
file(GLOB_RECURSE SOURCES *.cpp) | ||
add_executable(chempars_test ${SOURCES}) | ||
target_link_libraries(chempars_test chempars GTest::gtest GTest::gtest_main) | ||
target_link_libraries(chempars_test chempars GTest::gtest GTest::gtest_main) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters