Split out //aos/common:queue_testutils and rename stuff
It had three independent pieces of functionality, one of which had a
pretty bad name.
Change-Id: I4a6937692fa36e74f814b3be4d4c5bc751947088
diff --git a/aos/linux_code/ipc_lib/BUILD b/aos/linux_code/ipc_lib/BUILD
index 8f26882..444c2bb 100644
--- a/aos/linux_code/ipc_lib/BUILD
+++ b/aos/linux_code/ipc_lib/BUILD
@@ -84,10 +84,11 @@
],
deps = [
'//aos/testing:googletest',
+ '//aos/testing:prevent_exit',
':queue',
'//aos/common/logging',
':core_lib',
- '//aos/common:queue_testutils',
+ '//aos/testing:test_shm',
'//aos/common:time',
'//aos/common:die',
'//aos/common/util:thread',
@@ -106,7 +107,7 @@
deps = [
'//aos/testing:googletest',
'//aos/common:time',
- '//aos/common:queue_testutils',
+ '//aos/testing:test_shm',
'//aos/common:mutex',
':core_lib',
'//aos/common:die',
diff --git a/aos/linux_code/ipc_lib/ipc_stress_test.cc b/aos/linux_code/ipc_lib/ipc_stress_test.cc
index 880d226..2ca4628 100644
--- a/aos/linux_code/ipc_lib/ipc_stress_test.cc
+++ b/aos/linux_code/ipc_lib/ipc_stress_test.cc
@@ -9,7 +9,6 @@
#include <string>
#include "aos/common/time.h"
-#include "aos/common/queue_testutils.h"
#include "aos/common/type_traits.h"
#include "aos/common/mutex.h"
#include "aos/linux_code/ipc_lib/core_lib.h"
@@ -17,6 +16,7 @@
#include "aos/common/libc/dirname.h"
#include "aos/common/libc/aos_strsignal.h"
#include "aos/common/logging/logging.h"
+#include "aos/testing/test_shm.h"
// This runs all of the IPC-related tests in a bunch of parallel processes for a
// while and makes sure that they don't fail. It also captures the stdout and
@@ -210,7 +210,7 @@
return EXIT_FAILURE;
}
- ::aos::common::testing::GlobalCoreInstance global_core;
+ ::aos::testing::TestSharedMemory my_shm_;
Shared *shared = static_cast<Shared *>(shm_malloc(sizeof(Shared)));
new (shared) Shared(time::Time::Now() + kTestTime);
diff --git a/aos/linux_code/ipc_lib/raw_queue_test.cc b/aos/linux_code/ipc_lib/raw_queue_test.cc
index adb84b9..ec07a0b 100644
--- a/aos/linux_code/ipc_lib/raw_queue_test.cc
+++ b/aos/linux_code/ipc_lib/raw_queue_test.cc
@@ -12,18 +12,18 @@
#include "aos/linux_code/ipc_lib/core_lib.h"
#include "aos/common/type_traits.h"
-#include "aos/common/queue_testutils.h"
+#include "aos/testing/test_shm.h"
#include "aos/common/time.h"
#include "aos/common/logging/logging.h"
#include "aos/common/die.h"
#include "aos/common/util/thread.h"
#include "aos/common/util/options.h"
#include "aos/common/util/death_test_log_implementation.h"
+#include "aos/testing/prevent_exit.h"
using ::testing::AssertionResult;
using ::testing::AssertionSuccess;
using ::testing::AssertionFailure;
-using ::aos::common::testing::GlobalCoreInstance;
namespace aos {
namespace testing {
@@ -178,7 +178,7 @@
kForkSleep.sec(), kForkSleep.nsec());
time::SleepFor(kForkSleep);
}
- ::aos::common::testing::PreventExit();
+ ::aos::testing::PreventExit();
function(arg);
CHECK_NE(-1, futex_set(done));
exit(EXIT_SUCCESS);
@@ -319,7 +319,7 @@
}
private:
- GlobalCoreInstance my_core;
+ ::aos::testing::TestSharedMemory my_shm_;
};
char *RawQueueTest::fatal_failure;