Commits

Alex Chi committed f5086a7

[TASK] ready to test the project by unittest module

  • Participants
  • Parent commits 44cd61e

Comments (0)

Files changed (1)

 from naclautomake.common import EMakeType
 from naclautomake.common import EProjectType
 
+import unittest
+
+class TestNaClAutomake(unittest.TestCase):
+    def test(self):
+        am = CreateAutomake('ncamtest', 'solutionpath', 'outputpath', 'naclsdkpath', 'chromepath', [EToolChain.NEWLIB, EToolChain.PNACL], [EMakeType.DEBUG, EMakeType.DEPLOY])
+        ncp0 = am.solution.newProject('ncamslib', 'code/slib', EProjectType.SLIB)
+        ncp0.addCodeFile('well.cc', '')
+        ncp1 = am.solution.newProject('ncammain', 'code/main')
+        am.solution.depend('ncammain', 'ncamslib')
+        print am.makefile()
+        am.write('nacltest/Makefile')
+
 if __name__ == '__main__':
-    am = CreateAutomake('ncamtest', 'solutionpath', 'outputpath', 'naclsdkpath', 'chromepath', [EToolChain.NEWLIB, EToolChain.PNACL], [EMakeType.DEBUG, EMakeType.DEPLOY])
-    ncp0 = am.solution.newProject('ncamslib', 'code/slib', EProjectType.SLIB)
-    ncp0.addCodeFile('well.cc', '')
-    ncp1 = am.solution.newProject('ncammain', 'code/main')
-    am.solution.depend('ncammain', 'ncamslib')
-    print am.makefile()
-    am.write('nacltest/Makefile')
+    unittest.main()