kunit_notifier.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * kunit_notifier.h
  3. */
  4. #include <linux/notifier.h>
  5. extern int register_kunit_notifier(struct notifier_block *nb);
  6. extern int unregister_kunit_notifier(struct notifier_block *nb);
  7. /*
  8. extern struct kunit_suite abc_hub_test_module;
  9. extern struct kunit_suite abc_common_test_module;
  10. extern struct kunit_suite abc_spec_type1_test_module;
  11. */
  12. extern struct kunit_suite sec_battery_test_module;
  13. extern struct kunit_suite sec_adc_test_module;
  14. extern struct kunit_suite sec_battery_dt_test_module;
  15. extern struct kunit_suite sec_battery_misc__module;
  16. extern struct kunit_suite sec_battery_sysfs_test_module;
  17. extern struct kunit_suite sec_battery_thermal_test_module;
  18. extern struct kunit_suite sec_battery_ttf_test_module;
  19. extern struct kunit_suite sec_battery_vote_test_module;
  20. extern struct kunit_suite sec_battery_wc_test_module;
  21. extern struct kunit_suite sec_cisd_test_module;
  22. extern struct kunit_suite sec_pd_test_module;
  23. extern struct kunit_suite sec_step_charging_test_module;
  24. #ifdef CONFIG_REGULATOR_S2DOS07
  25. extern struct kunit_suite s2dos07_test_module;
  26. #endif
  27. #ifdef CONFIG_REGULATOR_S2MPB03
  28. extern struct kunit_suite s2mpb03_test_module;
  29. #endif
  30. // FIX ME
  31. //extern struct kunit_suite usb_typec_manager_notifier_test_module;
  32. //extern struct kunit_suite sec_cmd_test_module;
  33. /*
  34. * kunit_notifier_chain_init() - initialize kunit notifier for module built
  35. */
  36. #define kunit_notifier_chain_init(module) \
  37. extern struct kunit_suite module; \
  38. static int kunit_run_notify_##module(struct notifier_block *self, \
  39. unsigned long event, void *data) \
  40. { \
  41. if (kunit_run_tests((struct kunit_suite *)&module)) { \
  42. pr_warn("kunit error: %s\n", module.name); \
  43. return NOTIFY_BAD; \
  44. } \
  45. return NOTIFY_OK; \
  46. } \
  47. static struct notifier_block callchain_notifier_##module = { \
  48. .notifier_call = kunit_run_notify_##module, \
  49. };
  50. #define kunit_notifier_chain_register(module) \
  51. register_kunit_notifier(&callchain_notifier_##module);
  52. #define kunit_notifier_chain_unregister(module) \
  53. unregister_kunit_notifier(&callchain_notifier_##module);