Skip to content

Commit 19bbd44

Browse files
committed
Replacing custom virtual library test code with libvireg as a git submodule
1 parent 3dc7be5 commit 19bbd44

File tree

9 files changed

+160
-558
lines changed

9 files changed

+160
-558
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "cores/test/external/libvireg"]
2+
path = cores/test/external/libvireg
3+
url = https://github.com/bcmi-labs/libvireg

cores/test/CMakeLists.txt

+8-5
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,26 @@ cmake_minimum_required(VERSION 3.0)
55
##########################################################################
66

77
include_directories(include)
8+
include_directories(external/libvireg/include)
89
include_directories(external/catch/v.2.7.0/include)
910

1011
##########################################################################
1112

1213
set(CMAKE_CXX_STANDARD 11)
1314

1415
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
16+
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
17+
18+
##########################################################################
19+
20+
add_subdirectory(external/libvireg) # For building libvireg
1521

1622
##########################################################################
1723

1824
set(TEST_TARGET testArduinoCore-megaavr)
1925

2026
set(TEST_SRCS
2127
src/test_main.cpp
22-
src/port/megaavr/PORT_t.cpp
2328
../arduino/NANO_Compat.cpp
2429
)
2530

@@ -30,10 +35,8 @@ add_definitions(-DAVR_NANO_4809_328MODE)
3035

3136
##########################################################################
3237

33-
add_executable(
34-
${TEST_TARGET}
35-
${TEST_SRCS}
36-
)
38+
add_executable(${TEST_TARGET} ${TEST_SRCS})
39+
target_link_libraries(${TEST_TARGET} vireg)
3740

3841
##########################################################################
3942

cores/test/include/Arduino.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121

2222
/* This is a Arduino.h mockup for test purposes only */
2323

24-
#include <test/port/megaavr/PORT_t.h>
24+
#include <vireg/port/megaAVR-0/PORT_t.h>
2525

2626
#endif /* ARDUINO_H_ */

cores/test/include/test/Register.hpp

-88
This file was deleted.

cores/test/include/test/Register.ipp

-110
This file was deleted.

cores/test/include/test/RegisterObserver.hpp

-51
This file was deleted.

0 commit comments

Comments
 (0)