Skip to content

Commit 6f7344a

Browse files
drowaudioclaude
andcommitted
Fix CI failures from the CLI11 refactor
Three regressions surfaced by CI (develop is green): - Linux build: std::int64_t (== long on LP64) vs juce::int64 (== long long) made expectEquals template deduction fail. Cast the settings int64 fields to juce::int64 in CommandLineTests. (macOS compiled because there the two types are identical.) - "Pluginval as Dependency" Verify: verify_pluginval runs `pluginval --help | grep "JUCE v<version>"`. CLI11's auto help didn't print the JUCE version; add it to the help footer. - Windows --run-tests exit 127: runUnitTests() called the [[noreturn]] juce::ConsoleApplication::fail(), which throws; outside a ConsoleApplication command handler that throw was uncaught -> std::terminate. Set the application return value directly instead. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 18c7a0b commit 6f7344a

3 files changed

Lines changed: 15 additions & 9 deletions

File tree

Source/CommandLine.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,14 @@ static void runUnitTests()
171171
testRunner.runTestsInCategory ("pluginval");
172172
const int numFailures = getNumTestFailures (testRunner);
173173

174+
// Set the return value directly rather than juce::ConsoleApplication::fail(),
175+
// which throws and would terminate the process when called outside a
176+
// ConsoleApplication command handler.
174177
if (numFailures > 0)
175-
juce::ConsoleApplication::fail (juce::String (numFailures) + " tests failed!!!");
178+
{
179+
std::cout << numFailures << " tests failed!!!" << std::endl;
180+
juce::JUCEApplication::getInstance()->setApplicationReturnValue (1);
181+
}
176182
}
177183

178184
//==============================================================================

Source/CommandLineTests.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,14 @@ struct CommandLineTests : public juce::UnitTest
9494

9595
beginTest ("Negative timeout");
9696
{
97-
expectEquals (parse ("--timeout-ms -1 --validate x").timeoutMs, (juce::int64) -1);
97+
expectEquals ((juce::int64) parse ("--timeout-ms -1 --validate x").timeoutMs, (juce::int64) -1);
9898
}
9999

100100
beginTest ("Command line random (hex and int)");
101101
{
102-
expectEquals (parse ("--random-seed 0x7f2da1 --validate x").randomSeed, (juce::int64) 8334753);
103-
expectEquals (parse ("--random-seed 0x692bc1f --validate x").randomSeed, (juce::int64) 110279711);
104-
expectEquals (parse ("--random-seed 1234 --validate x").randomSeed, (juce::int64) 1234);
102+
expectEquals ((juce::int64) parse ("--random-seed 0x7f2da1 --validate x").randomSeed, (juce::int64) 8334753);
103+
expectEquals ((juce::int64) parse ("--random-seed 0x692bc1f --validate x").randomSeed, (juce::int64) 110279711);
104+
expectEquals ((juce::int64) parse ("--random-seed 1234 --validate x").randomSeed, (juce::int64) 1234);
105105
}
106106

107107
beginTest ("Comma-separated lists");
@@ -251,7 +251,7 @@ struct CommandLineTests : public juce::UnitTest
251251
{
252252
const auto s = parse (cfg + " --validate x");
253253
expectEquals (s.strictnessLevel, 2);
254-
expectEquals (s.timeoutMs, (juce::int64) 12345);
254+
expectEquals ((juce::int64) s.timeoutMs, (juce::int64) 12345);
255255
expectEquals (s.numRepeats, 4);
256256
}
257257

@@ -261,7 +261,7 @@ struct CommandLineTests : public juce::UnitTest
261261
const auto s = parse (cfg + " --validate x");
262262
clearKnownEnv();
263263
expectEquals (s.strictnessLevel, 6); // env beats config
264-
expectEquals (s.timeoutMs, (juce::int64) 12345); // still from config
264+
expectEquals ((juce::int64) s.timeoutMs, (juce::int64) 12345); // still from config
265265
}
266266

267267
// CLI overrides env and config
@@ -270,7 +270,7 @@ struct CommandLineTests : public juce::UnitTest
270270
const auto s = parse (cfg + " --strictness-level 9 --validate x");
271271
clearKnownEnv();
272272
expectEquals (s.strictnessLevel, 9);
273-
expectEquals (s.timeoutMs, (juce::int64) 12345);
273+
expectEquals ((juce::int64) s.timeoutMs, (juce::int64) 12345);
274274
}
275275
}
276276

Source/SettingsParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ namespace settings_parser
8888

8989
juce::String getFooterText()
9090
{
91-
return juce::String (
91+
return juce::SystemStats::getJUCEVersion() + "\n\n" + juce::String (
9292
R"(Other commands:
9393
--run-tests Run the internal unit tests.
9494
--strictness-help [level] List all tests that run at the given strictness level.

0 commit comments

Comments
 (0)