Added dummy tests per arch
This commit is contained in:
parent
362af26833
commit
9029ebde3b
7
.gitignore
vendored
7
.gitignore
vendored
@ -1,7 +1,7 @@
|
|||||||
/generated/
|
/generated/
|
||||||
/objs/
|
/objs/
|
||||||
/nextpnr-dummy
|
/nextpnr-dummy*
|
||||||
/nextpnr-ice40
|
/nextpnr-ice40*
|
||||||
cmake-build-*/
|
cmake-build-*/
|
||||||
Makefile
|
Makefile
|
||||||
cmake_install.cmake
|
cmake_install.cmake
|
||||||
@ -21,4 +21,5 @@ a.out
|
|||||||
build/
|
build/
|
||||||
*.asc
|
*.asc
|
||||||
*.bin
|
*.bin
|
||||||
|
CTest*
|
||||||
|
LastTest*
|
||||||
|
@ -22,6 +22,9 @@ execute_process(
|
|||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
)
|
)
|
||||||
|
|
||||||
|
add_subdirectory(3rdparty/googletest/googletest)
|
||||||
|
enable_testing()
|
||||||
|
|
||||||
add_definitions("-DGIT_COMMIT_HASH=${GIT_COMMIT_HASH}")
|
add_definitions("-DGIT_COMMIT_HASH=${GIT_COMMIT_HASH}")
|
||||||
configure_file(
|
configure_file(
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/common/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/generated/version.h
|
${CMAKE_CURRENT_SOURCE_DIR}/common/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/generated/version.h
|
||||||
@ -96,6 +99,11 @@ foreach (family ${FAMILIES})
|
|||||||
target_compile_definitions(${target} PRIVATE ARCH_${ufamily} ARCHNAME=${family} -DQT_NO_KEYWORDS)
|
target_compile_definitions(${target} PRIVATE ARCH_${ufamily} ARCHNAME=${family} -DQT_NO_KEYWORDS)
|
||||||
target_link_libraries(${target} LINK_PUBLIC ${Boost_LIBRARIES} ${PYTHON_LIBRARIES} ${GUI_LIBRARY_FILES})
|
target_link_libraries(${target} LINK_PUBLIC ${Boost_LIBRARIES} ${PYTHON_LIBRARIES} ${GUI_LIBRARY_FILES})
|
||||||
endforeach (target)
|
endforeach (target)
|
||||||
|
|
||||||
|
add_executable(nextpnr-${family}-test "")
|
||||||
|
target_sources(nextpnr-${family}-test PRIVATE tests/${family}/main.cpp)
|
||||||
|
target_link_libraries(nextpnr-${family}-test PRIVATE gtest_main)
|
||||||
|
add_test(${family}-test ${CMAKE_CURRENT_BINARY_DIR}/nextpnr-${family}-test)
|
||||||
endforeach (family)
|
endforeach (family)
|
||||||
|
|
||||||
file(GLOB_RECURSE CLANGFORMAT_FILES *.cc *.h)
|
file(GLOB_RECURSE CLANGFORMAT_FILES *.cc *.h)
|
||||||
|
18
tests/dummy/main.cpp
Normal file
18
tests/dummy/main.cpp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
int main(int argc, char **argv) {
|
||||||
|
::testing::InitGoogleTest(&argc, argv);
|
||||||
|
return RUN_ALL_TESTS();
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(example, sum_zero) {
|
||||||
|
auto result = 0;
|
||||||
|
ASSERT_EQ(result, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(example, sum_five) {
|
||||||
|
auto result = 15;
|
||||||
|
ASSERT_EQ(result, 15);
|
||||||
|
}
|
18
tests/ice40/main.cpp
Normal file
18
tests/ice40/main.cpp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
int main(int argc, char **argv) {
|
||||||
|
::testing::InitGoogleTest(&argc, argv);
|
||||||
|
return RUN_ALL_TESTS();
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(example, sum_zero) {
|
||||||
|
auto result = 0;
|
||||||
|
ASSERT_EQ(result, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(example, sum_five) {
|
||||||
|
auto result = 15;
|
||||||
|
ASSERT_EQ(result, 15);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user