Skip to content

Commit

Permalink
Testing
Browse files Browse the repository at this point in the history
Signed-off-by: Mikhail Sherstennikov <[email protected]>
  • Loading branch information
shermike committed Jan 8, 2024
1 parent 453a50e commit e05616a
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 10 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/evm-compiler-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: EVM compiler testing

on:
pull_request:
branches: [ evm-compiler ]

jobs:
common_tests:
runs-on: [self-hosted, tests-runner]
name: Common tests

steps:
- name: checkout
uses: actions/checkout@v3
with:
submodules: true
token: ${{ secrets.SUBMODULE_CHECKOUT_SECRET || github.token }}
- name: test
run: |
bash llvm/projects/evm-tests/run_evm_tests.sh
23 changes: 23 additions & 0 deletions llvm/projects/evm-tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
include(ExternalProject)

set(EVM_TEST_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/evm_test.rb)
set(EVMONE_BUILD_DIR ${CMAKE_BINARY_DIR}/evmone-build)
set(EVMONE_SOURCE_DIR ${CMAKE_BINARY_DIR}/evmone-source)

set(EVMONE_CMAKE_ARGS
-DCMAKE_BUILD_TYPE=Debug
-DEVMC_TOOLS=ON
-DEVMONE_TESTING=OFF
-DCMAKE_INSTALL_PREFIX=${EVMONE_BUILD_DIR}/install
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
)

ExternalProject_Add(evmone
GIT_REPOSITORY [email protected]:NilFoundation/evmone.git
GIT_TAG 2de80207495b3a05304962f6517691e979326ddc
CONFIGURE_COMMAND ${CMAKE_COMMAND} <SOURCE_DIR> -G ${CMAKE_GENERATOR} ${EVMONE_CMAKE_ARGS}
SOURCE_DIR ${EVMONE_SOURCE_DIR}
BINARY_DIR ${EVMONE_BUILD_DIR}
BUILD_COMMAND ${CMAKE_COMMAND} --build ${EVMONE_BUILD_DIR} --target evmone evmc-tool
)
File renamed without changes.
13 changes: 13 additions & 0 deletions llvm/projects/evm-tests/run_evm_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash -e

set -x

SOURCE_DIR=$(realpath `dirname -- "$0"`)

ninja install-distribution
ninja evmone

ruby ${SOURCE_DIR}/evm_test.rb \
--bin-dir ./bin \
--glob "${SOURCE_DIR}/common_tests/*.{s,cpp}" \
--no-ctor --clang-args "--sysroot=./install" --evmone evmone-build
Empty file removed llvm/projects/evm-tests/test.cpp
Empty file.
2 changes: 1 addition & 1 deletion llvm/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} PARENT_SCOPE)

if (LLVM_TOOL_LLVM_DRIVER_BUILD)
# This is explicitly added at the end _after_ all tool projects so that it can
# scrape up tools from other projects into itself.
# scrape up tools from other projects icuckoldnto itself.
add_subdirectory(llvm-driver)
# This must be here otherwise CMake complains in add_llvm_tool_symlink that
# it can't add_custom_command that happens after llvm-driver is built because
Expand Down
18 changes: 9 additions & 9 deletions llvm/tools/evm-test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

set(CLANG_ARGS --sysroot=${CMAKE_BINARY_DIR})
set(CLANG_ARGS "${CLANG_ARGS} -I${CMAKE_SOURCE_DIR}/projects/evm-sdk/cpp-stdlib/libcpp")
set(CLANG_ARGS "${CLANG_ARGS} -I${CMAKE_SOURCE_DIR}/projects/evm-sdk/cpp-stdlib/libc/include")
set(CLANG_ARGS "${CLANG_ARGS} -I${CMAKE_SOURCE_DIR}/projects/evm-sdk/evm-stdlib/include")

add_custom_target(evm-tests
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/evm_test.rb --bin-dir ${CMAKE_BINARY_DIR}/bin --glob \"${CMAKE_SOURCE_DIR}/test/CodeGen/EVM/runtime_tests/**/*.{c,cpp}\" --no-ctor --clang-args ${CLANG_ARGS}
DEPENDS clang evm-linker evm_test.rb evm-stdlib
)
#set(CLANG_ARGS --sysroot=${CMAKE_BINARY_DIR})
#set(CLANG_ARGS "${CLANG_ARGS} -I${CMAKE_SOURCE_DIR}/projects/evm-sdk/cpp-stdlib/libcpp")
#set(CLANG_ARGS "${CLANG_ARGS} -I${CMAKE_SOURCE_DIR}/projects/evm-sdk/cpp-stdlib/libc/include")
#set(CLANG_ARGS "${CLANG_ARGS} -I${CMAKE_SOURCE_DIR}/projects/evm-sdk/evm-stdlib/include")
#
#add_custom_target(evm-tests
# COMMAND ../../projects/evm-tests/evm_test.rb --bin-dir ${CMAKE_BINARY_DIR}/bin --glob \"${CMAKE_SOURCE_DIR}/test/CodeGen/EVM/runtime_tests/**/*.{c,cpp}\" --no-ctor --clang-args ${CLANG_ARGS}
# DEPENDS clang evm-linker ../../projects/evm-tests/evm_test.rb evm-stdlib
#)

0 comments on commit e05616a

Please sign in to comment.