⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testrunnerapp.cpp

📁 c++单元测试框架
💻 CPP
字号:
/////////////////////////////////////////////////////////////////////////////// Name:        TestRunnerApp.cpp// Purpose:     Skeleton implementation of a derived wxApp// Author:      Julian Smart// Modified by: Anthon Pang// Created:     2003.09.11// RCS-ID:// Copyright:   (C) 2003 by Julian Smart// Licence:     LGPL// Reference:   wxWidgets/samples/minimal/minimal.cpp/////////////////////////////////////////////////////////////////////////////// ============================================================================// declarations// ============================================================================// ----------------------------------------------------------------------------// headers// ----------------------------------------------------------------------------// For compilers that support precompilation, includes "wx/wx.h".#include <wx/wxprec.h>#ifdef __BORLANDC__#   pragma hdrstop#endif// for all others, include the necessary headers (this file is usually all you// need because it includes almost all "standard" wxWidgets headers)#ifndef WX_PRECOMP#   include <wx/wx.h>#endif// ----------------------------------------------------------------------------// private classes// ----------------------------------------------------------------------------// Define a new application type, each program should derive a class from wxAppclass MyApp : public wxApp{public:    // override base class virtuals    // ----------------------------    // this one is called on application startup and is a good place for the app    // initialization (doing it here and not in the ctor allows to have an error    // return: if OnInit() returns false, the application terminates)    virtual bool OnInit();    // called after destroying all application windows and controls, but before wxWidgets cleanup    virtual int OnExit();};// ----------------------------------------------------------------------------// event tables and other macros for wxWidgets// ----------------------------------------------------------------------------// Create a new application object: this macro will allow wxWidgets to create// the application object during program execution (it's better than using a// static object for many reasons) and also implements the accessor function// wxGetApp() which will return the reference of the right type (i.e. MyApp and// not wxApp)IMPLEMENT_APP(MyApp)// ============================================================================// implementation// ============================================================================// ----------------------------------------------------------------------------// the application class// ----------------------------------------------------------------------------// 'Main program' equivalent: the program execution "starts" herebool MyApp::OnInit(){    // the base method parses the command line    if (! wxApp::OnInit())  return FALSE;    // invoke test runner    extern void RunTests(void);    RunTests();    // success: wxApp::OnRun() will be called which will enter the main message    // loop and the application will run. If we returned FALSE here, the    // application would exit immediately.    return TRUE;}int MyApp::OnExit(){    return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -