Test module type support
[reactos.git] / reactos / tools / rbuild / module.cpp
index 57a070e..5fa77ad 100644 (file)
@@ -197,6 +197,8 @@ Module::~Module ()
                delete compilerFlags[i];\r
        for ( i = 0; i < linkerFlags.size(); i++ )\r
                delete linkerFlags[i];\r
+       for ( i = 0; i < stubbedComponents.size(); i++ )\r
+               delete stubbedComponents[i];\r
        if ( pch )\r
                delete pch;\r
 }\r
@@ -215,6 +217,8 @@ Module::ProcessXML()
                compilerFlags[i]->ProcessXML();\r
        for ( i = 0; i < linkerFlags.size(); i++ )\r
                linkerFlags[i]->ProcessXML();\r
+       for ( i = 0; i < stubbedComponents.size(); i++ )\r
+               stubbedComponents[i]->ProcessXML();\r
        non_if_data.ProcessXML();\r
        if ( pch )\r
                pch->ProcessXML();\r
@@ -342,6 +346,11 @@ Module::ProcessXMLSubElement ( const XMLElement& e,
                linkerFlags.push_back ( new LinkerFlag ( project, this, e ) );\r
                subs_invalid = true;\r
        }\r
+       else if ( e.name == "component" )\r
+       {\r
+               stubbedComponents.push_back ( new StubbedComponent ( this, e ) );\r
+               subs_invalid = false;\r
+       }\r
        else if ( e.name == "property" )\r
        {\r
                throw InvalidBuildFileException (\r
@@ -407,6 +416,8 @@ Module::GetModuleType ( const string& location, const XMLAttribute& attribute )
                return BootSector;\r
        if ( attribute.value == "iso" )\r
                return Iso;\r
+       if ( attribute.value == "test" )\r
+               return Test;\r
        throw InvalidAttributeValueException ( location,\r
                                               attribute.name,\r
                                               attribute.value );\r
@@ -439,6 +450,8 @@ Module::GetDefaultModuleExtension () const
                        return ".o";\r
                case Iso:\r
                        return ".iso";\r
+               case Test:\r
+                       return ".exe";\r
        }\r
        throw InvalidOperationException ( __FILE__,\r
                                          __LINE__ );\r
@@ -460,6 +473,7 @@ Module::GetDefaultModuleEntrypoint () const
                case Win32DLL:\r
                        return "_DllMain@12";\r
                case Win32CUI:\r
+               case Test:\r
                        return "_mainCRTStartup";\r
                case Win32GUI:\r
                        return "_WinMainCRTStartup";\r
@@ -493,6 +507,7 @@ Module::GetDefaultModuleBaseaddress () const
                case Win32DLL:\r
                        return "0x10000";\r
                case Win32CUI:\r
+               case Test:\r
                        return "0x00400000";\r
                case Win32GUI:\r
                        return "0x00400000";\r