Vodafone Test Suite
Dependencies: mbed-rtos mbed HTTPClient VodafoneUSBModem
VodafoneTestCase.h@8:6c30647f75d7, 2012-08-24 (annotated)
- Committer:
- ashleymills
- Date:
- Fri Aug 24 10:35:19 2012 +0000
- Revision:
- 8:6c30647f75d7
- Parent:
- 4:1f8e079924ba
- Child:
- 13:8b69853966f8
Improved the framework so that it automatically logs test times and outcomes.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ashleymills | 2:ea883307d02f | 1 | #pragma once |
ashleymills | 2:ea883307d02f | 2 | #include "VodafoneUSBModem.h" |
ashleymills | 2:ea883307d02f | 3 | #include "LogHeader.h" |
ashleymills | 2:ea883307d02f | 4 | class VodafoneTestCase { |
ashleymills | 2:ea883307d02f | 5 | public: |
ashleymills | 2:ea883307d02f | 6 | VodafoneTestCase(VodafoneUSBModem *m) : _modem(m) { |
ashleymills | 4:1f8e079924ba | 7 | _lastRunTime = 0; |
ashleymills | 3:28336c2e94e4 | 8 | _lastRunOutcome = false; |
ashleymills | 2:ea883307d02f | 9 | } |
ashleymills | 2:ea883307d02f | 10 | |
ashleymills | 4:1f8e079924ba | 11 | bool run() { |
ashleymills | 8:6c30647f75d7 | 12 | _lastRunTime = time(NULL); |
ashleymills | 4:1f8e079924ba | 13 | setupTest(); |
ashleymills | 8:6c30647f75d7 | 14 | _lastRunOutcome = runTest(); |
ashleymills | 8:6c30647f75d7 | 15 | endTest(); |
ashleymills | 8:6c30647f75d7 | 16 | return _lastRunOutcome; |
ashleymills | 4:1f8e079924ba | 17 | } |
ashleymills | 4:1f8e079924ba | 18 | |
ashleymills | 4:1f8e079924ba | 19 | virtual void setupTest() { |
ashleymills | 4:1f8e079924ba | 20 | } |
ashleymills | 4:1f8e079924ba | 21 | |
ashleymills | 4:1f8e079924ba | 22 | virtual bool runTest() { |
ashleymills | 4:1f8e079924ba | 23 | LOG("Base class runTest called!"); |
ashleymills | 4:1f8e079924ba | 24 | return true; |
ashleymills | 4:1f8e079924ba | 25 | } |
ashleymills | 4:1f8e079924ba | 26 | |
ashleymills | 8:6c30647f75d7 | 27 | virtual void endTest() { |
ashleymills | 8:6c30647f75d7 | 28 | |
ashleymills | 4:1f8e079924ba | 29 | } |
ashleymills | 2:ea883307d02f | 30 | |
ashleymills | 2:ea883307d02f | 31 | protected: |
ashleymills | 2:ea883307d02f | 32 | VodafoneUSBModem *_modem; |
ashleymills | 3:28336c2e94e4 | 33 | time_t _lastRunTime; |
ashleymills | 3:28336c2e94e4 | 34 | bool _lastRunOutcome; |
ashleymills | 1:0d63e4db8503 | 35 | }; |