# HG changeset patch # User jld # Date 1044893770 0 # Node ID f2d369dad95f625c7bff9a0e4ec8322afdb8fd18 # Parent e2b797ca39b40978389cb6b74e53e8b790222fdf * standalone/wxwin/runtestsdlg.cpp, standalone/wxwin/runtestsdlg.h: Call the "Reset Board" message box in the primary thread rather than the worker thread for correct operation under Linux. diff --git a/host/tools/configtool/ChangeLog b/host/tools/configtool/ChangeLog --- a/host/tools/configtool/ChangeLog +++ b/host/tools/configtool/ChangeLog @@ -1,3 +1,10 @@ +2003-02-10 John Dallaway + + * standalone/wxwin/runtestsdlg.cpp, + standalone/wxwin/runtestsdlg.h: + Call the "Reset Board" message box in the primary thread rather than + the worker thread for correct operation under Linux. + 2003-02-05 John Dallaway * standalone/wxwin/configtooldoc.cpp, diff --git a/host/tools/configtool/standalone/wxwin/runtestsdlg.cpp b/host/tools/configtool/standalone/wxwin/runtestsdlg.cpp --- a/host/tools/configtool/standalone/wxwin/runtestsdlg.cpp +++ b/host/tools/configtool/standalone/wxwin/runtestsdlg.cpp @@ -121,7 +121,6 @@ ecRunTestsDialog::ecRunTestsDialog(wxWin m_runStatus(ecStopped), m_nNextToSubmit(-1), m_pResource(NULL), - m_nTestsToComplete(0), m_testsAreComplete(FALSE) { m_runTestsDialog = this; @@ -360,10 +359,10 @@ void ecRunTestsDialog::OnRun(wxCommandEv m_nNextToSubmit=0; m_output->AddLogMsg(_("Run started")); - + SubmitTests(); } - } + } } wxString ecRunTestsDialog::TranslatePort(const wxString& port) const @@ -387,15 +386,23 @@ wxString ecRunTestsDialog::TranslatePort void ecRunTestsDialog::SubmitTests() { + int iTest; int nResources=wxGetApp().GetSettings().GetRunTestsSettings().m_bRemote ? wxMax(1,CTestResource::GetMatchCount (m_ep)):1; if(nResources>CeCosTest::InstanceCount){ - if(m_nNextToSubmit >= m_executables->SelectedTestCount()){ + if (m_nNextToSubmit >= m_executables->SelectedTestCount()){ + m_runStatus = ecStopped; + + wxButton* runButton = (wxButton*) FindWindow(ecID_RUN_TESTS_RUN); + runButton->SetLabel(_("&Run")); + m_output->AddLogMsg(_("Run complete")); + + delete m_pResource; + m_pResource=0; return; } ecRunTestsInfo *pInfo=new ecRunTestsInfo; pInfo->pTest=new CeCosTest(m_ep, m_executables->SelectedTest(m_nNextToSubmit++)); pInfo->pSheet=this; - m_nTestsToComplete++; if(wxGetApp().GetSettings().GetRunTestsSettings().m_bRemote){ CeCosThreadUtils::RunThread(RunRemoteFunc,pInfo, (CeCosThreadUtils::CallbackProc*) RunCallback,_T("RunRemoteFunc")); } else { @@ -431,6 +438,8 @@ void ecRunTestsDialog::SubmitTests() } } if(bRun){ + if (1 < m_nNextToSubmit) + m_output->AddLogMsg(_("Run continuing")); CeCosThreadUtils::RunThread(RunLocalFunc, pInfo, (CeCosThreadUtils::CallbackProc*) RunCallback,_T("RunLocalFunc")); } } @@ -482,25 +491,17 @@ void ecRunTestsDialog::RunCallback(void ecRunTestsInfo *pInfo=(ecRunTestsInfo *)pParam; ecRunTestsDialog *pSheet=pInfo->pSheet; if (m_runTestsDialog) // Will be NULL if dialog has been closed & deleted - { + { CeCosTest *pTest=pInfo->pTest; pInfo->pSheet->m_CS.Enter(); - + pSheet->m_summary->AddResult(pTest); delete pTest; - - pSheet->m_nTestsToComplete--; - pSheet->SubmitTests(); - - if(0==pSheet->m_nTestsToComplete) - { - delete pSheet->m_pResource; - pSheet->m_pResource=0; - // OnIdle will check this variable and reset the status and button label - pSheet->m_testsAreComplete = TRUE; - } + // OnIdle will check this variable and reset the status and button label + pSheet->m_testsAreComplete = TRUE; + pInfo->pSheet->m_CS.Leave(); } delete pInfo; @@ -513,13 +514,7 @@ void ecRunTestsDialog::OnIdle(wxIdleEven if (m_testsAreComplete) { m_testsAreComplete = FALSE; - - m_runStatus = ecStopped; - - wxButton* runButton = (wxButton*) FindWindow(ecID_RUN_TESTS_RUN); - runButton->SetLabel(_("&Run")); - - m_output->AddLogMsg(_("Run complete")); + SubmitTests(); } event.Skip(); diff --git a/host/tools/configtool/standalone/wxwin/runtestsdlg.h b/host/tools/configtool/standalone/wxwin/runtestsdlg.h --- a/host/tools/configtool/standalone/wxwin/runtestsdlg.h +++ b/host/tools/configtool/standalone/wxwin/runtestsdlg.h @@ -138,7 +138,6 @@ protected: int m_nNextToSubmit; CTestResource* m_pResource; CProperties m_prop; - int m_nTestsToComplete; wxCriticalSection m_CS; static ecRunTestsDialog* m_runTestsDialog; bool m_testsAreComplete;