STEP_NAME(Crash)
};
+#define OVERRIDE_STEPS_BLOCK(STEPS) \
+ void STEPS() override { \
+ wgt::WgtInstaller::STEPS(); \
+ if (crash_at_ > -1) \
+ AddStepAtIndex<StepCrash>(crash_at_); \
+ else \
+ AddStep<StepCrash>(); \
+ } \
+
+class CrashWgtInstaller : public wgt::WgtInstaller {
+ public:
+ explicit CrashWgtInstaller(ci::PkgMgrPtr pkgmgr, int crash_at)
+ : wgt::WgtInstaller(pkgmgr), crash_at_(crash_at) { }
+
+ private:
+ OVERRIDE_STEPS_BLOCK(InstallSteps)
+ OVERRIDE_STEPS_BLOCK(UpdateSteps)
+ OVERRIDE_STEPS_BLOCK(UninstallSteps)
+ OVERRIDE_STEPS_BLOCK(ReinstallSteps)
+ OVERRIDE_STEPS_BLOCK(DeltaSteps)
+ OVERRIDE_STEPS_BLOCK(MoveSteps)
+ OVERRIDE_STEPS_BLOCK(RecoverySteps)
+ OVERRIDE_STEPS_BLOCK(MountInstallSteps)
+ OVERRIDE_STEPS_BLOCK(MountUpdateSteps)
+ OVERRIDE_STEPS_BLOCK(ManifestDirectInstallSteps)
+ OVERRIDE_STEPS_BLOCK(ManifestDirectUpdateSteps)
+ OVERRIDE_STEPS_BLOCK(ManifestPartialInstallSteps)
+ OVERRIDE_STEPS_BLOCK(ManifestPartialUpdateSteps)
+ OVERRIDE_STEPS_BLOCK(PartialUninstallSteps)
+ OVERRIDE_STEPS_BLOCK(ReadonlyUpdateInstallSteps)
+ OVERRIDE_STEPS_BLOCK(ReadonlyUpdateUninstallSteps)
+ OVERRIDE_STEPS_BLOCK(DisablePkgSteps)
+ OVERRIDE_STEPS_BLOCK(EnablePkgSteps)
+ OVERRIDE_STEPS_BLOCK(MigrateExtImgSteps)
+ OVERRIDE_STEPS_BLOCK(RecoverDBSteps)
+
+ int crash_at_;
+};
+
} // namespace
// this main of test binay in done purely for recovery smoke test.
return EINVAL;
}
- wgt::WgtInstaller installer(pkgmgr);
- if (index != -1) {
- installer.AddStepAtIndex<StepCrash>(index);
- } else {
- installer.AddStep<StepCrash>();
- }
+ ::CrashWgtInstaller installer(pkgmgr, index);
return (installer.Run() == ci::AppInstaller::Result::OK) ? 0 : 1;
}