1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 04:52:59 +01:00

Merge pull request #14661 from bergzand/pr/tests/bench/Add_ticks_result

This commit is contained in:
Kaspar Schleiser 2020-08-06 13:50:11 +02:00 committed by GitHub
commit 70610b3d8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 40 additions and 10 deletions

View File

@ -19,6 +19,7 @@
*/
#include <stdio.h>
#include "macros/units.h"
#include "thread.h"
#include "msg.h"
@ -75,7 +76,12 @@ int main(void)
n++;
}
printf("{ \"result\" : %"PRIu32" }\n", n);
printf("{ \"result\" : %"PRIu32, n);
#ifdef CLOCK_CORECLOCK
printf(", \"ticks\" : %"PRIu32,
(uint32_t)((TEST_DURATION/US_PER_MS) * (CLOCK_CORECLOCK/KHZ(1)))/n);
#endif
puts(" }");
return 0;
}

View File

@ -12,7 +12,7 @@ from testrunner import run
def testfunc(child):
child.expect(r"{ \"result\" : \d+ }")
child.expect(r"{ \"result\" : \d+(, \"ticks\" : \d+)? }")
if __name__ == "__main__":

View File

@ -20,6 +20,7 @@
#include <stdio.h>
#include "macros/units.h"
#include "mutex.h"
#include "thread.h"
#include "xtimer.h"
@ -78,7 +79,12 @@ int main(void)
n++;
}
printf("{ \"result\" : %"PRIu32" }\n", n);
printf("{ \"result\" : %"PRIu32, n);
#ifdef CLOCK_CORECLOCK
printf(", \"ticks\" : %"PRIu32,
(uint32_t)((TEST_DURATION/US_PER_MS) * (CLOCK_CORECLOCK/KHZ(1)))/n);
#endif
puts(" }");
return 0;
}

View File

@ -12,7 +12,7 @@ from testrunner import run
def testfunc(child):
child.expect(r"{ \"result\" : \d+ }")
child.expect(r"{ \"result\" : \d+(, \"ticks\" : \d+)? }")
if __name__ == "__main__":

View File

@ -19,6 +19,7 @@
*/
#include <stdio.h>
#include "macros/units.h"
#include "thread.h"
#include "xtimer.h"
@ -51,7 +52,12 @@ int main(void)
n++;
}
printf("{ \"result\" : %"PRIu32" }\n", n);
printf("{ \"result\" : %"PRIu32, n);
#ifdef CLOCK_CORECLOCK
printf(", \"ticks\" : %"PRIu32,
(uint32_t)((TEST_DURATION/US_PER_MS) * (CLOCK_CORECLOCK/KHZ(1)))/n);
#endif
puts(" }");
return 0;
}

View File

@ -12,7 +12,7 @@ from testrunner import run
def testfunc(child):
child.expect(r"{ \"result\" : \d+ }")
child.expect(r"{ \"result\" : \d+(, \"ticks\" : \d+)? }")
if __name__ == "__main__":

View File

@ -19,6 +19,7 @@
*/
#include <stdio.h>
#include "macros/units.h"
#include "thread.h"
#include "thread_flags.h"
@ -74,7 +75,12 @@ int main(void)
n++;
}
printf("{ \"result\" : %"PRIu32" }\n", n);
printf("{ \"result\" : %"PRIu32, n);
#ifdef CLOCK_CORECLOCK
printf(", \"ticks\" : %"PRIu32,
(uint32_t)((TEST_DURATION/US_PER_MS) * (CLOCK_CORECLOCK/KHZ(1)))/n);
#endif
puts(" }");
return 0;
}

View File

@ -12,7 +12,7 @@ from testrunner import run
def testfunc(child):
child.expect(r"{ \"result\" : \d+ }")
child.expect(r"{ \"result\" : \d+(, \"ticks\" : \d+)? }")
if __name__ == "__main__":

View File

@ -20,6 +20,7 @@
#include <stdio.h>
#include "macros/units.h"
#include "thread.h"
#include "xtimer.h"
@ -71,7 +72,12 @@ int main(void)
n++;
}
printf("{ \"result\" : %"PRIu32" }\n", n);
printf("{ \"result\" : %"PRIu32, n);
#ifdef CLOCK_CORECLOCK
printf(", \"ticks\" : %"PRIu32,
(uint32_t)((TEST_DURATION/US_PER_MS) * (CLOCK_CORECLOCK/KHZ(1)))/n);
#endif
puts(" }");
return 0;
}

View File

@ -12,7 +12,7 @@ from testrunner import run
def testfunc(child):
child.expect(r"{ \"result\" : \d+ }")
child.expect(r"{ \"result\" : \d+(, \"ticks\" : \d+)? }")
if __name__ == "__main__":