mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Use EXIT_FAILURE and EXIT_SUCCESS constants in exit() and when returning from main()
This commit is contained in:
parent
7c83559881
commit
b3048ccf07
@ -235,10 +235,10 @@ test_suite* init_unit_test_suite(int /*argc*/, char* /*argv*/[])
|
|||||||
{
|
{
|
||||||
bool shouldContinue = initializeOptions();
|
bool shouldContinue = initializeOptions();
|
||||||
if (!shouldContinue)
|
if (!shouldContinue)
|
||||||
exit(0);
|
exit(EXIT_SUCCESS);
|
||||||
|
|
||||||
if (!solidity::test::loadVMs(solidity::test::CommonOptions::get()))
|
if (!solidity::test::loadVMs(solidity::test::CommonOptions::get()))
|
||||||
exit(1);
|
exit(EXIT_FAILURE);
|
||||||
|
|
||||||
if (solidity::test::CommonOptions::get().disableSemanticTests)
|
if (solidity::test::CommonOptions::get().disableSemanticTests)
|
||||||
cout << endl << "--- SKIPPING ALL SEMANTICS TESTS ---" << endl << endl;
|
cout << endl << "--- SKIPPING ALL SEMANTICS TESTS ---" << endl << endl;
|
||||||
@ -298,12 +298,12 @@ test_suite* init_unit_test_suite(int /*argc*/, char* /*argv*/[])
|
|||||||
catch (solidity::test::ConfigException const& exception)
|
catch (solidity::test::ConfigException const& exception)
|
||||||
{
|
{
|
||||||
cerr << exception.what() << endl;
|
cerr << exception.what() << endl;
|
||||||
exit(1);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
catch (std::runtime_error const& exception)
|
catch (std::runtime_error const& exception)
|
||||||
{
|
{
|
||||||
cerr << exception.what() << endl;
|
cerr << exception.what() << endl;
|
||||||
exit(1);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -435,7 +435,7 @@ int main(int argc, char const *argv[])
|
|||||||
|
|
||||||
bool shouldContinue = options->parse(argc, argv);
|
bool shouldContinue = options->parse(argc, argv);
|
||||||
if (!shouldContinue)
|
if (!shouldContinue)
|
||||||
return 0;
|
return EXIT_SUCCESS;
|
||||||
|
|
||||||
options->validate();
|
options->validate();
|
||||||
CommonOptions::setSingleton(std::move(options));
|
CommonOptions::setSingleton(std::move(options));
|
||||||
@ -444,7 +444,7 @@ int main(int argc, char const *argv[])
|
|||||||
auto& options = dynamic_cast<IsolTestOptions const&>(CommonOptions::get());
|
auto& options = dynamic_cast<IsolTestOptions const&>(CommonOptions::get());
|
||||||
|
|
||||||
if (!solidity::test::loadVMs(options))
|
if (!solidity::test::loadVMs(options))
|
||||||
return 1;
|
return EXIT_FAILURE;
|
||||||
|
|
||||||
if (options.disableSemanticTests)
|
if (options.disableSemanticTests)
|
||||||
cout << endl << "--- SKIPPING ALL SEMANTICS TESTS ---" << endl << endl;
|
cout << endl << "--- SKIPPING ALL SEMANTICS TESTS ---" << endl << endl;
|
||||||
@ -480,7 +480,7 @@ int main(int argc, char const *argv[])
|
|||||||
if (stats)
|
if (stats)
|
||||||
global_stats += *stats;
|
global_stats += *stats;
|
||||||
else
|
else
|
||||||
return 1;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
cout << endl << "Summary: ";
|
cout << endl << "Summary: ";
|
||||||
@ -498,22 +498,22 @@ int main(int argc, char const *argv[])
|
|||||||
if (options.disableSemanticTests)
|
if (options.disableSemanticTests)
|
||||||
cout << "\nNOTE: Skipped semantics tests.\n" << endl;
|
cout << "\nNOTE: Skipped semantics tests.\n" << endl;
|
||||||
|
|
||||||
return global_stats ? 0 : 1;
|
return global_stats ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
catch (boost::program_options::error const& exception)
|
catch (boost::program_options::error const& exception)
|
||||||
{
|
{
|
||||||
cerr << exception.what() << endl;
|
cerr << exception.what() << endl;
|
||||||
return 1;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
catch (std::runtime_error const& exception)
|
catch (std::runtime_error const& exception)
|
||||||
{
|
{
|
||||||
cerr << exception.what() << endl;
|
cerr << exception.what() << endl;
|
||||||
return 1;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
cerr << "Unhandled exception caught." << endl;
|
cerr << "Unhandled exception caught." << endl;
|
||||||
cerr << boost::current_exception_diagnostic_information() << endl;
|
cerr << boost::current_exception_diagnostic_information() << endl;
|
||||||
return 1;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user