Skip to content

Commit

Permalink
* refactor PR based on reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
eukarpov committed Nov 20, 2023
1 parent c96e667 commit 7a01b52
Show file tree
Hide file tree
Showing 22 changed files with 34 additions and 25 deletions.
1 change: 1 addition & 0 deletions tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build
4 changes: 2 additions & 2 deletions tests/BUILD.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ Building aarch64-w64-mingw32 tests on Linux or WSL
cmake -S . -B build
cmake --build build

it generates Arm64 Windows executable
build/aarch64_mingw_tests
It generates Arm64 Windows executable.
build/bin/aarch64_mingw_tests.exe
52 changes: 30 additions & 22 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_C_COMPILER "$ENV{HOME}/cross/bin/aarch64-w64-mingw32-gcc")

if (NOT DEFINED ENV{TARGET})
set(ENV{TARGET} "aarch64-w64-mingw32")
endif()
if (NOT DEFINED ENV{INSTALL_PATH})
set(ENV{INSTALL_PATH} "$ENV{HOME}/cross")
endif()

set(CMAKE_C_COMPILER "$ENV{INSTALL_PATH}/bin/$ENV{TARGET}-gcc")
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_COMPILER "$ENV{HOME}/cross/bin/aarch64-w64-mingw32-c++")
set(CMAKE_RANLIB "$ENV{HOME}/cross/bin/aarch64-w64-mingw32-ranlib")
set(CMAKE_CXX_COMPILER "$ENV{INSTALL_PATH}/bin/$ENV{TARGET}-c++")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fopenmp")
set(CMAKE_RANLIB "$ENV{INSTALL_PATH}/bin/$ENV{TARGET}-ranlib")

include(FetchContent)
FetchContent_Declare(
Expand All @@ -20,28 +28,28 @@ project(aarch64_mingw_tests)
enable_testing()

add_executable(
aarch64_mingw_tests
bigdata_test.cpp
iostream_test.cpp
math_test.c
math_test.cpp
omp_test.c
omp_test.cpp
pdata_test.c
pdata_test.cpp
sjlj_test.c
sjlj_test.cpp
struct_test.c
struct_test.cpp
throw_test.cpp
varargs_test.c
varargs_test.cpp
aarch64-mingw-tests.exe
bigdata-test.cpp
iostream-test.cpp
math-test.c
math-test.cpp
omp-test.c
omp-test.cpp
pdata-test.c
pdata-test.cpp
sjlj-test.c
sjlj-test.cpp
struct-test.c
struct-test.cpp
throw-test.cpp
varargs-test.c
varargs-test.cpp
)

set_source_files_properties(test-dll.c PROPERTIES COMPILE_FLAGS "-DIMPORT_API=")

target_link_libraries(
aarch64_mingw_tests
aarch64-mingw-tests.exe
GTest::gtest_main
dbghelp
)

set_target_properties(aarch64-mingw-tests.exe PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/pdata_test.c → tests/pdata-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static void print_symbol(HANDLE hp, DWORD64 offset)

if (SymGetSymFromAddr64(hp, offset, &dwDisplacement, p))
{
printf(" %s+0x%.04llX", p->Name, dwDisplacement);
// printf(" %s+0x%.04llX", p->Name, dwDisplacement);
}
else
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 7a01b52

Please sign in to comment.