Skip to content

Commit

Permalink
Change CMake version and test to run on windows OS
Browse files Browse the repository at this point in the history
Signed-off-by: Ahmed, Daiyaan <[email protected]>
  • Loading branch information
daiyaan-ahmed6 committed Jan 9, 2024
1 parent 303d0fc commit 261586a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
4 changes: 2 additions & 2 deletions behavior_tests/src/cmake_target_link_libraries/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.24)
cmake_minimum_required(VERSION 3.10)
project(foo LANGUAGES CXX )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsycl")
find_program(dpct_bin_path NAMES dpct PATHS)
Expand All @@ -12,4 +12,4 @@ set(SOURCES
${CMAKE_SOURCE_DIR}/main.dp.cpp
)
add_executable(foo-bar ${SOURCES})
target_link_libraries(foo-bar PUBLIC -qmkl ${DNN_LIB})
target_link_libraries(foo-bar PUBLIC -qmkl ${DNN_LIB})
25 changes: 20 additions & 5 deletions behavior_tests/src/cmake_target_link_libraries/do_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,26 @@ def setup_test():
def migrate_test():
# clean previous migration output
if (os.path.exists("build")):
shutil.rmtree("build")
call_subprocess(" mkdir build && cd build && cmake -DCMAKE_CXX_COMPILER=icpx ../ && make")
return os.path.exists(os.path.join("build", "foo-bar"))
shutil.rmtree("build")

ret = call_subprocess("mkdir build")
if not ret:
print("Error to create build folder:", test_config.command_output)

ret = change_dir("build")
if not ret:
print("Error to go to build folder:", test_config.command_output)

ret = call_subprocess("cmake -G \"Unix Makefiles\" -DCMAKE_CXX_COMPILER=icpx ../")
if not ret:
print("Error to run cmake configure:", test_config.command_output)

ret = call_subprocess("make")
if not ret:
print("Error to run build process:", test_config.command_output)

return os.path.exists("foo-bar")
def build_test():
return True
def run_test():
change_dir("build")
return call_subprocess(os.path.join(os.path.curdir, "foo-bar"))
return call_subprocess("./foo-bar")

0 comments on commit 261586a

Please sign in to comment.