Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Commit 704bb8b

Browse files
committed
Fix tests on ci and move slow tests to bench_tests folder.
1 parent 837af0c commit 704bb8b

21 files changed

+682
-182
lines changed

libs/hash/test/hash_to_curve.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include <type_traits>
3333
#include <tuple>
3434

35-
#include <boost/test/included/unit_test.hpp>
35+
#include <boost/test/unit_test.hpp>
3636
#include <boost/test/data/test_case.hpp>
3737
#include <boost/test/data/monomorphic.hpp>
3838

libs/marshalling/algebra/test/curve_element.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
#define BOOST_TEST_MODULE crypto3_marshalling_curve_element_test
2727

28-
#include <boost/test/included/unit_test.hpp>
28+
#include <boost/test/unit_test.hpp>
2929

3030
#include <boost/algorithm/string/case_conv.hpp>
3131
#include <boost/random/mersenne_twister.hpp>

libs/marshalling/zk/test/kzg_commitment.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include "nil/crypto3/zk/commitments/batched_commitment.hpp"
2929
#define BOOST_TEST_MODULE crypto3_marshalling_kzg_commitment_test
3030

31-
#include <boost/test/included/unit_test.hpp>
31+
#include <boost/test/unit_test.hpp>
3232
#include <boost/algorithm/string/case_conv.hpp>
3333
#include <iostream>
3434
#include <iomanip>

libs/marshalling/zk/test/lpc_commitment.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
#define BOOST_TEST_MODULE crypto3_marshalling_lpc_commitment_test
2929

30-
#include <boost/test/included/unit_test.hpp>
30+
#include <boost/test/unit_test.hpp>
3131
#include <boost/algorithm/string/case_conv.hpp>
3232

3333
#include <boost/random/mersenne_twister.hpp>

libs/marshalling/zk/test/placeholder_common_data.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#define BOOST_TEST_MODULE crypto3_marshalling_placeholder_common_data_test
22

3-
#include <boost/test/included/unit_test.hpp>
3+
#include <boost/test/unit_test.hpp>
44
#include <boost/algorithm/string/case_conv.hpp>
55
#include <boost/random/mersenne_twister.hpp>
66
#include <boost/random/uniform_int.hpp>

libs/marshalling/zk/test/placeholder_proof.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
#define BOOST_TEST_MODULE crypto3_marshalling_placeholder_proof_test
2929

30-
#include <boost/test/included/unit_test.hpp>
30+
#include <boost/test/unit_test.hpp>
3131
#include <boost/algorithm/string/case_conv.hpp>
3232
#include <boost/random/mersenne_twister.hpp>
3333
#include <boost/random/uniform_int.hpp>

libs/zk/test/CMakeLists.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ set(TESTS_NAMES
5050
"commitment/fri"
5151
"commitment/kzg"
5252
"commitment/fold_polynomial"
53-
"commitment/lpc_performance"
5453
"commitment/pedersen"
5554
"commitment/proof_of_knowledge"
5655
# "commitment/powers_of_tau"
@@ -110,3 +109,7 @@ endforeach()
110109

111110
# string(CONCAT TEST_DATA ${CMAKE_CURRENT_SOURCE_DIR} "/systems/plonk/pickles/data/kimchi")
112111
# target_compile_definitions(crypto3_zk_systems_plonk_pickles_kimchi_test PRIVATE TEST_DATA="${TEST_DATA}")
112+
if(BUILD_BENCH_TESTS)
113+
cm_add_test_subdirectory(bench_test)
114+
endif()
115+
+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#---------------------------------------------------------------------------#
2+
# Copyright (c) 2018-2021 Mikhail Komarov <[email protected]>
3+
#
4+
# Distributed under the Boost Software License, Version 1.0
5+
# See accompanying file LICENSE_1_0.txt or copy at
6+
# http://www.boost.org/LICENSE_1_0.txt
7+
#---------------------------------------------------------------------------#
8+
9+
include(CMTest)
10+
11+
add_custom_target(zk_runtime_bench_tests)
12+
13+
macro(define_runtime_zk_test name)
14+
set(test_name "zk_${name}_bench_test")
15+
add_dependencies(zk_runtime_bench_tests ${test_name})
16+
17+
cm_test(NAME ${test_name} SOURCES ${name}.cpp)
18+
19+
target_include_directories(${test_name} PRIVATE
20+
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
21+
"$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>"
22+
23+
${Boost_INCLUDE_DIRS})
24+
25+
set_target_properties(${test_name} PROPERTIES CXX_STANDARD 17
26+
CXX_STANDARD_REQUIRED TRUE)
27+
28+
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
29+
target_compile_options(${test_name} PRIVATE "-fconstexpr-steps=2147483647")
30+
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
31+
target_compile_options(${test_name} PRIVATE "-fconstexpr-ops-limit=4294967295")
32+
endif()
33+
34+
target_compile_definitions(${test_name} PRIVATE TEST_DATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}/data/")
35+
endmacro()
36+
37+
set(RUNTIME_TESTS_NAMES
38+
"bench_pedersen"
39+
"bench_lpc"
40+
)
41+
42+
foreach(TEST_NAME ${RUNTIME_TESTS_NAMES})
43+
define_runtime_zk_test(${TEST_NAME})
44+
endforeach()
45+

0 commit comments

Comments
 (0)