@@ 95-104 (lines=10) @@ | ||
92 | self.skipTest('fused-src is not exists') |
|
93 | return super(iuwandbox_test, self).setUp() |
|
94 | ||
95 | def test_nomain(self): |
|
96 | sys.argv = sys.argv[:1] |
|
97 | sys.argv[1:] = [ test_src ] |
|
98 | sys.argv.extend(test_opt_nomain) |
|
99 | with self.assertRaises(SystemExit) as cm: |
|
100 | iuwandbox.main() |
|
101 | self.dump() |
|
102 | self.assertEqual(cm.exception.code, 1, self.capture.getvalue()) |
|
103 | self.assertRegex(self.capture.getvalue(), '.*hint:.*') |
|
104 | self.assertRegex(self.capture.getvalue(), '.*If you do not use boost test, please specify the file with the main function first..*') |
|
105 | ||
106 | def test_run(self): |
|
107 | sys.argv[1:] = [ test_src ] |
|
@@ 116-124 (lines=9) @@ | ||
113 | self.assertEqual(cm.exception.code, 0, self.capture.getvalue()) |
|
114 | self.assertRegex(self.capture.getvalue(), '.*OK.*') |
|
115 | ||
116 | def test_same_filename(self): |
|
117 | sys.argv[1:] = [ 'src/main.cpp', 'src/A/sample.cpp', 'src/B/sample.cpp' ] |
|
118 | sys.argv.extend(test_opt_nomain) |
|
119 | print(sys.argv) |
|
120 | with self.assertRaises(SystemExit) as cm: |
|
121 | iuwandbox.main() |
|
122 | self.dump() |
|
123 | self.assertEqual(cm.exception.code, 0, self.capture.getvalue()) |
|
124 | self.assertRegex(self.capture.getvalue(), '.*OK.*') |
|
125 | ||
126 | if __name__ == "__main__": |
|
127 | unittest.main() |
|
@@ 106-114 (lines=9) @@ | ||
103 | self.assertRegex(self.capture.getvalue(), '.*hint:.*') |
|
104 | self.assertRegex(self.capture.getvalue(), '.*If you do not use boost test, please specify the file with the main function first..*') |
|
105 | ||
106 | def test_run(self): |
|
107 | sys.argv[1:] = [ test_src ] |
|
108 | sys.argv.extend(test_opt) |
|
109 | print(sys.argv) |
|
110 | with self.assertRaises(SystemExit) as cm: |
|
111 | iuwandbox.main() |
|
112 | self.dump() |
|
113 | self.assertEqual(cm.exception.code, 0, self.capture.getvalue()) |
|
114 | self.assertRegex(self.capture.getvalue(), '.*OK.*') |
|
115 | ||
116 | def test_same_filename(self): |
|
117 | sys.argv[1:] = [ 'src/main.cpp', 'src/A/sample.cpp', 'src/B/sample.cpp' ] |
|
@@ 73-80 (lines=8) @@ | ||
70 | self.skipTest('fused-src is exists') |
|
71 | return super(nofused_iuwandbox_test, self).setUp() |
|
72 | ||
73 | def test_nofused(self): |
|
74 | sys.argv[1:] = [ test_src ] |
|
75 | sys.argv.extend(test_opt) |
|
76 | with self.assertRaises(SystemExit) as cm: |
|
77 | iuwandbox.main() |
|
78 | self.dump() |
|
79 | self.assertEqual(cm.exception.code, 1, self.capture.getvalue()) |
|
80 | self.assertRegex(self.capture.getvalue(), '.*please try \"make fused\".*') |
|
81 | ||
82 | ||
83 | class iuwandbox_test(iuwandbox_test_base): |