1*234bd5c5SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*234bd5c5SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*234bd5c5SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*234bd5c5SAndrew Rist * distributed with this work for additional information 6*234bd5c5SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*234bd5c5SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*234bd5c5SAndrew Rist * "License"); you may not use this file except in compliance 9*234bd5c5SAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*234bd5c5SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*234bd5c5SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*234bd5c5SAndrew Rist * software distributed under the License is distributed on an 15*234bd5c5SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*234bd5c5SAndrew Rist * KIND, either express or implied. See the License for the 17*234bd5c5SAndrew Rist * specific language governing permissions and limitations 18*234bd5c5SAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*234bd5c5SAndrew Rist *************************************************************/ 21*234bd5c5SAndrew Rist 22*234bd5c5SAndrew Rist 23cdf0e10cSrcweir #ifndef _BASIC_TESTTOOL_HXX_ 24cdf0e10cSrcweir #define _BASIC_TESTTOOL_HXX_ 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include <svl/smplhint.hxx> 27cdf0e10cSrcweir #include <tools/string.hxx> 28cdf0e10cSrcweir 29cdf0e10cSrcweir #define TESTTOOL_DEFAULT_PORT 12479 30cdf0e10cSrcweir #define UNO_DEFAULT_PORT 12480 31cdf0e10cSrcweir #define DEFAULT_HOST "localhost" 32cdf0e10cSrcweir 33cdf0e10cSrcweir #define TT_SIGNATURE_FOR_UNICODE_TEXTFILES "'encoding UTF-8 Do not remove or change this line!" 34cdf0e10cSrcweir 35cdf0e10cSrcweir #define ASSERTION_STACK_PREFIX "Backtrace:" 36cdf0e10cSrcweir 37cdf0e10cSrcweir // #94145# Due to a tab in TT_SIGNATURE_FOR_UNICODE_TEXTFILES which is changed to blanks by some editors 38cdf0e10cSrcweir // this routine became necessary 39cdf0e10cSrcweir sal_Bool IsTTSignatureForUnicodeTextfile( String aLine ); 40cdf0e10cSrcweir 41cdf0e10cSrcweir //#include "testapp.hxx" 42cdf0e10cSrcweir #define ADD_ERROR_QUIET(nNr, aStr) \ 43cdf0e10cSrcweir { \ 44cdf0e10cSrcweir ErrorEntry *pErr; \ 45cdf0e10cSrcweir if ( BasicRuntimeAccess::HasRuntime() ) \ 46cdf0e10cSrcweir { \ 47cdf0e10cSrcweir BasicRuntime aRun = BasicRuntimeAccess::GetRuntime(); \ 48cdf0e10cSrcweir xub_StrLen aErrLn = StarBASIC::GetErl(); \ 49cdf0e10cSrcweir if ( 0 == aErrLn ) \ 50cdf0e10cSrcweir aErrLn = aRun.GetLine(); \ 51cdf0e10cSrcweir pErr = new ErrorEntry(nNr, aStr, \ 52cdf0e10cSrcweir aErrLn, aRun.GetCol1(), aRun.GetCol2()); \ 53cdf0e10cSrcweir } \ 54cdf0e10cSrcweir else \ 55cdf0e10cSrcweir { \ 56cdf0e10cSrcweir pErr = new ErrorEntry(nNr, aStr); \ 57cdf0e10cSrcweir } \ 58cdf0e10cSrcweir P_FEHLERLISTE->C40_INSERT(ErrorEntry, pErr, P_FEHLERLISTE->Count());\ 59cdf0e10cSrcweir } 60cdf0e10cSrcweir // ??? Irgendwann noch was mit der UID anfangen !! 61cdf0e10cSrcweir #define ADD_ERROR(nNr, aStr) { \ 62cdf0e10cSrcweir if ( !SbxBase::IsError() ) \ 63cdf0e10cSrcweir SbxBase::SetError( nNr ); \ 64cdf0e10cSrcweir ADD_ERROR_QUIET(nNr, aStr); \ 65cdf0e10cSrcweir } 66cdf0e10cSrcweir 67cdf0e10cSrcweir #define POP_ERROR() P_FEHLERLISTE->DeleteAndDestroy(0) 68cdf0e10cSrcweir #define GET_ERROR() P_FEHLERLISTE->GetObject(0) 69cdf0e10cSrcweir #define IS_ERROR() ( P_FEHLERLISTE->Count() > 0 ) 70cdf0e10cSrcweir 71cdf0e10cSrcweir // Transmission of error logs 72cdf0e10cSrcweir enum TTLogType { LOG_RUN, LOG_TEST_CASE, LOG_ERROR, LOG_CALL_STACK, LOG_MESSAGE, LOG_WARNING, LOG_ASSERTION, LOG_QA_ERROR, LOG_ASSERTION_STACK }; 73cdf0e10cSrcweir 74cdf0e10cSrcweir struct TTDebugData 75cdf0e10cSrcweir { 76cdf0e10cSrcweir public: 77cdf0e10cSrcweir TTLogType aLogType; 78cdf0e10cSrcweir String aMsg; 79cdf0e10cSrcweir String aFilename; 80cdf0e10cSrcweir xub_StrLen nLine; 81cdf0e10cSrcweir xub_StrLen nCol1; 82cdf0e10cSrcweir xub_StrLen nCol2; 83cdf0e10cSrcweir }; 84cdf0e10cSrcweir 85cdf0e10cSrcweir struct TTLogMsg 86cdf0e10cSrcweir { 87cdf0e10cSrcweir public: 88cdf0e10cSrcweir String aLogFileName; 89cdf0e10cSrcweir TTDebugData aDebugData; 90cdf0e10cSrcweir }; 91cdf0e10cSrcweir 92cdf0e10cSrcweir // For transmission of window information from the Testapp 93cdf0e10cSrcweir struct WinInfoRec 94cdf0e10cSrcweir { 95cdf0e10cSrcweir public: 96cdf0e10cSrcweir String aUId; 97cdf0e10cSrcweir String aKurzname; 98cdf0e10cSrcweir String aSlotname; 99cdf0e10cSrcweir String aLangname; 100cdf0e10cSrcweir sal_uInt16 nRType; 101cdf0e10cSrcweir String aRName; 102cdf0e10cSrcweir sal_Bool bIsReset; 103cdf0e10cSrcweir }; 104cdf0e10cSrcweir 105cdf0e10cSrcweir // Defines for syntax Highlighting 106cdf0e10cSrcweir #define TT_KEYWORD ((SbTextType)100) // Including locally executed commands like 'use' ... 107cdf0e10cSrcweir #define TT_REMOTECMD ((SbTextType)101) // Remotely executed commands like 'nodebug' 108cdf0e10cSrcweir #define TT_LOCALCMD ((SbTextType)102) // Locally executed commands like 'use' 109cdf0e10cSrcweir #define TT_CONTROL ((SbTextType)103) // Possibly available control loaded by 'use' 110cdf0e10cSrcweir #define TT_SLOT ((SbTextType)104) // Available Slots loaded by 'use' 111cdf0e10cSrcweir #define TT_METHOD ((SbTextType)105) // Possibly allowed Method for controls 112cdf0e10cSrcweir #define TT_NOMETHOD ((SbTextType)106) // No Possibly allowed Method for controls 113cdf0e10cSrcweir 114cdf0e10cSrcweir #define FILELIST1 ((SbTextType)111) // Symbols in file 1 115cdf0e10cSrcweir #define FILELIST2 ((SbTextType)112) // Symbols in file 2 116cdf0e10cSrcweir #define FILELIST3 ((SbTextType)113) // Symbols in file 3 117cdf0e10cSrcweir #define FILELIST4 ((SbTextType)114) // Symbols in file 4 118cdf0e10cSrcweir 119cdf0e10cSrcweir /// defines for hints from TestToolObj to the Application 120cdf0e10cSrcweir #define SBX_HINT_LANGUAGE_EXTENSION_LOADED SFX_HINT_USER06 121cdf0e10cSrcweir #define SBX_HINT_EXECUTION_STATUS_INFORMATION SFX_HINT_USER07 122cdf0e10cSrcweir 123cdf0e10cSrcweir #define TT_EXECUTION_ENTERWAIT 0x01 124cdf0e10cSrcweir #define TT_EXECUTION_LEAVEWAIT 0x02 125cdf0e10cSrcweir #define TT_EXECUTION_SHOW_ACTION 0x03 126cdf0e10cSrcweir #define TT_EXECUTION_HIDE_ACTION 0x04 127cdf0e10cSrcweir 128cdf0e10cSrcweir class TTExecutionStatusHint : public SfxSimpleHint 129cdf0e10cSrcweir { 130cdf0e10cSrcweir private: 131cdf0e10cSrcweir sal_uInt16 mnType; 132cdf0e10cSrcweir String maExecutionStatus; 133cdf0e10cSrcweir String maAdditionalExecutionStatus; 134cdf0e10cSrcweir 135cdf0e10cSrcweir public: 136cdf0e10cSrcweir TYPEINFO(); TTExecutionStatusHint(sal_uInt16 nType,sal_Char * pExecutionStatus,const sal_Char * pAdditionalExecutionStatus="")137cdf0e10cSrcweir TTExecutionStatusHint( sal_uInt16 nType, sal_Char *pExecutionStatus, const sal_Char *pAdditionalExecutionStatus = "" ) 138cdf0e10cSrcweir : SfxSimpleHint(SBX_HINT_EXECUTION_STATUS_INFORMATION) 139cdf0e10cSrcweir , mnType( nType ) 140cdf0e10cSrcweir , maExecutionStatus( pExecutionStatus, RTL_TEXTENCODING_ASCII_US ) 141cdf0e10cSrcweir , maAdditionalExecutionStatus( pAdditionalExecutionStatus, RTL_TEXTENCODING_ASCII_US ) 142cdf0e10cSrcweir {;} 143cdf0e10cSrcweir TTExecutionStatusHint(sal_uInt16 nType,const String & aExecutionStatus=String (),const String & aAdditionalExecutionStatus=String ())144cdf0e10cSrcweir TTExecutionStatusHint( sal_uInt16 nType, const String &aExecutionStatus = String(), const String &aAdditionalExecutionStatus = String() ) 145cdf0e10cSrcweir : SfxSimpleHint(SBX_HINT_EXECUTION_STATUS_INFORMATION) 146cdf0e10cSrcweir , mnType( nType ) 147cdf0e10cSrcweir , maExecutionStatus( aExecutionStatus ) 148cdf0e10cSrcweir , maAdditionalExecutionStatus( aAdditionalExecutionStatus ) 149cdf0e10cSrcweir {;} 150cdf0e10cSrcweir GetExecutionStatus() const151cdf0e10cSrcweir const String& GetExecutionStatus() const { return maExecutionStatus; } GetAdditionalExecutionStatus() const152cdf0e10cSrcweir const String& GetAdditionalExecutionStatus() const { return maAdditionalExecutionStatus; } GetType()153cdf0e10cSrcweir sal_uInt16 GetType(){ return mnType; } 154cdf0e10cSrcweir }; 155cdf0e10cSrcweir 156cdf0e10cSrcweir #endif // _BASIC_TESTTOOL_HXX_ 157