Attention is currently required from: Nico Huber, Edward O'Callaghan, Angel Pons. Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/55295 )
Change subject: tests: Do not run a test if its driver is not built ......................................................................
Patch Set 3:
(1 comment)
File tests/init_shutdown.c:
https://review.coreboot.org/c/flashrom/+/55295/comment/051c6e81_7af70880 PS1, Line 35: #if CONFIG_DUMMY == 1 : void dummy_init_and_shutdown_test_success(void **state) : { : run_lifecycle(state, PROGRAMMER_DUMMY, "bus=parallel+lpc+fwh+spi"); : } : #endif /* CONFIG_DUMMY */
Ok, great, I will rebase and try - and so marking comment unresolved until this is done. […]
I added `if (CONFIG_xxx)` and it seems to work. I did not change any linker flags, but looks like it is enabled by default already, I see `--gc-sections` is present in command line when running ninja test.
One thing that worries me: Makefile uses yes/no values for config options that are enabled/disabled, meson uses 1 instead of yes (and I don't know what it uses instead of no). The conditional `if (CONFIG_xxx)` works when CONFIG_xxx is 1 or 0, but it doesn't compile with yes/no. I was using `-DCONFIG_xxx=0` in tests/meson.build for testing, but I am not sure it represents real-life scenario. Specifically, would it work when CONFIG_xxx is disabled and how do I test it.