Skip to content

Commit

Permalink
test: Add histogram integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed May 18, 2021
1 parent d50b77b commit 96c0ffc
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ find_package(benchmark CONFIG REQUIRED)

add_subdirectory(utils)
add_subdirectory(bench)
add_subdirectory(integration)
add_subdirectory(internal_benchmarks)
add_subdirectory(unittests)

Expand Down
24 changes: 24 additions & 0 deletions test/integration/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# evmone: Fast Ethereum Virtual Machine implementation
# Copyright 2021 The evmone Authors.
# SPDX-License-Identifier: Apache-2.0

set(PREFIX ${PROJECT_NAME}/integration)

get_target_property(EVMONE_LIB_TYPE evmone TYPE)
if(EVMONE_LIB_TYPE STREQUAL SHARED_LIBRARY)

add_test(NAME ${PREFIX}/histogram COMMAND $<TARGET_FILE:evmc::tool> --vm $<TARGET_FILE:evmone>,O=0,histogram run 6000808080800101010200)
set_tests_properties(
${PREFIX}/histogram PROPERTIES PASS_REGULAR_EXPRESSION
"--- # HISTOGRAM
opcode,count
STOP,1
ADD,3
MUL,1
PUSH1,1
DUP1,4
")

get_property(ALL_TESTS DIRECTORY PROPERTY TESTS)
set_tests_properties("${ALL_TESTS}" PROPERTIES ENVIRONMENT LLVM_PROFILE_FILE=${CMAKE_BINARY_DIR}/integration-%p.profraw)
endif()

0 comments on commit 96c0ffc

Please sign in to comment.