Commit c744d2d0 authored by Grzegorz Daniluk's avatar Grzegorz Daniluk

smartbits-tester: force stop all tests

parent c7316230
......@@ -6,6 +6,7 @@
#include "smartbits.h"
#include "tests_body.h"
extern int force_stop;
/**********************************************************************/
......@@ -261,13 +262,18 @@ int detect_stop(void)
{
fd_set fds;
struct timeval tv;
int ret;
FD_ZERO(&fds);
FD_SET(0, &fds);
tv.tv_sec = 0;
tv.tv_usec = 500000;
return select(1, &fds, NULL, NULL, &tv);
ret = select(1, &fds, NULL, NULL, &tv);
if(ret > 0 && getchar() == 'q') force_stop = 1;
return ret;
}
......
......@@ -11,6 +11,8 @@
#include "tests_body.h"
#include "switch_config.h"
int force_stop;
int main()
{
FILE *logfile;
......@@ -55,7 +57,9 @@ int main()
return -1;
}
for(test_no=TEST_3_3_1; test_no<=TEST_3_3_2; ++test_no) {
force_stop = 0;
for(test_no=TEST_3_1_4; test_no<=TEST_3_3_2; ++test_no) {
//for(test_no=TEST_3_1_1; test_no<TEST_3_3_2+1; ++test_no) {
//for(test_no=TEST_3_1_4; test_no<TEST_3_1_4+1; ++test_no) {
//test_no = TEST_2_2_2;
......@@ -71,6 +75,7 @@ int main()
++t_fail;
break;
}
if (force_stop) break;
NSDelay(5);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment