Skip to content

Changes in greentea-client for uvisor-tests-standalone integration #2702

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ extern const char* GREENTEA_TEST_ENV_LCOV_START;
*/
void GREENTEA_SETUP(const int, const char *);
void GREENTEA_TESTSUITE_RESULT(const int);
void GREENTEA_TESTCASE_START(const char *test_case_name);
void GREENTEA_TESTCASE_FINISH(const char *test_case_name, const size_t passes, const size_t failed);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So these two functions always had an implementation in greentea-client, they were just never exposed via test_env.h?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. That's because of these functions were declared extern in utest and called due to some circular dependency.


/**
* Test suite result related notification API
Expand Down
3 changes: 3 additions & 0 deletions features/frameworks/greentea-client/source/test_env.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ static void greentea_notify_timeout(const int);
static void greentea_notify_hosttest(const char *);
static void greentea_notify_completion(const int);
static void greentea_notify_version();
static void greentea_write_string(const char *str);

/** \brief Handshake with host and send setup data (timeout and host test name)
* \details This function will send preamble to master.
Expand All @@ -72,6 +73,7 @@ void GREENTEA_SETUP(const int timeout, const char *host_test_name) {
char _value[48] = {0};
while (1) {
greentea_parse_kv(_key, _value, sizeof(_key), sizeof(_value));
greentea_write_string("mbedmbedmbedmbedmbedmbedmbedmbed\r\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we are writing this back? I know we write a similar string from htrun, though I admit I'm not sure why :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its not writing back. I have observed multiple times that at the start of test when we start reading serial output from the target. htrun missing few characters. it may received the __sync as {__sync;788234738012347239823}} observe the missing { character in the beginning. By printing this mbedmbed.... it gives time in the beginning of the test. Pretty much the same reason why it is in the other direction.

if (strcmp(_key, GREENTEA_TEST_ENV_SYNC) == 0) {
// Found correct __sunc message
greentea_send_kv(_key, _value);
Expand Down Expand Up @@ -207,6 +209,7 @@ inline void greentea_write_postamble()
{
greentea_serial->putc('}');
greentea_serial->putc('}');
greentea_serial->putc('\r');
greentea_serial->putc('\n');
}

Expand Down