You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As shown above, linking statically does not run the tests. This is probably not a TUT issue, and I'm probably not using this correctly. Does this have something to do with the statictest_runner_singleton? I tried pulling in the runner from main.C into m1.C and m2.C as extern but without luck. How do I ensure that tests defined in different compilation units register with the same runner that's (potentially) defined in another file? (And why does it register with the correct runner linking dynamically, but not statically?)
The text was updated successfully, but these errors were encountered:
I guess when ALL objects, that reference the runner, are visible to the linker in a single command, instead of going through intermediate .a archives, it finds the correct global runner. If anyone finds this and interested in the change this entails in a larger code, see quinoacomputing/quinoa#257.
I'd like to create one test group per source file, however, tests do not run when the runner is statically linked.
Minimal example:
m1.C
m2.C
main.C
Build shared works:
Build static runs no tests:
$ gcc -I. -c m1.C $ gcc -I. -c m2.C $ g++ -I. -c main.C $ ar rcs libm1.a m1.o $ ar rcs libm2.a m2.o $ g++ -static main.C -I. -L. -lm1 -lm2 -o test-static $ file ./test-static ./test-static: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 3.2.0, BuildID[sha1]=cf4782d823ae547ecdccd3ce39f20e5bc1a7edff, not stripped $ ./test-static $
As shown above, linking statically does not run the tests. This is probably not a TUT issue, and I'm probably not using this correctly. Does this have something to do with the
static
test_runner_singleton
? I tried pulling in the runner frommain.C
intom1.C
andm2.C
asextern
but without luck. How do I ensure that tests defined in different compilation units register with the same runner that's (potentially) defined in another file? (And why does it register with the correct runner linking dynamically, but not statically?)The text was updated successfully, but these errors were encountered: