Skip to content

Commit 40aeb30

Browse files
committed
Switch to directly invoking ctest from build scripts which supports: build configurations (enable some tests only in optimized build) and parallel jobs
Signed-off-by: Sonal Santan <sonal.santan@amd.com>
1 parent 7500925 commit 40aeb30

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

build/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ function compile {
3939
cmake --install $BUILDDIR/$config --config $config --prefix $BUILDDIR/$config/opt/xilinx/aiebu
4040

4141
if [[ $run_test == "yes" ]]; then
42-
cmake --build $BUILDDIR/$config --config $config --target test -j $CORE
42+
ctest --test-dir $BUILDDIR/$config -C $config -j $CORE
4343

4444
if [[ $run_memtest == "yes" ]]; then
45-
cmake --build $BUILDDIR/$config --target test -j $CORE -- ARGS="-L memcheck -T memcheck"
45+
ctest --test-dir $BUILDDIR/$config -C $config -L memcheck -T memcheck
4646
fi
4747
fi
4848

build/build22.bat

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ set SCRIPTDIR=%~dp0
77
set SCRIPTDIR=%SCRIPTDIR:~0,-1%
88
set BUILDDIR=%SCRIPTDIR%
99

10-
set CMAKEFLAGS=-DMSVC_PARALLEL_JOBS=%LOCAL_MSVC_PARALLEL_JOBS% -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
1110
set DEBUG=1
1211
set RELEASE=1
1312
set CREATE_PACKAGE=0
@@ -92,8 +91,8 @@ if [%DEBUG%] == [1] (
9291
if errorlevel 1 (exit /B %errorlevel%)
9392

9493
if [%NOCTEST%] == [0] (
95-
echo cmake --build %BUILDDIR%\%PLATFORM% --config Debug --target run_tests -j %LOCAL_MSVC_PARALLEL_JOBS%
96-
cmake --build %BUILDDIR%\%PLATFORM% --config Debug --target run_tests -j %LOCAL_MSVC_PARALLEL_JOBS%
94+
echo ctest --test-dir %BUILDDIR%\%PLATFORM% -C Debug -j %LOCAL_MSVC_PARALLEL_JOBS%
95+
ctest --test-dir %BUILDDIR%\%PLATFORM% -C Debug -j %LOCAL_MSVC_PARALLEL_JOBS%
9796
if errorlevel 1 (exit /B %errorlevel%)
9897
)
9998
)
@@ -108,8 +107,8 @@ if [%RELEASE%] == [1] (
108107
if errorlevel 1 (exit /B %errorlevel%)
109108

110109
if [%NOCTEST%] == [0] (
111-
echo cmake --build %BUILDDIR%\%PLATFORM% --config Release --target run_tests -j %LOCAL_MSVC_PARALLEL_JOBS%
112-
cmake --build %BUILDDIR%\%PLATFORM% --config Release --target run_tests -j %LOCAL_MSVC_PARALLEL_JOBS%
110+
echo ctest --test-dir %BUILDDIR%\%PLATFORM% -C Release -j %LOCAL_MSVC_PARALLEL_JOBS%
111+
ctest --test-dir %BUILDDIR%\%PLATFORM% -C Release -j %LOCAL_MSVC_PARALLEL_JOBS%
113112
if errorlevel 1 (exit /B %errorlevel%)
114113
)
115114

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
# SPDX-License-Identifier: MIT
22
# Copyright (C) 2026 Advanced Micro Devices, Inc.
33

4-
if(CMAKE_BUILD_TYPE STREQUAL "Release")
4+
#if(CMAKE_BUILD_TYPE STREQUAL "Release")
55
# Assemble control code ASM for very large asm of total size 286 MB arranged into 10K files
66
add_test(NAME "aie4_compile_time"
77
COMMAND aiebu-asm -t aie4_config -j "${CMAKE_CURRENT_SOURCE_DIR}/config.json" -o control.elf -f disabledump
8+
CONFIGURATIONS Release
89
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
910

1011
# Compare the md5sum of ELF generated in aie4_compile_time test with that of the golden file
1112
add_test(NAME "aie4_compile_time_md5sum"
1213
COMMAND cmake -P "${AIEBU_SOURCE_DIR}/cmake/md5sum-compare.cmake" "${CMAKE_CURRENT_BINARY_DIR}/control.elf" "${CMAKE_CURRENT_SOURCE_DIR}/gold.md5"
14+
CONFIGURATIONS Release
1315
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
1416

1517
set_tests_properties("aie4_compile_time_md5sum" PROPERTIES DEPENDS "aie4_compile_time")
16-
endif()
18+
#endif()

0 commit comments

Comments
 (0)