Skip to content

Commit 1a0d8e1

Browse files
committed
build: Re-enable external signer on Windows
1 parent 989451d commit 1a0d8e1

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

ci/test/00_setup_env_win64.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ export DPKG_ADD_ARCH="i386"
1313
export PACKAGES="python3 nsis g++-mingw-w64-x86-64-posix wine-binfmt wine64 wine32 file"
1414
export RUN_FUNCTIONAL_TESTS=false
1515
export GOAL="deploy"
16-
export BITCOIN_CONFIG="--enable-reduce-exports --disable-external-signer --disable-gui-tests"
16+
export BITCOIN_CONFIG="--enable-reduce-exports --enable-external-signer --disable-gui-tests"

src/test/system_tests.cpp

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ BOOST_AUTO_TEST_CASE(dummy)
3434

3535
BOOST_AUTO_TEST_CASE(run_command)
3636
{
37+
#ifdef WIN32
38+
// https://www.winehq.org/pipermail/wine-devel/2008-September/069387.html
39+
auto hntdll = GetModuleHandleA("ntdll.dll");
40+
assert(hntdll);
41+
const bool wine_runtime = GetProcAddress(hntdll, "wine_get_version");
42+
#endif
43+
3744
{
3845
const UniValue result = RunCommandParseJSON("");
3946
BOOST_CHECK(result.isNull());
@@ -51,29 +58,35 @@ BOOST_AUTO_TEST_CASE(run_command)
5158
}
5259
{
5360
// An invalid command is handled by Boost
61+
#ifdef WIN32
62+
const int expected_error{wine_runtime ? 6 : 2};
63+
#else
64+
const int expected_error{2};
65+
#endif
5466
BOOST_CHECK_EXCEPTION(RunCommandParseJSON("invalid_command"), boost::process::process_error, [&](const boost::process::process_error& e) {
5567
BOOST_CHECK(std::string(e.what()).find("RunCommandParseJSON error:") == std::string::npos);
56-
BOOST_CHECK_EQUAL(e.code().value(), 2);
68+
BOOST_CHECK_EQUAL(e.code().value(), expected_error);
5769
return true;
5870
});
5971
}
6072
{
6173
// Return non-zero exit code, no output to stderr
6274
#ifdef WIN32
63-
const std::string command{"cmd.exe /c call"};
75+
const std::string command{"cmd.exe /c exit 1"};
6476
#else
6577
const std::string command{"false"};
6678
#endif
6779
BOOST_CHECK_EXCEPTION(RunCommandParseJSON(command), std::runtime_error, [&](const std::runtime_error& e) {
68-
BOOST_CHECK(std::string(e.what()).find(strprintf("RunCommandParseJSON error: process(%s) returned 1: \n", command)) != std::string::npos);
80+
const std::string what{e.what()};
81+
BOOST_CHECK(what.find(strprintf("RunCommandParseJSON error: process(%s) returned 1: \n", command)) != std::string::npos);
6982
return true;
7083
});
7184
}
7285
{
7386
// Return non-zero exit code, with error message for stderr
7487
#ifdef WIN32
7588
const std::string command{"cmd.exe /c dir nosuchfile"};
76-
const std::string expected{"File Not Found"};
89+
const std::string expected{wine_runtime ? "File not found." : "File Not Found"};
7790
#else
7891
const std::string command{"ls nosuchfile"};
7992
const std::string expected{"No such file or directory"};

0 commit comments

Comments
 (0)