~ubuntu-branches/ubuntu/saucy/libv8/saucy

« back to all changes in this revision

Viewing changes to test/mjsunit/d8-os.js

  • Committer: Package Import Robot
  • Author(s): Jérémy Lal
  • Date: 2012-04-07 16:26:13 UTC
  • mfrom: (15.1.27 sid)
  • Revision ID: package-import@ubuntu.com-20120407162613-dqo1m6w9r3fh8tst
Tags: 3.8.9.16-3
* mipsel build fixes :
  + v8_use_mips_abi_hardfloat=false, this lowers EABI requirements.
  + v8_can_use_fpu_instructions=false, detect if FPU is present.
  + set -Wno-unused-but-set-variable only on mipsel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
 
55
55
 
56
56
if (this.os && os.system) {
 
57
  // Ensure that we have a valid working directory.
 
58
  os.chdir("/tmp");
57
59
  try {
58
60
    // Delete the dir if it is lying around from last time.
59
61
    os.system("ls", [TEST_DIR]);
143
145
      assertEquals("baz\n", os.system("echo", ["baz"]));
144
146
      //}
145
147
    }
 
148
 
 
149
    // Too few args.
 
150
    arg_error("os.umask();");
 
151
    arg_error("os.system();");
 
152
    arg_error("os.mkdirp();");
 
153
    arg_error("os.chdir();");
 
154
    arg_error("os.setenv();");
 
155
    arg_error("os.rmdir();");
 
156
 
 
157
    // Too many args.
 
158
    arg_error("os.setenv('FOO=bar');");
 
159
    arg_error("os.umask(0, 0);");
 
160
    arg_error("os.system('ls', [], -1, -1, -1);");
 
161
    arg_error("os.mkdirp('foo', 0, 0)");
 
162
    arg_error("os.chdir('foo', 'bar')");
 
163
    arg_error("os.rmdir('foo', 'bar');");
 
164
 
 
165
    // Wrong kind of args.
 
166
    arg_error("os.umask([]);");
 
167
    arg_error("os.system('ls', 'foo');");
 
168
    arg_error("os.system('ls', 123);");
 
169
    arg_error("os.system('ls', [], 'foo');");
 
170
    arg_error("os.system('ls', [], -1, 'foo');");
 
171
    arg_error("os.mkdirp('foo', 'bar');");
 
172
 
 
173
    // Test broken toString().
 
174
    str_error("os.system(e);");
 
175
    str_error("os.system('ls', [e]);");
 
176
    str_error("os.system('ls', ['.', e]);");
 
177
    str_error("os.system('ls', [e, '.']);");
 
178
    str_error("os.mkdirp(e);");
 
179
    str_error("os.setenv(e, 'goo');");
 
180
    str_error("os.setenv('goo', e);");
 
181
    str_error("os.chdir(e);");
 
182
    str_error("os.rmdir(e);");
 
183
 
146
184
  } finally {
147
185
    os.system("rm", ["-r", TEST_DIR]);
148
186
  }
149
 
 
150
 
  // Too few args.
151
 
  arg_error("os.umask();");
152
 
  arg_error("os.system();");
153
 
  arg_error("os.mkdirp();");
154
 
  arg_error("os.chdir();");
155
 
  arg_error("os.setenv();");
156
 
  arg_error("os.rmdir();");
157
 
 
158
 
  // Too many args.
159
 
  arg_error("os.setenv('FOO=bar');");
160
 
  arg_error("os.umask(0, 0);");
161
 
  arg_error("os.system('ls', [], -1, -1, -1);");
162
 
  arg_error("os.mkdirp('foo', 0, 0)");
163
 
  arg_error("os.chdir('foo', 'bar')");
164
 
  arg_error("os.rmdir('foo', 'bar');");
165
 
 
166
 
  // Wrong kind of args.
167
 
  arg_error("os.umask([]);");
168
 
  arg_error("os.system('ls', 'foo');");
169
 
  arg_error("os.system('ls', 123);");
170
 
  arg_error("os.system('ls', [], 'foo');");
171
 
  arg_error("os.system('ls', [], -1, 'foo');");
172
 
  arg_error("os.mkdirp('foo', 'bar');");
173
 
 
174
 
  // Test broken toString().
175
 
  str_error("os.system(e);");
176
 
  str_error("os.system('ls', [e]);");
177
 
  str_error("os.system('ls', ['.', e]);");
178
 
  str_error("os.system('ls', [e, '.']);");
179
 
  str_error("os.mkdirp(e);");
180
 
  str_error("os.setenv(e, 'goo');");
181
 
  str_error("os.setenv('goo', e);");
182
 
  str_error("os.chdir(e);");
183
 
  str_error("os.rmdir(e);");
184
187
}