Hello. I want to create a PERL script to convert something like this into XML, with logical headers.
acc_BM: C:\work\workspace\ACC-8.6.0\TAM\plugins\BswM_TS_TxDxM1I14R0\sr
+c\BswM.c, 31: warning: redundant redeclaration of 'Com_MainFunctionRx
+' [-Wredundant-decls] (included from C:/work/workspace/ACG-8.6.0/TAM/
+plugins/Com_TS_TxDxM6I3R0/include/Com_Api_Static.h, line 1092)
extern FUNC(void, COM_CODE) Com_MainFunctionRx
^~~~~~~~~~~~~~~~~~, TestSequences: SwInt_
+ConTest_TestInt_ATS_MODE_ECUM SwInt_ConTest_TestInt_ATS_MODE_RestartE
+CUM
acc_BC: C:\work\workspace\ACC-8.6.0\tests\Conformance\IN\SwInt_ConTest
+_CS_Rte_SomeIpXf_Com_p0\output\generated\src\Com_Lcfg.c, 40: warning:
+ redundant redeclaration of 'Com_MainFunctionTx' [-Wredundant-decls]
+(included from C:/work/workspace/ACG-8.6.0/TAM/plugins/Com_TS_TxDxM6I
+3R0/include/Com_Api_Static.h, line 833)
extern FUNC(void, COM_CODE) Com_MainFunctionTx
^~~~~~~~~~~~~~~~~~, TestSequences: SwInt_
+ConTest_CS_Rte_SomeIpXf_Com_p0
So the steps would be:
- To read all the .txt file(on all lines) that contains that data
- To create a blank abc.xml document
- To define the XML schema with tags like Module, Path, Warning, Test Sequence
- To populate with data the new created .xml file , so it should look like that:
<Warnings>
<Module>acc_BM</Module>
<Path>C:\work\workspace\ACC-8.6.0\TAM\plugins\BswM_TS_TxDxM1I14R0
+\src\BswM.c</Path>
<warning>redundant redeclaration of 'Com_MainFunctionRx' [-Wredun
+dant-decls] (included from C:/work/workspace/ACG-
8.6.0/TAM/plugins/Com_TS_TxDxM6I3R0/include/Com_Api_Static.h, li
+ne 1092)
extern FUNC(void, COM_CODE) Com_MainFunctionRx</warning>
<TestSequence>SwInt_ConTest_TestInt_ATS_MODE_ECUM SwInt_ConTest_T
+estInt_ATS_MODE_RestartECUM
acc_BC: C:\work\workspace\ACC-8.6.0\tests\Conformance\IN\SwInt_C
+onTest_CS_Rte_SomeIpXf_Com_p0\output\generated\src\Com_Lcfg.c</TestSe
+quence>
</Warnings>
It has to be smart, to be self adjust, because for example on test sequences, the names will vary, but will be like XXX.c