#include <signal.h>
-#if defined(HAVE_CURL_CURL_H) && HAVE_CURL_CURL_H
-#include <curl/curl.h>
-#endif
-
#ifndef __INTEL_COMPILER
#pragma GCC diagnostic ignored "-Wold-style-cast"
#endif
return s + us;
}
-static void cleanup_curl(void)
-{
-#if defined(HAVE_CURL_CURL_H) && HAVE_CURL_CURL_H
- curl_global_cleanup();
-#endif
-}
-
#include <getopt.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
-#if defined(HAVE_CURL_CURL_H) && HAVE_CURL_CURL_H
- if (curl_global_init(CURL_GLOBAL_ALL))
- {
- Error << "curl_global_init(CURL_GLOBAL_ALL) failed";
- return EXIT_FAILURE;
- }
-#endif
-
- if (atexit(cleanup_curl))
- {
- Error << "atexit() failed";
- return EXIT_FAILURE;
- }
-
bool opt_repeat= false;
+ bool opt_quiet= false;
std::string collection_to_run;
// Options parsing
enum long_option_t {
OPT_LIBYATL_VERSION,
OPT_LIBYATL_MATCH_COLLECTION,
+ OPT_LIBYATL_QUIET,
OPT_LIBYATL_REPEAT
};
static struct option long_options[]=
{
- {"repeat", no_argument, NULL, OPT_LIBYATL_REPEAT},
- {"collection", required_argument, NULL, OPT_LIBYATL_MATCH_COLLECTION},
- {0, 0, 0, 0}
+ { "version", no_argument, NULL, OPT_LIBYATL_VERSION },
+ { "quiet", no_argument, NULL, OPT_LIBYATL_QUIET },
+ { "repeat", no_argument, NULL, OPT_LIBYATL_REPEAT },
+ { "collection", required_argument, NULL, OPT_LIBYATL_MATCH_COLLECTION },
+ { 0, 0, 0, 0 }
};
int option_index= 0;
case OPT_LIBYATL_VERSION:
break;
+ case OPT_LIBYATL_QUIET:
+ opt_quiet= true;
+ break;
+
case OPT_LIBYATL_REPEAT:
opt_repeat= true;
break;
srandom((unsigned int)time(NULL));
- if (getenv("LIBTEST_QUIET") and strcmp(getenv("LIBTEST_QUIET"), "0") == 0)
+ int repeat;
+ if (bool(getenv("YATL_REPEAT")) and (repeat= atoi(getenv("YATL_REPEAT"))))
{
- close(STDOUT_FILENO);
+ opt_repeat= true;
+ }
+
+ if ((getenv("YATL_QUIET") and strcmp(getenv("YATL_QUIET"), "0") == 0) or opt_quiet)
+ {
+ opt_quiet= true;
}
else if (getenv("JENKINS_URL"))
+ {
+ if (getenv("YATL_QUIET") and strcmp(getenv("YATL_QUIET"), "1") == 0)
+ { }
+ else
+ {
+ opt_quiet= true;
+ }
+ }
+
+ if (opt_quiet)
{
close(STDOUT_FILENO);
}
fatal_assert(sigignore(SIGPIPE) == 0);
libtest::SignalThread signal;
- if (not signal.setup())
+ if (signal.setup() == false)
{
Error << "Failed to setup signals";
return EXIT_FAILURE;
}
}
+ catch (libtest::fatal &e)
+ {
+ Error << "Fatal exception was thrown: " << e.what();
+ return_code= TEST_FAILURE;
+ }
catch (std::exception &e)
{
Error << "Exception was thrown: " << e.what();
{
std::cerr << e.what() << std::endl;
}
- catch (std::bad_alloc& e)
+ catch (std::exception& e)
{
std::cerr << e.what() << std::endl;
}
catch (...)
{
- std::cerr << "Unknown exception halted execution" << std::endl;
+ std::cerr << "Unknown exception halted execution." << std::endl;
}
return exit_code;