summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-10-10 10:41:57 +0200
committerCarl Hetherington <cth@carlh.net>2023-10-10 10:58:39 +0200
commit67ce6dc8ab32efe94141a3516942f0487586b778 (patch)
tree0f806b0db613f89692d609b7bf16f4fdfd0d78d5
parent873d7d8e5013bcd44e82e4372a190735eb0987d4 (diff)
Fix argument parsing on Ubuntu 16.04.v1.8.84
-rw-r--r--test/test.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/test/test.cc b/test/test.cc
index fb8d8a3d..bff647d7 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -91,8 +91,18 @@ struct TestConfig
TestConfig()
{
dcp::init ();
- if (boost::unit_test::framework::master_test_suite().argc >= 2) {
- private_test = boost::unit_test::framework::master_test_suite().argv[1];
+ auto const argc = boost::unit_test::framework::master_test_suite().argc;
+ auto const argv = boost::unit_test::framework::master_test_suite().argv;
+ if (argc >= 3 && strcmp(argv[1], "--") == 0) {
+ /* For some reason on Ubuntu 16.04 the -- we pass in ends up in argv[1] so we
+ * need to get the private_test from argv[2]...
+ */
+ private_test = argv[2];
+ } else if (argc >= 2) {
+ /* ... but everywhere else it's removed, so we can just get the private_test
+ * value from argv[1].
+ */
+ private_test = argv[1];
}
using namespace boost::filesystem;