diff options
author | binji@chromium.org <binji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-15 01:02:29 +0000 |
---|---|---|
committer | binji@chromium.org <binji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-15 01:02:29 +0000 |
commit | 1014b1a6ccd05cb913372e7712cd47801530a6a9 (patch) | |
tree | f5226f11529450f7d20a9ac89d1dede8b02ad6de | |
parent | cf265dc0c6806f2ebbabb7d774f1d0791569a96a (diff) | |
download | chromium_src-1014b1a6ccd05cb913372e7712cd47801530a6a9.zip chromium_src-1014b1a6ccd05cb913372e7712cd47801530a6a9.tar.gz chromium_src-1014b1a6ccd05cb913372e7712cd47801530a6a9.tar.bz2 |
[NaCl SDK] gtest_ppapi library.
Right now it is just c_salt/test moved over, but the goal is to use this to
allow gtest to forward test results to the browser, and from there to a local
server.
BUG=none
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/10854137
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151620 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-x | native_client_sdk/src/build_tools/build_sdk.py | 1 | ||||
-rw-r--r-- | native_client_sdk/src/libraries/build.scons | 41 | ||||
-rw-r--r-- | native_client_sdk/src/libraries/gtest_ppapi/condition_lock.h (renamed from native_client_sdk/src/libraries/c_salt/threading/condition_lock.h) | 7 | ||||
-rw-r--r-- | native_client_sdk/src/libraries/gtest_ppapi/gtest_event_listener.cc (renamed from native_client_sdk/src/libraries/c_salt/test/gtest_event_listener.cc) | 7 | ||||
-rw-r--r-- | native_client_sdk/src/libraries/gtest_ppapi/gtest_event_listener.h (renamed from native_client_sdk/src/libraries/c_salt/test/gtest_event_listener.h) | 18 | ||||
-rw-r--r-- | native_client_sdk/src/libraries/gtest_ppapi/gtest_instance.cc (renamed from native_client_sdk/src/libraries/c_salt/test/gtest_instance.cc) | 13 | ||||
-rw-r--r-- | native_client_sdk/src/libraries/gtest_ppapi/gtest_instance.h (renamed from native_client_sdk/src/libraries/c_salt/test/gtest_instance.h) | 11 | ||||
-rw-r--r-- | native_client_sdk/src/libraries/gtest_ppapi/gtest_module.cc (renamed from native_client_sdk/src/libraries/c_salt/test/gtest_module.cc) | 13 | ||||
-rw-r--r-- | native_client_sdk/src/libraries/gtest_ppapi/gtest_nacl_environment.cc (renamed from native_client_sdk/src/libraries/c_salt/test/gtest_nacl_environment.cc) | 7 | ||||
-rw-r--r-- | native_client_sdk/src/libraries/gtest_ppapi/gtest_nacl_environment.h (renamed from native_client_sdk/src/libraries/c_salt/test/gtest_nacl_environment.h) | 11 | ||||
-rw-r--r-- | native_client_sdk/src/libraries/gtest_ppapi/gtest_runner.cc (renamed from native_client_sdk/src/libraries/c_salt/test/gtest_runner.cc) | 18 | ||||
-rw-r--r-- | native_client_sdk/src/libraries/gtest_ppapi/gtest_runner.h (renamed from native_client_sdk/src/libraries/c_salt/test/gtest_runner.h) | 17 | ||||
-rw-r--r-- | native_client_sdk/src/libraries/gtest_ppapi/library.dsc | 35 | ||||
-rw-r--r-- | native_client_sdk/src/libraries/gtest_ppapi/pthread_ext.h (renamed from native_client_sdk/src/libraries/c_salt/threading/pthread_ext.h) | 7 | ||||
-rw-r--r-- | native_client_sdk/src/libraries/gtest_ppapi/ref_count.h (renamed from native_client_sdk/src/libraries/c_salt/threading/ref_count.h) | 12 | ||||
-rw-r--r-- | native_client_sdk/src/libraries/gtest_ppapi/scoped_mutex_lock.h (renamed from native_client_sdk/src/libraries/c_salt/threading/scoped_mutex_lock.h) | 11 | ||||
-rw-r--r-- | native_client_sdk/src/libraries/gtest_ppapi/thread_condition.h (renamed from native_client_sdk/src/libraries/c_salt/threading/thread_condition.h) | 13 | ||||
-rwxr-xr-x | native_client_sdk/src/libraries/scons | 47 | ||||
-rwxr-xr-x | native_client_sdk/src/libraries/scons.bat | 50 |
19 files changed, 90 insertions, 249 deletions
diff --git a/native_client_sdk/src/build_tools/build_sdk.py b/native_client_sdk/src/build_tools/build_sdk.py index 70898f2..f9836f4 100755 --- a/native_client_sdk/src/build_tools/build_sdk.py +++ b/native_client_sdk/src/build_tools/build_sdk.py @@ -634,6 +634,7 @@ TEST_EXAMPLE_LIST = [ TEST_LIBRARY_LIST = [ 'gtest', + 'gtest_ppapi', ] def BuildStepCopyTests(pepperdir, toolchains, build_experimental): diff --git a/native_client_sdk/src/libraries/build.scons b/native_client_sdk/src/libraries/build.scons deleted file mode 100644 index d2c8c28..0000000 --- a/native_client_sdk/src/libraries/build.scons +++ /dev/null @@ -1,41 +0,0 @@ -#! -*- python -*- -# -# Copyright (c) 2011 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. - -""" -Build file for the NaCl SDK Libraries - -This file runs all the scons files in the various libraries sub-directories. -Do not invoke this script directly, but instead use the scons or scons.bat -wrapper function. E.g. - -Linux or Mac: - ./scons [Options...] - -Windows: - scons.bat [Options...] -""" - -#------------------------------------------------------------------------------ -HELP_STRING = """ -=============================================================================== -Help for NaCl SDK Libraries -=============================================================================== - -* cleaning: ./scons -c -* build a target: ./scons <target> -* clean a target: ./scons -c <target> - -Supported targets: - * gtest_libs Build the gtest and gmock libraries. -""" - -libraries_sconscripts = [ - 'gtest/build.scons', - ] - -Help(HELP_STRING) - -SConscript(libraries_sconscripts) diff --git a/native_client_sdk/src/libraries/c_salt/threading/condition_lock.h b/native_client_sdk/src/libraries/gtest_ppapi/condition_lock.h index d50860c..927d55e 100644 --- a/native_client_sdk/src/libraries/c_salt/threading/condition_lock.h +++ b/native_client_sdk/src/libraries/gtest_ppapi/condition_lock.h @@ -2,12 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONDITION_LOCK_H_ -#define CONDITION_LOCK_H_ +#ifndef GTEST_PPAPI_CONDITION_LOCK_H_ +#define GTEST_PPAPI_CONDITION_LOCK_H_ #include <pthread.h> -namespace threading { // Class to manage a lock associated with a specific value. The calling thread // can ask to acquire the lock only when the lock is in a certain condition. class ConditionLock { @@ -83,7 +82,5 @@ class ConditionLock { pthread_cond_t condition_condition_; int32_t condition_value_; }; -} // namespace threading #endif // CONDITION_LOCK_H_ - diff --git a/native_client_sdk/src/libraries/c_salt/test/gtest_event_listener.cc b/native_client_sdk/src/libraries/gtest_ppapi/gtest_event_listener.cc index 2a7f4ce..020c036 100644 --- a/native_client_sdk/src/libraries/c_salt/test/gtest_event_listener.cc +++ b/native_client_sdk/src/libraries/gtest_ppapi/gtest_event_listener.cc @@ -1,14 +1,12 @@ // 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. -#include "c_salt/test/gtest_event_listener.h" +#include "gtest_ppapi/gtest_event_listener.h" #include "ppapi/cpp/instance.h" #include "ppapi/cpp/module.h" #include "ppapi/cpp/var.h" -namespace c_salt { - GTestEventListener::GTestEventListener(pp::Instance* instance) : instance_(instance), factory_(this) { @@ -95,6 +93,3 @@ void GTestEventListener::PostMessageCallback(int32_t result, const std::string& str) { instance_->PostMessage(str); } - -} // namespace c_salt - diff --git a/native_client_sdk/src/libraries/c_salt/test/gtest_event_listener.h b/native_client_sdk/src/libraries/gtest_ppapi/gtest_event_listener.h index 39f5139..1af4c22 100644 --- a/native_client_sdk/src/libraries/c_salt/test/gtest_event_listener.h +++ b/native_client_sdk/src/libraries/gtest_ppapi/gtest_event_listener.h @@ -1,20 +1,19 @@ // 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. -#ifndef C_SALT_TEST_GTEST_EVENT_LISTENER_H_ -#define C_SALT_TEST_GTEST_EVENT_LISTENER_H_ +#ifndef GTEST_PPAPI_GTEST_EVENT_LISTENER_H_ +#define GTEST_PPAPI_GTEST_EVENT_LISTENER_H_ #include <string> -#include "c_salt/threading/ref_count.h" + #include "gtest/gtest.h" -#include "ppapi/cpp/completion_callback.h" +#include "gtest_ppapi/ref_count.h" +#include "ppapi/utility/completion_callback_factory.h" namespace pp { class Instance; } // namespace pp -namespace c_salt { - // GTestEventListener is a gtest event listener that performs two functions: // 1. It redirects output to PostMessage rather than printf, so that test events // are dispatched to JS. @@ -42,10 +41,7 @@ class GTestEventListener : public ::testing::EmptyTestEventListener { void PostMessageCallback(int32_t result, const std::string& str); pp::Instance* instance_; - pp::CompletionCallbackFactory<GTestEventListener, - ::threading::RefCount> factory_; + pp::CompletionCallbackFactory<GTestEventListener> factory_; }; -} // namespace c_salt -#endif // C_SALT_TEST_GTEST_EVENT_LISTENER_H_ - +#endif // GTEST_PPAPI_GTEST_EVENT_LISTENER_H_ diff --git a/native_client_sdk/src/libraries/c_salt/test/gtest_instance.cc b/native_client_sdk/src/libraries/gtest_ppapi/gtest_instance.cc index 0da1b70..e80368e 100644 --- a/native_client_sdk/src/libraries/c_salt/test/gtest_instance.cc +++ b/native_client_sdk/src/libraries/gtest_ppapi/gtest_instance.cc @@ -2,12 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "c_salt/test/gtest_instance.h" -#include "c_salt/test/gtest_runner.h" +#include "gtest_ppapi/gtest_instance.h" +#include "gtest_ppapi/gtest_runner.h" #include "ppapi/cpp/var.h" -namespace c_salt { - GTestInstance::GTestInstance(PP_Instance instance) : pp::Instance(instance) { } @@ -19,7 +17,7 @@ bool GTestInstance::Init(uint32_t /* argc */, const char* /* argn */[], const char* /* argv */[]) { // Create a GTestRunner thread/singleton. int local_argc = 0; - c_salt::GTestRunner::CreateGTestRunnerThread(this, local_argc, NULL); + GTestRunner::CreateGTestRunnerThread(this, local_argc, NULL); return true; } @@ -33,7 +31,7 @@ void GTestInstance::HandleMessage(const pp::Var& var_message) { if (message == "RunGTest") { // This is our signal to start running the tests. Results from the tests // are posted through GTestEventListener. - c_salt::GTestRunner::gtest_runner()->RunAllTests(); + GTestRunner::gtest_runner()->RunAllTests(); } else { std::string return_var; return_var = "Unknown message "; @@ -41,6 +39,3 @@ void GTestInstance::HandleMessage(const pp::Var& var_message) { PostMessage(return_var); } } - -} // namespace c_salt - diff --git a/native_client_sdk/src/libraries/c_salt/test/gtest_instance.h b/native_client_sdk/src/libraries/gtest_ppapi/gtest_instance.h index 1cdaa01..152f3be 100644 --- a/native_client_sdk/src/libraries/c_salt/test/gtest_instance.h +++ b/native_client_sdk/src/libraries/gtest_ppapi/gtest_instance.h @@ -1,13 +1,11 @@ // 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. -#ifndef C_SALT_TEST_GTEST_INSTANCE_H_ -#define C_SALT_TEST_GTEST_INSTANCE_H_ +#ifndef GTEST_PPAPI_GTEST_INSTANCE_H_ +#define GTEST_PPAPI_GTEST_INSTANCE_H_ #include "ppapi/cpp/instance.h" -namespace c_salt { - // GTestInstance is a NaCl instance specifically dedicated to running // gtest-based unit tests. It creates a GTestRunner thread/singleton pair as // part of its Init function and runs all registered gtests once it @@ -28,7 +26,4 @@ class GTestInstance : public pp::Instance { virtual void HandleMessage(const pp::Var& var_message); }; -} // namespace c_salt - -#endif // C_SALT_TEST_GTEST_INSTANCE_H_ - +#endif // GTEST_PPAPI_GTEST_INSTANCE_H_ diff --git a/native_client_sdk/src/libraries/c_salt/test/gtest_module.cc b/native_client_sdk/src/libraries/gtest_ppapi/gtest_module.cc index 9b34c6e..5affc91 100644 --- a/native_client_sdk/src/libraries/c_salt/test/gtest_module.cc +++ b/native_client_sdk/src/libraries/gtest_ppapi/gtest_module.cc @@ -1,11 +1,9 @@ // 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. -#include "c_salt/test/gtest_instance.h" +#include "gtest_ppapi/gtest_instance.h" #include "ppapi/cpp/module.h" -namespace c_salt { - // GTestModule is a NaCl module dedicated to running gtest-based unit tests. // It creates an NaCl instance based on GTestInstance. class GTestModule : public pp::Module { @@ -14,15 +12,14 @@ class GTestModule : public pp::Module { ~GTestModule() {} virtual pp::Instance* CreateInstance(PP_Instance instance) { - return new c_salt::GTestInstance(instance); + return new GTestInstance(instance); } }; -} // namespace c_salt - namespace pp { + Module* CreateModule() { - return new c_salt::GTestModule(); + return new GTestModule(); } -} // namespace pp +} // namespace pp diff --git a/native_client_sdk/src/libraries/c_salt/test/gtest_nacl_environment.cc b/native_client_sdk/src/libraries/gtest_ppapi/gtest_nacl_environment.cc index aefb175..5cc51ec 100644 --- a/native_client_sdk/src/libraries/c_salt/test/gtest_nacl_environment.cc +++ b/native_client_sdk/src/libraries/gtest_ppapi/gtest_nacl_environment.cc @@ -1,9 +1,7 @@ // 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. -#include "c_salt/test/gtest_nacl_environment.h" - -namespace c_salt { +#include "gtest_ppapi/gtest_nacl_environment.h" pp::Instance* GTestNaclEnvironment::global_instance_ = NULL; @@ -14,6 +12,3 @@ void GTestNaclEnvironment::SetUp() { void GTestNaclEnvironment::TearDown() { } - -} // namespace c_salt - diff --git a/native_client_sdk/src/libraries/c_salt/test/gtest_nacl_environment.h b/native_client_sdk/src/libraries/gtest_ppapi/gtest_nacl_environment.h index 35a6043..759b775 100644 --- a/native_client_sdk/src/libraries/c_salt/test/gtest_nacl_environment.h +++ b/native_client_sdk/src/libraries/gtest_ppapi/gtest_nacl_environment.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef C_SALT_TEST_GTEST_NACL_ENVIRONMENT_H_ -#define C_SALT_TEST_GTEST_NACL_ENVIRONMENT_H_ +#ifndef GTEST_PPAPI_GTEST_NACL_ENVIRONMENT_H_ +#define GTEST_PPAPI_GTEST_NACL_ENVIRONMENT_H_ #include <cassert> #include "gtest/gtest.h" @@ -12,8 +12,6 @@ namespace pp { class Instance; } // namespace pp -namespace c_salt { - // A custom environment for NaCl gtest. class GTestNaclEnvironment : public ::testing::Environment { public: @@ -33,7 +31,4 @@ class GTestNaclEnvironment : public ::testing::Environment { static pp::Instance* global_instance_; }; -} // namespace c_salt - -#endif // C_SALT_TEST_GTEST_NACL_ENVIRONMENT_H_ - +#endif // GTEST_PPAPI_GTEST_NACL_ENVIRONMENT_H_ diff --git a/native_client_sdk/src/libraries/c_salt/test/gtest_runner.cc b/native_client_sdk/src/libraries/gtest_ppapi/gtest_runner.cc index fbe4808..b6e96d9 100644 --- a/native_client_sdk/src/libraries/c_salt/test/gtest_runner.cc +++ b/native_client_sdk/src/libraries/gtest_ppapi/gtest_runner.cc @@ -1,15 +1,13 @@ // 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. -#include "c_salt/test/gtest_runner.h" +#include "gtest_ppapi/gtest_runner.h" #include <cassert> -#include "c_salt/test/gtest_event_listener.h" -#include "c_salt/test/gtest_nacl_environment.h" #include "gtest/gtest.h" - -namespace c_salt { +#include "gtest_ppapi/gtest_event_listener.h" +#include "gtest_ppapi/gtest_nacl_environment.h" pthread_t GTestRunner::g_test_runner_thread_ = NACL_PTHREAD_ILLEGAL_THREAD_ID; GTestRunner* GTestRunner::gtest_runner_ = NULL; @@ -51,11 +49,11 @@ void GTestRunner::Init(pp::Instance* instance, int argc, char** argv) { ::testing::TestEventListeners& listeners = ::testing::UnitTest::GetInstance()->listeners(); delete listeners.Release(listeners.default_result_printer()); - listeners.Append(new c_salt::GTestEventListener(instance)); + listeners.Append(new GTestEventListener(instance)); // We use our own gtest environment, mainly to make the nacl instance // available to the individual unit tests. - c_salt::GTestNaclEnvironment* test_env = new c_salt::GTestNaclEnvironment(); + GTestNaclEnvironment* test_env = new GTestNaclEnvironment(); test_env->set_global_instance(instance); ::testing::AddGlobalTestEnvironment(test_env); } @@ -69,8 +67,6 @@ void GTestRunner::RunLoop() { assert(status_ == kRunTests); status_signal_.Unlock(); - RUN_ALL_TESTS(); + int result = RUN_ALL_TESTS(); + (void)result; } - -} // namespace c_salt - diff --git a/native_client_sdk/src/libraries/c_salt/test/gtest_runner.h b/native_client_sdk/src/libraries/gtest_ppapi/gtest_runner.h index 18f64bf..64745ea 100644 --- a/native_client_sdk/src/libraries/c_salt/test/gtest_runner.h +++ b/native_client_sdk/src/libraries/gtest_ppapi/gtest_runner.h @@ -1,18 +1,16 @@ // 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. -#ifndef C_SALT_TEST_GTEST_RUNNER_H_ -#define C_SALT_TEST_GTEST_RUNNER_H_ +#ifndef GTEST_PPAPI_GTEST_RUNNER_H_ +#define GTEST_PPAPI_GTEST_RUNNER_H_ -#include "c_salt/threading/pthread_ext.h" -#include "c_salt/threading/thread_condition.h" +#include "gtest_ppapi/pthread_ext.h" +#include "gtest_ppapi/thread_condition.h" namespace pp { class Instance; } // namespace pp -namespace c_salt { - // GTestRunner is a threaded singleton for running gtest-based unit tests. class GTestRunner { public: @@ -49,14 +47,11 @@ class GTestRunner { // The status and associated status signal are used to control the state of // the thread run loop. enum Status { kIdle, kRunTests }; - c_salt::threading::ThreadCondition status_signal_; + ThreadCondition status_signal_; Status status_; static pthread_t g_test_runner_thread_; static GTestRunner* gtest_runner_; }; -} // namespace c_salt - -#endif // C_SALT_TEST_GTEST_RUNNER_H_ - +#endif // GTEST_PPAPI_GTEST_RUNNER_H_ diff --git a/native_client_sdk/src/libraries/gtest_ppapi/library.dsc b/native_client_sdk/src/libraries/gtest_ppapi/library.dsc new file mode 100644 index 0000000..ef26d33 --- /dev/null +++ b/native_client_sdk/src/libraries/gtest_ppapi/library.dsc @@ -0,0 +1,35 @@ +{ + 'TOOLS': ['newlib', 'glibc'], + 'TARGETS': [ + { + 'NAME' : 'gtest_ppapi', + 'TYPE' : 'lib', + 'SOURCES' : [ + "gtest_event_listener.cc", + "gtest_instance.cc", + "gtest_module.cc", + "gtest_nacl_environment.cc", + "gtest_runner.cc", + ], + } + ], + 'HEADERS': [ + { + 'FILES': [ + "condition_lock.h", + "gtest_event_listener.h", + "gtest_instance.h", + "gtest_nacl_environment.h", + "gtest_runner.h", + "pthread_ext.h", + "ref_count.h", + "scoped_mutex_lock.h", + "thread_condition.h", + ], + 'DEST': 'include/gtest_ppapi', + }, + ], + 'DEST': 'testing', + 'NAME': 'gtest_ppapi', + 'EXPERIMENTAL': True +} diff --git a/native_client_sdk/src/libraries/c_salt/threading/pthread_ext.h b/native_client_sdk/src/libraries/gtest_ppapi/pthread_ext.h index 511adfa..6d60957 100644 --- a/native_client_sdk/src/libraries/c_salt/threading/pthread_ext.h +++ b/native_client_sdk/src/libraries/gtest_ppapi/pthread_ext.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef PTHREAD_EXT_H_ -#define PTHREAD_EXT_H_ +#ifndef GTEST_PPAPI_PTHREAD_EXT_H_ +#define GTEST_PPAPI_PTHREAD_EXT_H_ // Include wrapper on pthread.h, with a few handy constants. @@ -11,5 +11,4 @@ #define PTHREAD_MUTEX_SUCCESS 0 -#endif // PTHREAD_EXT_H_ - +#endif // GTEST_PPAPI_PTHREAD_EXT_H_ diff --git a/native_client_sdk/src/libraries/c_salt/threading/ref_count.h b/native_client_sdk/src/libraries/gtest_ppapi/ref_count.h index 0efae615..e0d89a2 100644 --- a/native_client_sdk/src/libraries/c_salt/threading/ref_count.h +++ b/native_client_sdk/src/libraries/gtest_ppapi/ref_count.h @@ -1,12 +1,10 @@ // 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. -#ifndef REF_COUNT_H_ -#define REF_COUNT_H_ +#ifndef GTEST_PPAPI_REF_COUNT_H_ +#define GTEST_PPAPI_REF_COUNT_H_ -#include "c_salt/threading/pthread_ext.h" - -namespace threading { +#include "gtest_ppapi/pthread_ext.h" // A thread-safe reference counter for class CompletionCallbackFactory. class RefCount { @@ -41,6 +39,4 @@ class RefCount { pthread_mutex_t mutex_; }; -} // namespace threading -#endif // REF_COUNT_H_ - +#endif // GTEST_PPAPI_REF_COUNT_H_ diff --git a/native_client_sdk/src/libraries/c_salt/threading/scoped_mutex_lock.h b/native_client_sdk/src/libraries/gtest_ppapi/scoped_mutex_lock.h index 10fbf61d..3830396 100644 --- a/native_client_sdk/src/libraries/c_salt/threading/scoped_mutex_lock.h +++ b/native_client_sdk/src/libraries/gtest_ppapi/scoped_mutex_lock.h @@ -2,12 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef SCOPED_MUTEX_LOCK_H_ -#define SCOPED_MUTEX_LOCK_H_ +#ifndef GTEST_PPAPI_SCOPED_MUTEX_LOCK_H_ +#define GTEST_PPAPI_SCOPED_MUTEX_LOCK_H_ -#include "c_salt/threading/pthread_ext.h" +#include "gtest_ppapi/pthread_ext.h" -namespace threading { // A small helper RAII class that implements a scoped pthread_mutex lock. class ScopedMutexLock { public: @@ -26,7 +25,5 @@ class ScopedMutexLock { private: pthread_mutex_t* mutex_; // Weak reference. }; -} // namespace threading - -#endif // SCOPED_MUTEX_LOCK_H_ +#endif // GTEST_PPAPI_SCOPED_MUTEX_LOCK_H_ diff --git a/native_client_sdk/src/libraries/c_salt/threading/thread_condition.h b/native_client_sdk/src/libraries/gtest_ppapi/thread_condition.h index 19c6399..285a5ba 100644 --- a/native_client_sdk/src/libraries/c_salt/threading/thread_condition.h +++ b/native_client_sdk/src/libraries/gtest_ppapi/thread_condition.h @@ -2,15 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef THREAD_CONDITION_H_ -#define THREAD_CONDITION_H_ +#ifndef GTEST_PPAPI_THREAD_CONDITION_H_ +#define GTEST_PPAPI_THREAD_CONDITION_H_ -#include "c_salt/threading/pthread_ext.h" +#include "gtest_ppapi/pthread_ext.h" struct timespec; -namespace c_salt { -namespace threading { // A wrapper class for condition signaling. Contains a mutex and condition // pair. class ThreadCondition { @@ -69,8 +67,5 @@ class ThreadCondition { pthread_mutex_t cond_mutex_; pthread_cond_t condition_; }; -} // namespace threading -} // namespace c_salt - -#endif // THREAD_CONDITION_H_ +#endif // GTEST_PPAPI_THREAD_CONDITION_H_ diff --git a/native_client_sdk/src/libraries/scons b/native_client_sdk/src/libraries/scons deleted file mode 100755 index 17e9350..0000000 --- a/native_client_sdk/src/libraries/scons +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2011 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. - -readonly SCRIPT_DIR="$(dirname "$0")" -readonly SCRIPT_DIR_ABS="$(cd "${SCRIPT_DIR}" ; pwd -P)" -readonly SRC_DIR="$(dirname $(dirname $(dirname ${SCRIPT_DIR_ABS})))" - -# NACL_SDK_ROOT must be set. -if [ x"${NACL_SDK_ROOT}"x == "xx" ] ; then - echo "Error: NACL_SDK_ROOT is not set." - exit 1; -fi - -# NACL_TARGET_PLATFORM is really the name of a folder with the base dir - -# usually NACL_SDK_ROOT - within which the toolchain for the target platform -# are found. -# Replace the platform with the name of your target platform. For example, to -# build applications that target the pepper_17 API, set -# NACL_TARGET_PLATFORM="pepper_17" -if [ x"${NACL_TARGET_PLATFORM}"x == "xx" ] ; then - export NACL_TARGET_PLATFORM="pepper_17" -fi - -readonly NACL_PLATFORM_DIR="${NACL_SDK_ROOT}/${NACL_TARGET_PLATFORM}" - -SCONS_DIR="${NACL_PLATFORM_DIR}/third_party/scons-2.0.1" - -if [ ! -f ${SCONS_DIR}/script/scons ]; then - SCONS_DIR="${SRC_DIR}/third_party/scons-2.0.1" -fi - -BASE_SCRIPT="${SCONS_DIR}/script/scons" - -export SCONS_LIB_DIR="${SCONS_DIR}/engine" -export PYTHONPATH="${SCONS_LIB_DIR}" -export PYTHONPATH="${PYTHONPATH}:${NACL_PLATFORM_DIR}/build_tools" - -# We have to do this because scons overrides PYTHONPATH and does not preserve -# what is provided by the OS. The custom variable name won't be overwritten. -export PYMOX="${NACL_PLATFORM_DIR}/third_party/pymox/src" - -"${BASE_SCRIPT}" --file=build.scons \ - --site-dir="${SCRIPT_DIR_ABS}/../build_tools/nacl_sdk_scons" \ - $* diff --git a/native_client_sdk/src/libraries/scons.bat b/native_client_sdk/src/libraries/scons.bat deleted file mode 100755 index d56f245..0000000 --- a/native_client_sdk/src/libraries/scons.bat +++ /dev/null @@ -1,50 +0,0 @@ -@echo off - -:: Copyright (c) 2011 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. - -setlocal - -:: NACL_SDK_ROOT must be set. -if not defined NACL_SDK_ROOT ( - echo Error: NACL_SDK_ROOT is not set. - echo Please set NACL_SDK_ROOT to the full path of the Native Client SDK. - echo For example: - echo set NACL_SDK_ROOT=D:\nacl_sdk - goto end -) - -:: NACL_TARGET_PLATFORM is really the name of a folder with the base dir - -:: usually NACL_SDK_ROOT - within which the toolchain for the target platform -:: are found. -:: Replace the platform with the name of your target platform. For example, to -:: build applications that target the pepper_17 API, set -:: NACL_TARGET_PLATFORM=pepper_17 -if not defined NACL_TARGET_PLATFORM ( - set NACL_TARGET_PLATFORM=pepper_17 -) - -set NACL_PLATFORM_DIR=%NACL_SDK_ROOT%\%NACL_TARGET_PLATFORM% - -set SCONS_DIR=%NACL_PLATFORM_DIR%\third_party\scons-2.0.1 -if exist %SCONS_DIR% goto gotscons -set SCONS_DIR=%~dp0..\..\..\third_party\scons-2.0.1 -:gotscons - -set SCONS_LIB_DIR=%SCONS_DIR%\engine -set PYTHONPATH=%SCONS_LIB_DIR%;%NACL_PLATFORM_DIR%\build_tools - -:: We have to do this because scons overrides PYTHONPATH and does not preserve -:: what is provided by the OS. The custom variable name won't be overwritten. -set PYMOX=%NACL_PLATFORM_DIR%\third_party\pymox\src - -set BASE_SCRIPT=%SCONS_DIR%\script\scons - -:: Run the included copy of scons. -python -O -OO %BASE_SCRIPT% ^ ---warn no-visual-c-missing ^ ---file=build.scons ^ ---site-dir="%~dp0..\build_tools\nacl_sdk_scons" %* - -:end |