From 6ecccd51ef0544b6b46a283702af40c8b2adcaef Mon Sep 17 00:00:00 2001 From: "jvoung@chromium.org" Date: Wed, 24 Apr 2013 21:34:27 +0000 Subject: Port PNaCl error handling test from scons to gyp / browser_tests. We stopped running PNaCl scons nacl_integration, so these tests were no longer being run. Port so that they run. BUG=http://code.google.com/p/nativeclient/issues/detail?id=3364 Review URL: https://chromiumcodereview.appspot.com/14212004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196240 0039d316-1c4b-4281-b951-d872f2087c98 --- ppapi/native_client/chrome_main.scons | 1 - .../nacl_browser/pnacl_client_translator/bad.pexe | 1 - .../nacl_browser/pnacl_client_translator/bad2.pexe | 36 ----- .../pnacl_client_translator/nacl.scons | 62 -------- .../pnacl_client_translator/pnacl_bad2_pexe.nmf | 8 -- .../pnacl_bad_doesnotexist.nmf | 8 -- .../pnacl_bad_doesnotexist_pexe_only.nmf | 5 - .../pnacl_client_translator/pnacl_bad_pexe.nmf | 8 -- .../pnacl_bad_pexe_undefined_syms.nmf | 8 -- .../pnacl_client_translator/pnacl_bad_test.html | 159 --------------------- .../pnacl_client_translator/program_fragment.cc | 10 -- 11 files changed, 306 deletions(-) delete mode 100644 ppapi/native_client/tests/nacl_browser/pnacl_client_translator/bad.pexe delete mode 100644 ppapi/native_client/tests/nacl_browser/pnacl_client_translator/bad2.pexe delete mode 100644 ppapi/native_client/tests/nacl_browser/pnacl_client_translator/nacl.scons delete mode 100644 ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_bad2_pexe.nmf delete mode 100644 ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_bad_doesnotexist.nmf delete mode 100644 ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_bad_doesnotexist_pexe_only.nmf delete mode 100644 ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_bad_pexe.nmf delete mode 100644 ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_bad_pexe_undefined_syms.nmf delete mode 100644 ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_bad_test.html delete mode 100644 ppapi/native_client/tests/nacl_browser/pnacl_client_translator/program_fragment.cc (limited to 'ppapi/native_client') diff --git a/ppapi/native_client/chrome_main.scons b/ppapi/native_client/chrome_main.scons index 3cf97ae..115d44a 100644 --- a/ppapi/native_client/chrome_main.scons +++ b/ppapi/native_client/chrome_main.scons @@ -56,7 +56,6 @@ ppapi_scons_files['irt_variant_test_scons_files'] = [ # Disabled by Brad Chen 4 Sep to try to green Chromium # nacl_integration tests #'tests/nacl_browser/fault_injection/nacl.scons', - 'tests/nacl_browser/pnacl_client_translator/nacl.scons', ] ppapi_scons_files['untrusted_scons_files'] = [ diff --git a/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/bad.pexe b/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/bad.pexe deleted file mode 100644 index 27fe62a..0000000 --- a/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/bad.pexe +++ /dev/null @@ -1 +0,0 @@ -BC this is not really a bitcode file. diff --git a/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/bad2.pexe b/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/bad2.pexe deleted file mode 100644 index 41bc8b2..0000000 --- a/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/bad2.pexe +++ /dev/null @@ -1,36 +0,0 @@ -;; For now, we are using a .ll file as a "pexe". This is only a bad pexe -;; in the sense that it shouldn't compile (missing instruction), -;; not that it will crash LLC. Eventually we should make this into -;; a bitcode file w/ the proper pexe metadata. - -;; To actually crash LLC (and do so reliably), perhaps we could add -;; an SRPC method to LLC to ask it to crash itself. -;; That seems much more reliable than trying to find a bitcode file that -;; for version X will crash LLC, but for version Y it has been fixed. - -@.str = private unnamed_addr constant [12 x i8] c"Hello world\00", align 4 - -define i32 @main(i32 %argc, i8** %argv) nounwind { -entry: - %argc_addr = alloca i32, align 4 - %argv_addr = alloca i8**, align 4 - %retval = alloca i32 - %0 = alloca i32 - %"alloca point" = bitcast i32 0 to i32 - store i32 %argc, i32* %argc_addr - store i8** %argv, i8*** %argv_addr - %1 = call i32 @puts(i8* getelementptr inbounds ([12 x i8]* @.str, i32 0, i32 0)) nounwind - store i32 0, i32* %0, align 4 - -;; Intentionally comment this line out to make it fail to compile. -;; %2 = load i32* %0, align 4 - - store i32 %2, i32* %retval, align 4 - br label %return - -return: ; preds = %entry - %retval1 = load i32* %retval - ret i32 %retval1 -} - -declare i32 @puts(i8*) diff --git a/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/nacl.scons b/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/nacl.scons deleted file mode 100644 index 126642b..0000000 --- a/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/nacl.scons +++ /dev/null @@ -1,62 +0,0 @@ -# Copyright (c) 2012 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -Import('env') - -# Browser tests for the pnacl translator. This requires starting with a pexe. -if not (env.Bit('bitcode') and env.Bit('pnacl_generate_pexe')): - Return() - -# The PNaCl coordinator cannot yet handle GLibC-based pexe. -# The driver cannot build the pexe on x86-64 for now. -# The bitcode link arbitrarily picks x86-32 as the ARCH, but the -# glibc bitcode link line uses native x86-64 libs instead of bitcode -# stubs, so there is a mismatch: -# http://code.google.com/p/nativeclient/issues/detail?id=2451 -# Luckily, it can build the x86-32 pexe. That works, mostly because -# the hello-world example doesn't depend on pso's, etc. -if env.Bit('nacl_glibc') and env.Bit('target_x86_64'): - Return() - -#### Test error handling. - -# We should add more cases, e.g., try a bad library to crash ld, -# try a more malicious bitcode, try to exhaust resources, etc. -# The current llc tests, don't actually crash LLC, they only -# make llc exit w/ an abnormal status. - -program_fragment_obj = env.ComponentObject('program_fragment.cc') - -pnacl_bad_files = env.Replicate( - '${STAGING_DIR}', - ['pnacl_bad_doesnotexist.nmf', - 'pnacl_bad_doesnotexist_pexe_only.nmf', - # This one is just a text file that begins with "BC". - 'bad.pexe', - 'pnacl_bad_pexe.nmf', - # This one is the hello world bitcode .ll w/ a missing instruction. - 'bad2.pexe', - 'pnacl_bad2_pexe.nmf', - program_fragment_obj, - 'pnacl_bad_pexe_undefined_syms.nmf', - 'pnacl_bad_test.html', - ]) - -# Borrow bad load test harness. -borrowed_file = '${STAGING_DIR}/ppapi_bad.js', - -node = env.PPAPIBrowserTester( - 'pnacl_bad_test.out', - url='pnacl_bad_test.html', - # TODO(jvoung): list "nmfs" without clashing with Replicate. - # Perhaps just use publish instead of Replicate. - # There may also be an issue in that the scons manifest generator is picky - # about nexes that don't exist. - files=pnacl_bad_files + [borrowed_file], - args=['--allow_404', '--prefer_portable_in_manifest']) - -env.AddNodeToTestSuite(node, - ['chrome_browser_tests'], - 'run_pnacl_bad_browser_test', - is_broken=env.PPAPIBrowserTesterIsBroken()) diff --git a/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_bad2_pexe.nmf b/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_bad2_pexe.nmf deleted file mode 100644 index 7a1956e..0000000 --- a/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_bad2_pexe.nmf +++ /dev/null @@ -1,8 +0,0 @@ -{ - "program": { - "x86-32": {"url": "non_existent.nexe"}, - "x86-64": {"url": "non_existent.nexe"}, - "arm": {"url": "non_existent.nexe"}, - "portable": {"pnacl-translate": {"url": "bad2.pexe"} } - } -} diff --git a/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_bad_doesnotexist.nmf b/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_bad_doesnotexist.nmf deleted file mode 100644 index c84136e..0000000 --- a/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_bad_doesnotexist.nmf +++ /dev/null @@ -1,8 +0,0 @@ -{ - "program": { - "x86-32": {"url": "non_existent.nexe"}, - "x86-64": {"url": "non_existent.nexe"}, - "arm": {"url": "non_existent.nexe"}, - "portable": {"pnacl-translate": {"url": "non_existent.pexe"} } - } -} diff --git a/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_bad_doesnotexist_pexe_only.nmf b/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_bad_doesnotexist_pexe_only.nmf deleted file mode 100644 index 8448232..0000000 --- a/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_bad_doesnotexist_pexe_only.nmf +++ /dev/null @@ -1,5 +0,0 @@ -{ - "program": { - "portable": {"pnacl-translate": {"url": "non_existent.pexe"} } - } -} diff --git a/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_bad_pexe.nmf b/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_bad_pexe.nmf deleted file mode 100644 index 1ce311b..0000000 --- a/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_bad_pexe.nmf +++ /dev/null @@ -1,8 +0,0 @@ -{ - "program": { - "x86-32": {"url": "non_existent.nexe"}, - "x86-64": {"url": "non_existent.nexe"}, - "arm": {"url": "non_existent.nexe"}, - "portable": {"pnacl-translate": {"url": "bad.pexe"} } - } -} diff --git a/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_bad_pexe_undefined_syms.nmf b/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_bad_pexe_undefined_syms.nmf deleted file mode 100644 index 8fe0bed..0000000 --- a/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_bad_pexe_undefined_syms.nmf +++ /dev/null @@ -1,8 +0,0 @@ -{ - "program": { - "x86-32": {"url": "non_existent.nexe"}, - "x86-64": {"url": "non_existent.nexe"}, - "arm": {"url": "non_existent.nexe"}, - "portable": {"pnacl-translate": {"url": "program_fragment.bc"} } - } -} diff --git a/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_bad_test.html b/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_bad_test.html deleted file mode 100644 index 2627d87..0000000 --- a/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/pnacl_bad_test.html +++ /dev/null @@ -1,159 +0,0 @@ - - - - - - - - - PNACL bad pexe/libraries Test - - - - - - -
- - - - diff --git a/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/program_fragment.cc b/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/program_fragment.cc deleted file mode 100644 index 8dafe92..0000000 --- a/ppapi/native_client/tests/nacl_browser/pnacl_client_translator/program_fragment.cc +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Never defined. This will end badly when we try to link. -extern void bar(); - -void foo() { - bar(); -} -- cgit v1.1