Skip to content

Commit

Permalink
Add --version option to testing tools
Browse files Browse the repository at this point in the history
  • Loading branch information
miles170 committed May 24, 2024
1 parent 2d5d6dc commit 491d99e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/blockchaintest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0

add_executable(evmone-blockchaintest)
target_link_libraries(evmone-blockchaintest PRIVATE evmone evmone::statetestutils GTest::gtest)
target_link_libraries(evmone-blockchaintest PRIVATE evmone evmone::statetestutils evmone-buildinfo GTest::gtest)
target_include_directories(evmone-blockchaintest PRIVATE ${evmone_private_include_dir})
target_sources(
evmone-blockchaintest PRIVATE
Expand Down
3 changes: 3 additions & 0 deletions test/blockchaintest/blockchaintest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "blockchaintest.hpp"
#include <CLI/CLI.hpp>
#include <evmone/evmone.h>
#include <evmone/version.h>
#include <gtest/gtest.h>
#include <iostream>

Expand Down Expand Up @@ -74,6 +75,8 @@ int main(int argc, char* argv[])

CLI::App app{"evmone blockchain test runner"};

app.set_version_flag("--version", "evmone-blockchaintest " EVMONE_VERSION);

std::vector<std::string> paths;
app.add_option("path", paths, "Path to test file or directory")
->required()
Expand Down
2 changes: 1 addition & 1 deletion test/statetest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ target_sources(
)

add_executable(evmone-statetest)
target_link_libraries(evmone-statetest PRIVATE evmone::statetestutils evmone GTest::gtest)
target_link_libraries(evmone-statetest PRIVATE evmone::statetestutils evmone evmone-buildinfo GTest::gtest)
target_include_directories(evmone-statetest PRIVATE ${evmone_private_include_dir})
target_sources(
evmone-statetest PRIVATE
Expand Down
3 changes: 3 additions & 0 deletions test/statetest/statetest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "statetest.hpp"
#include <CLI/CLI.hpp>
#include <evmone/evmone.h>
#include <evmone/version.h>
#include <gtest/gtest.h>
#include <iostream>

Expand Down Expand Up @@ -80,6 +81,8 @@ int main(int argc, char* argv[])

CLI::App app{"evmone state test runner"};

app.set_version_flag("--version", "evmone-statetest " EVMONE_VERSION);

std::vector<std::string> paths;
app.add_option("path", paths, "Path to test file or directory")
->required()
Expand Down
2 changes: 1 addition & 1 deletion test/t8n/t8n.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ int main(int argc, const char* argv[])
{
const std::string_view arg{argv[i]};

if (arg == "-v")
if (arg == "-v" || arg == "--version")
{
std::cout << "evmone-t8n " EVMONE_VERSION "\n";
return 0;
Expand Down

0 comments on commit 491d99e

Please sign in to comment.