utest.h icon indicating copy to clipboard operation
utest.h copied to clipboard

Support tests on C++ std::string (attempt 2)

Open tekknolagi opened this issue 3 years ago • 1 comments

This is helpful for C++ projects.

tekknolagi avatar Jul 27 '22 21:07 tekknolagi

All these warnings appear when including some STL library, it seems, and they vary by compiler version. I disabled the minimal set, I think.

tekknolagi avatar Jul 29 '22 01:07 tekknolagi

I measure this with/without this change:

neil@MacBook-Air-2 build % hyperfine --warmup 10 "clang++ -I.. ../test/test.cpp -c"
Benchmark 1: clang++ -I.. ../test/test.cpp -c
  Time (mean ± σ):      94.5 ms ±   0.3 ms    [User: 79.5 ms, System: 9.2 ms]
  Range (min … max):    93.7 ms …  95.2 ms    31 runs
 
neil@MacBook-Air-2 build % hyperfine --warmup 10 "clang++ -I.. ../test/test.cpp -c"
Benchmark 1: clang++ -I.. ../test/test.cpp -c
  Time (mean ± σ):     217.2 ms ±   0.4 ms    [User: 197.0 ms, System: 14.3 ms]
  Range (min … max):   216.5 ms … 217.8 ms    13 runs

The second being with this change and adding the expensive <string> include. I don't want all my users to pay 2x the cost of including this header to make C++ string things only slightly nicer, so I'm not gonna accept this PR. Thanks for the interest in the project though!

sheredom avatar Aug 13 '22 07:08 sheredom