OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 } catch (e) { | 128 } catch (e) { |
129 have_echo = false; | 129 have_echo = false; |
130 } | 130 } |
131 if (have_sleep) { | 131 if (have_sleep) { |
132 assertThrows("os.system('sleep', ['2000'], 20);", "sleep 1"); | 132 assertThrows("os.system('sleep', ['2000'], 20);", "sleep 1"); |
133 | 133 |
134 // Check we time out with total time. | 134 // Check we time out with total time. |
135 assertThrows("os.system('sleep', ['2000'], -1, 20);", "sleep 2"); | 135 assertThrows("os.system('sleep', ['2000'], -1, 20);", "sleep 2"); |
136 | 136 |
137 // Check that -1 means no timeout. | 137 // Check that -1 means no timeout. |
138 os.system('sleep', ['0.1'], -1, -1); | 138 os.system('sleep', ['1'], -1, -1); |
139 | 139 |
140 } | 140 } |
141 | 141 |
142 // Check that we don't fill up the process table with zombies. | 142 // Check that we don't fill up the process table with zombies. |
143 // Disabled because it's too slow. | 143 // Disabled because it's too slow. |
144 if (have_echo) { | 144 if (have_echo) { |
145 //for (var i = 0; i < 65536; i++) { | 145 //for (var i = 0; i < 65536; i++) { |
146 assertEquals("baz\n", os.system("echo", ["baz"])); | 146 assertEquals("baz\n", os.system("echo", ["baz"])); |
147 //} | 147 //} |
148 } | 148 } |
(...skipping 30 matching lines...) Expand all Loading... |
179 str_error("os.mkdirp(e);"); | 179 str_error("os.mkdirp(e);"); |
180 str_error("os.setenv(e, 'goo');"); | 180 str_error("os.setenv(e, 'goo');"); |
181 str_error("os.setenv('goo', e);"); | 181 str_error("os.setenv('goo', e);"); |
182 str_error("os.chdir(e);"); | 182 str_error("os.chdir(e);"); |
183 str_error("os.rmdir(e);"); | 183 str_error("os.rmdir(e);"); |
184 | 184 |
185 } finally { | 185 } finally { |
186 os.system("rm", ["-r", TEST_DIR]); | 186 os.system("rm", ["-r", TEST_DIR]); |
187 } | 187 } |
188 } | 188 } |
OLD | NEW |