Skip to content

Commit

Permalink
Fix Windows tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mcbarton committed May 13, 2024
1 parent b8c94f9 commit 36f4c1f
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 20 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,20 +117,36 @@ jobs:
cd build
make install -j ${{ env.ncpus }}
- name: Test xeus-cpp C++
- name: Test xeus-cpp C++ Unix Systems
if: ${{ runner.os != 'windows' }}
shell: bash -l {0}
run: |
cd build/test
./test_xeus_cpp
timeout-minutes: 4

- name: test
- name: Test xeus-cpp C++ Windows Systems
if: ${{ runner.os == 'windows' }}
shell: cmd /C call {0}
run: |
call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat activate xeus-cpp
cd build\test
.\test_xeus_cpp.exe
- name: Python tests Unix Systems
if: ${{ runner.os != 'windows' }}
shell: bash -l {0}
run: |
cd test
pytest -sv . --reruns 5
- name: Python tests Windows Systems
if: ${{ runner.os == 'windows' }}
shell: cmd /C call {0}
run: |
call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat activate xeus-cpp
cd test
pytest -sv test_xcpp_kernel.py --reruns 5
- name: Prepare code coverage report
if: ${{ success() && (matrix.coverage == true) }}
Expand Down
35 changes: 22 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,31 +130,40 @@ function(configure_kernel kernel)
set(XEUS_CPP_PATH "$ENV{PATH}")
set(XEUS_CPP_LD_LIBRARY_PATH "$ENV{LD_LIBRARY_PATH}")
set(XEUS_CPP_RESOURCE_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/clang/${CPPINTEROP_LLVM_VERSION_MAJOR})
set(XEUS_CPP_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX}/include)

if (WIN32)
string(REPLACE "\\" "/" kernel "${kernel}")
string(REPLACE "\\" "/" XEUS_CPP_PATH "${XEUS_CPP_PATH}")
string(REPLACE "\\" "/" XEUS_CPP_LD_LIBRARY_PATH "${XEUS_CPP_LD_LIBRARY_PATH}")
string(REPLACE "\\" "/" XEUS_CPP_RESOURCE_DIR "${XEUS_CPP_RESOURCE_DIR}")
string(REPLACE "\\" "/" XEUS_CPP_INCLUDE_DIR "${XEUS_CPP_INCLUDE_DIR}")
endif()

configure_file (
"${CMAKE_CURRENT_SOURCE_DIR}/${kernel}/kernel.json.in"
"${CMAKE_CURRENT_BINARY_DIR}/${kernel}/kernel.json")
"${CMAKE_CURRENT_SOURCE_DIR}${kernel}kernel.json.in"
"${CMAKE_CURRENT_BINARY_DIR}${kernel}kernel.json")

configure_file (
"${CMAKE_CURRENT_SOURCE_DIR}/${kernel}/logo-32x32.png"
"${CMAKE_CURRENT_BINARY_DIR}/${kernel}/"
"${CMAKE_CURRENT_SOURCE_DIR}${kernel}logo-32x32.png"
"${CMAKE_CURRENT_BINARY_DIR}${kernel}"
COPYONLY)
configure_file (
"${CMAKE_CURRENT_SOURCE_DIR}/${kernel}/logo-64x64.png"
"${CMAKE_CURRENT_BINARY_DIR}/${kernel}/"
"${CMAKE_CURRENT_SOURCE_DIR}${kernel}logo-64x64.png"
"${CMAKE_CURRENT_BINARY_DIR}${kernel}"
COPYONLY)
configure_file (
"${CMAKE_CURRENT_SOURCE_DIR}/${kernel}/logo-svg.svg"
"${CMAKE_CURRENT_BINARY_DIR}/${kernel}/"
"${CMAKE_CURRENT_SOURCE_DIR}${kernel}logo-svg.svg"
"${CMAKE_CURRENT_BINARY_DIR}${kernel}"
COPYONLY)
endfunction()

message("Configure kernels: ...")
configure_kernel("share/jupyter/kernels/xcpp")
configure_kernel("share/jupyter/kernels/xcpp11")
configure_kernel("share/jupyter/kernels/xcpp14")
configure_kernel("share/jupyter/kernels/xcpp17")
configure_kernel("share/jupyter/kernels/xcpp20")
configure_kernel("/share/jupyter/kernels/xcpp/")
configure_kernel("/share/jupyter/kernels/xcpp11/")
configure_kernel("/share/jupyter/kernels/xcpp14/")
configure_kernel("/share/jupyter/kernels/xcpp17/")
configure_kernel("/share/jupyter/kernels/xcpp20/")

# Source files
# ============
Expand Down
2 changes: 1 addition & 1 deletion environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ dependencies:
- jupyter_kernel_test>=0.4.3
- nbval
- pytest-rerunfailures
- doctest
- doctest
1 change: 1 addition & 0 deletions share/jupyter/kernels/xcpp11/kernel.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"-f",
"{connection_file}",
"-resource-dir", "@XEUS_CPP_RESOURCE_DIR@",
"-I", "@XEUS_CPP_INCLUDE_DIR@",
"-std=c++11"@XEUS_CPP_OMP@
],
"language": "cpp",
Expand Down
2 changes: 1 addition & 1 deletion share/jupyter/kernels/xcpp14/kernel.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"-f",
"{connection_file}",
"-resource-dir", "@XEUS_CPP_RESOURCE_DIR@",
"-I", "@CMAKE_INSTALL_PREFIX@/include",
"-I", "@XEUS_CPP_INCLUDE_DIR@",
"-std=c++14",
"-fno-exceptions",
"-O2",
Expand Down
2 changes: 1 addition & 1 deletion share/jupyter/kernels/xcpp17-omp/kernel.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"-f",
"{connection_file}",
"-resource-dir", "@XEUS_CPP_RESOURCE_DIR@",
"-I", "@CMAKE_INSTALL_PREFIX@/include",
"-I", "@XEUS_CPP_INCLUDE_DIR@",
"-std=c++17"@XEUS_CPP_OMP@
],
"language": "cpp",
Expand Down
2 changes: 1 addition & 1 deletion share/jupyter/kernels/xcpp17/kernel.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"-f",
"{connection_file}",
"-resource-dir", "@XEUS_CPP_RESOURCE_DIR@",
"-I", "@CMAKE_INSTALL_PREFIX@/include",
"-I", "@XEUS_CPP_INCLUDE_DIR@",
"-std=c++17"@XEUS_CPP_OMP@
],
"language": "cpp",
Expand Down
2 changes: 1 addition & 1 deletion share/jupyter/kernels/xcpp20/kernel.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"-f",
"{connection_file}",
"-resource-dir", "@XEUS_CPP_RESOURCE_DIR@",
"-I", "@CMAKE_INSTALL_PREFIX@/include",
"-I", "@XEUS_CPP_INCLUDE_DIR@",
"-std=c++20"@XEUS_CPP_OMP@
],
"language": "cpp",
Expand Down

0 comments on commit 36f4c1f

Please sign in to comment.