brbzull0 commented on code in PR #12621:
URL: https://github.com/apache/trafficserver/pull/12621#discussion_r2494063860


##########
include/tscore/ArgParser.h:
##########
@@ -262,6 +310,14 @@ class ArgParser
   void add_description(std::string const &descr);
 
 protected:
+  // Exit handler - throws in test mode, calls exit() otherwise
+  static void do_exit(int code);
+  // Enable test mode - makes do_exit() throw instead of calling exit() for 
unit testing
+  static void set_test_mode(bool test = true);
+
+  // When true, do_exit() throws instead of calling exit()
+  static thread_local bool _test_mode;

Review Comment:
   I was under the impression that catch2 can run tests in parallel, was trying 
to prevent that, but looking around seems it's not(in this case at least). I'll 
remove the thread_local.
   Also, I thought about as member of `ArgParser`, but then I would need to 
pass an instance(ptr) of `ArgParser` to the `Command` class as most(if not all) 
of the `do_exit` calls are made from that(`Command`) class.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to