-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGherkinLibraryHoldPickupDeadline.cpp
More file actions
23 lines (20 loc) · 1.02 KB
/
Copy pathGherkinLibraryHoldPickupDeadline.cpp
File metadata and controls
23 lines (20 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "LibrarySteps.hpp"
#include "LoadFeatureFile.hpp"
// Hold pickup deadline scenario with @timeout annotation: demonstrates how a
// Scenario tagged with @timeout:<value><unit> (unit required: s/ms/m, e.g.
// @timeout:2s) cooperatively checks elapsed time before each step starts, and
// fails that step and all subsequent ones immediately if the deadline has
// already been exceeded. This is a realistic fast-completing hold-fulfillment
// scenario (no artificial sleeps) where all steps execute well within the
// 2-second service window, demonstrating the annotation declaratively on a
// normal passing test rather than as a deliberate-failure demo.
//
// The scenario text lives in examples/gherkin/features/
// library_hold_pickup_deadline.feature, read from disk via
// LoadFeatureFile() - see GherkinBakeryStandardOrder.cpp's comment for why.
StepRegistry PrepareRegistry() {
return MakeLibraryStepRegistry();
}
int main() {
return RunFeatureFromFile(PrepareRegistry(), "library_hold_pickup_deadline.feature");
}