| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 copy("copy_test_files") { | 5 copy("copy_test_files") { |
| 6 visibility = [ ":*" ] | 6 visibility = [ ":*" ] |
| 7 sources = [ | 7 sources = [ |
| 8 # Keep "test_case.html.mock-http-headers" with "test_case.html". | 8 # Keep "test_case.html.mock-http-headers" with "test_case.html". |
| 9 "tests/ppapi_nacl_tests_newlib.nmf", | 9 "tests/ppapi_nacl_tests_newlib.nmf", |
| 10 "tests/test_case.html", | 10 "tests/test_case.html", |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 sources = [ | 22 sources = [ |
| 23 "tests/test_url_loader_data/hello.txt", | 23 "tests/test_url_loader_data/hello.txt", |
| 24 ] | 24 ] |
| 25 outputs = [ | 25 outputs = [ |
| 26 "$root_out_dir/test_url_loader_data/{{source_file_part}}", | 26 "$root_out_dir/test_url_loader_data/{{source_file_part}}", |
| 27 ] | 27 ] |
| 28 } | 28 } |
| 29 | 29 |
| 30 import("//build/config/features.gni") | 30 import("//build/config/features.gni") |
| 31 import("//build/config/nacl/config.gni") | 31 import("//build/config/nacl/config.gni") |
| 32 import("//build/config/nacl/rules.gni") |
| 32 import("//ppapi/ppapi_sources.gni") | 33 import("//ppapi/ppapi_sources.gni") |
| 33 import("//testing/test.gni") | 34 import("//testing/test.gni") |
| 34 | 35 |
| 35 shared_library("ppapi_tests") { | 36 shared_library("ppapi_tests") { |
| 36 sources = ppapi_sources.test_common_source_files + | 37 sources = ppapi_sources.test_common_source_files + |
| 37 ppapi_sources.test_trusted_source_files | 38 ppapi_sources.test_trusted_source_files |
| 38 | 39 |
| 39 configs += [ | 40 configs += [ |
| 40 "//build/config:precompiled_headers", | 41 "//build/config:precompiled_headers", |
| 41 "//v8:external_startup_data", | 42 "//v8:external_startup_data", |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 deps = [ | 306 deps = [ |
| 306 ":translate_pexe_to_nexe", | 307 ":translate_pexe_to_nexe", |
| 307 ] | 308 ] |
| 308 } else { | 309 } else { |
| 309 deps = [ | 310 deps = [ |
| 310 ":ppapi_nacl_tests", | 311 ":ppapi_nacl_tests", |
| 311 ] | 312 ] |
| 312 } | 313 } |
| 313 } | 314 } |
| 314 | 315 |
| 315 action("generate_nmf") { | 316 generate_nmf("ppapi_nacl_tests_nmf") { |
| 316 if (is_nacl_glibc) { | 317 if (is_nacl_glibc) { |
| 317 nmf = "${root_build_dir}/ppapi_nacl_tests_glibc.nmf" | 318 nmf = "${root_build_dir}/ppapi_nacl_tests_glibc.nmf" |
| 318 } else if (current_cpu == "pnacl") { | 319 } else if (current_cpu == "pnacl") { |
| 319 nmf = "${root_build_dir}/ppapi_nacl_tests_pnacl.nmf" | 320 nmf = "${root_build_dir}/ppapi_nacl_tests_pnacl.nmf" |
| 320 } else { | 321 } else { |
| 321 nmf = "${root_build_dir}/ppapi_nacl_tests_newlib.nmf" | 322 nmf = "${root_build_dir}/ppapi_nacl_tests_newlib.nmf" |
| 322 } | 323 } |
| 323 nexe = "${root_out_dir}/ppapi_nacl_tests.nexe" | 324 executables = get_target_outputs(":nacl_tests_copy") |
| 324 | 325 deps = [ |
| 325 objdump = rebase_path("${nacl_toolprefix}objdump") | 326 ":nacl_tests_copy", |
| 326 | |
| 327 script = "//native_client_sdk/src/tools/create_nmf.py" | |
| 328 sources = [ | |
| 329 nexe, | |
| 330 ] | 327 ] |
| 331 outputs = [ | |
| 332 nmf, | |
| 333 ] | |
| 334 data = [ | |
| 335 nexe, | |
| 336 ] | |
| 337 nmf_flags = [] | |
| 338 if (is_nacl_glibc) { | |
| 339 nmf_flags += [ "--library-path=" + rebase_path(root_out_dir) ] | |
| 340 if (current_cpu == "x86") { | |
| 341 nmf_flags += [ "--library-path=" + | |
| 342 rebase_path("${nacl_toolchain_tooldir}/lib32") ] | |
| 343 data += [ "$root_build_dir/lib32/" ] | |
| 344 } | |
| 345 if (target_cpu == "x64" || (target_cpu == "x86" && is_win)) { | |
| 346 nmf_flags += [ "--library-path=" + | |
| 347 rebase_path("${nacl_toolchain_tooldir}/lib") ] | |
| 348 data += [ "$root_build_dir/lib64/" ] | |
| 349 } | |
| 350 if (current_cpu == "arm") { | |
| 351 nmf_flags += [ "--library-path=" + | |
| 352 rebase_path("${nacl_toolchain_tooldir}/lib") ] | |
| 353 data += [ "$root_build_dir/lib/" ] | |
| 354 } | |
| 355 } | |
| 356 args = [ | |
| 357 "--no-default-libpath", | |
| 358 "--objdump=" + objdump, | |
| 359 "--output=" + rebase_path(nmf, root_build_dir), | |
| 360 "--stage-dependencies=" + rebase_path(root_build_dir), | |
| 361 ] + nmf_flags + rebase_path(sources, root_build_dir) | |
| 362 if (current_cpu == "pnacl") { | |
| 363 deps = [ | |
| 364 ":translate_pexe_to_nexe", | |
| 365 ] | |
| 366 } else { | |
| 367 deps = [ | |
| 368 ":ppapi_nacl_tests", | |
| 369 ] | |
| 370 if (is_nacl_glibc && current_cpu == "arm") { | |
| 371 deps += [ "//native_client/src/untrusted/elf_loader:elf_loader" ] | |
| 372 } | |
| 373 } | |
| 374 } | 328 } |
| 375 | 329 |
| 376 action("generate_nonsfi_nmf") { | 330 generate_nonsfi_test_nmf("ppapi_nacl_tests_pnacl_nonsfi_nmf") { |
| 377 nmf = "${root_build_dir}/ppapi_nacl_tests_pnacl_nonsfi.nmf" | 331 nmf = "${root_build_dir}/ppapi_nacl_tests_pnacl_nonsfi.nmf" |
| 378 nexe = "${root_out_dir}/ppapi_nacl_tests.nexe" | 332 executable = "${root_out_dir}/ppapi_nacl_tests.nexe" |
| 379 | |
| 380 script = "//ppapi/tests/create_nonsfi_test_nmf.py" | |
| 381 sources = [ | |
| 382 nexe, | |
| 383 ] | |
| 384 outputs = [ | |
| 385 nmf, | |
| 386 ] | |
| 387 data = [ | |
| 388 nexe, | |
| 389 ] | |
| 390 if (target_cpu == "x86") { | |
| 391 arch = "x86-32" | |
| 392 } else if (target_cpu == "x64") { | |
| 393 arch = "x86-64" | |
| 394 } else if (target_cpu == "arm") { | |
| 395 arch = "arm" | |
| 396 } | |
| 397 args = [ | |
| 398 "--program=" + rebase_path(sources[0], root_build_dir), | |
| 399 "--arch=${arch}", | |
| 400 "--output=" + rebase_path(nmf, root_build_dir), | |
| 401 ] | |
| 402 deps = [ | 333 deps = [ |
| 403 ":translate_pexe_to_nexe", | 334 ":translate_pexe_to_nexe", |
| 404 ] | 335 ] |
| 405 } | 336 } |
| 406 } | 337 } |
| 407 | 338 |
| 408 group("ppapi_nacl_tests_all") { | 339 group("ppapi_nacl_tests_all") { |
| 409 data_deps = [ | 340 data_deps = [ |
| 410 ":copy_test_files", | 341 ":copy_test_files", |
| 411 ":nacl_tests_copy(//build/toolchain/nacl:clang_newlib_${target_cpu})", | 342 ":nacl_tests_copy(//build/toolchain/nacl:clang_newlib_${target_cpu})", |
| 412 ":generate_nmf(//build/toolchain/nacl:glibc_${target_cpu})", | 343 ":ppapi_nacl_tests_nmf(//build/toolchain/nacl:glibc_${target_cpu})", |
| 413 ] | 344 ] |
| 414 if (enable_pnacl) { | 345 if (enable_pnacl) { |
| 415 data_deps += [ | 346 data_deps += [ |
| 416 ":generate_nmf(//build/toolchain/nacl:newlib_pnacl)", | 347 ":ppapi_nacl_tests_nmf(//build/toolchain/nacl:newlib_pnacl)", |
| 417 ":generate_nonsfi_nmf(//build/toolchain/nacl:newlib_pnacl_nonsfi)", | 348 ":ppapi_nacl_tests_pnacl_nonsfi_nmf(//build/toolchain/nacl:newlib_pnacl_
nonsfi)", |
| 418 ] | 349 ] |
| 419 } | 350 } |
| 420 } | 351 } |
| 421 } | 352 } |
| OLD | NEW |