Rename mock arch to fake.
This fits better with the definitions of test doubles as the arch
pretends to be an arch rather than just providing stubs.
Change-Id: I07856e1c04e2e97f6df4daf2b4420fa07763848f
diff --git a/BUILD.gn b/BUILD.gn
index 7962f70..8258888 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -27,7 +27,7 @@
testonly = true
deps = [
- "//src:unit_tests($mock_toolchain)",
+ "//src:unit_tests($fake_toolchain)",
]
}
diff --git a/build/BUILD.gn b/build/BUILD.gn
index ecc413d..11b1d78 100644
--- a/build/BUILD.gn
+++ b/build/BUILD.gn
@@ -30,7 +30,7 @@
cflags_cc = [ "-std=c++14" ]
- if (current_toolchain == mock_toolchain ||
+ if (current_toolchain == fake_toolchain ||
current_toolchain == arch_toolchain) {
include_dirs = [
"//inc",
diff --git a/build/BUILDCONFIG.gn b/build/BUILDCONFIG.gn
index 605539a..302e3f4 100644
--- a/build/BUILDCONFIG.gn
+++ b/build/BUILDCONFIG.gn
@@ -31,7 +31,7 @@
assert(host_os == "linux", "Only linux builds are currently supported")
# Check that the requested architecture is supported
-assert(arch == "aarch64" || arch == "mock", "Unsupported arch: $arch")
+assert(arch == "aarch64" || arch == "fake", "Unsupported arch: $arch")
# Setup the standard variables
if (target_os == "") {
@@ -77,12 +77,12 @@
if (use_gcc) {
host_toolchain = "//build/toolchain/host:gcc"
target_toolchain = "//build/toolchain/host:gcc"
- mock_toolchain = "//build/toolchain/host:gcc_mock_arch"
+ fake_toolchain = "//build/toolchain/host:gcc_fake_arch"
arch_toolchain = "//build/toolchain/arch:gcc_${arch}"
} else {
host_toolchain = "//build/toolchain/host:clang"
target_toolchain = "//build/toolchain/host:clang"
- mock_toolchain = "//build/toolchain/host:clang_mock_arch"
+ fake_toolchain = "//build/toolchain/host:clang_fake_arch"
arch_toolchain = "//build/toolchain/arch:clang_${arch}"
}
diff --git a/build/toolchain/host/BUILD.gn b/build/toolchain/host/BUILD.gn
index ed1e510..dd344b7 100644
--- a/build/toolchain/host/BUILD.gn
+++ b/build/toolchain/host/BUILD.gn
@@ -135,16 +135,16 @@
cflags = "-fcolor-diagnostics"
}
-cc_toolchain("clang_mock_arch") {
+cc_toolchain("clang_fake_arch") {
ar = "llvm-ar"
cc = "clang"
cxx = "clang++"
cflags = "-fcolor-diagnostics"
toolchain_args = {
- # When building for the host, use the mock architecture to make things
+ # When building for the host, use the fake architecture to make things
# testable.
- arch = "mock"
+ arch = "fake"
}
}
@@ -155,15 +155,15 @@
cflags = "-fdiagnostics-color=always"
}
-cc_toolchain("gcc_mock_arch") {
+cc_toolchain("gcc_fake_arch") {
ar = "ar"
cc = "gcc"
cxx = "g++"
cflags = "-fdiagnostics-color=always"
toolchain_args = {
- # When building for the host, use the mock architecture to make things
+ # When building for the host, use the fake architecture to make things
# testable.
- arch = "mock"
+ arch = "fake"
}
}
diff --git a/kokoro/ubuntu/test.sh b/kokoro/ubuntu/test.sh
index f835b39..3c22c94 100755
--- a/kokoro/ubuntu/test.sh
+++ b/kokoro/ubuntu/test.sh
@@ -31,10 +31,10 @@
HFTEST="$TIMEOUT 30s ./test/vm/hftest.py --out $OUT/clang_aarch64 --initrd"
# Run the host unit tests
-mkdir -p $OUT/clang_mock_arch/test_log/unit_tests
-$TIMEOUT 30s $OUT/clang_mock_arch/unit_tests \
- --gtest_output="xml:$OUT/clang_mock_arch/test_log/unit_tests/sponge_log.xml" \
- | tee $OUT/clang_mock_arch/test_log/unit_tests/sponge_log.log
+mkdir -p $OUT/clang_fake_arch/test_log/unit_tests
+$TIMEOUT 30s $OUT/clang_fake_arch/unit_tests \
+ --gtest_output="xml:$OUT/clang_fake_arch/test_log/unit_tests/sponge_log.xml" \
+ | tee $OUT/clang_fake_arch/test_log/unit_tests/sponge_log.log
# Run the tests with a timeout so they can't loop forever.
$HFTEST primary_only_test
diff --git a/src/arch/mock/BUILD.gn b/src/arch/fake/BUILD.gn
similarity index 91%
rename from src/arch/mock/BUILD.gn
rename to src/arch/fake/BUILD.gn
index 356ad60..4089bc5 100644
--- a/src/arch/mock/BUILD.gn
+++ b/src/arch/fake/BUILD.gn
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# Mock implementation of putchar logs to the console.
+# Fake implementation of putchar logs to the console.
source_set("putchar") {
sources = [
"putchar.c",
diff --git a/src/arch/mock/inc/hf/arch/addr.h b/src/arch/fake/inc/hf/arch/addr.h
similarity index 100%
rename from src/arch/mock/inc/hf/arch/addr.h
rename to src/arch/fake/inc/hf/arch/addr.h
diff --git a/src/arch/mock/inc/hf/arch/cpu.h b/src/arch/fake/inc/hf/arch/cpu.h
similarity index 100%
rename from src/arch/mock/inc/hf/arch/cpu.h
rename to src/arch/fake/inc/hf/arch/cpu.h
diff --git a/src/arch/mock/inc/hf/arch/mm.h b/src/arch/fake/inc/hf/arch/mm.h
similarity index 93%
rename from src/arch/mock/inc/hf/arch/mm.h
rename to src/arch/fake/inc/hf/arch/mm.h
index 96f7014..9c16cb7 100644
--- a/src/arch/mock/inc/hf/arch/mm.h
+++ b/src/arch/fake/inc/hf/arch/mm.h
@@ -22,7 +22,7 @@
#include "hf/addr.h"
/*
- * Our mock architecture has page tables rather similar to aarch64, but not
+ * Our fake architecture has page tables rather similar to aarch64, but not
* quite.
* - The highest level table is always 2, lowest level is 0.
* - Blocks are allowed at all levels.
@@ -111,7 +111,7 @@
(pte & 0x3) == (level == 0 ? 0x3 : 0x1);
}
-static inline uint64_t hf_arch_mock_mm_clear_pte_attrs(pte_t pte)
+static inline uint64_t hf_arch_fake_mm_clear_pte_attrs(pte_t pte)
{
return pte & ~0x3;
}
@@ -123,7 +123,7 @@
static inline paddr_t arch_mm_clear_pa(paddr_t pa)
{
/* This is assumed to round down to the page boundary. */
- return pa_init(hf_arch_mock_mm_clear_pte_attrs(pa_addr(pa)) &
+ return pa_init(hf_arch_fake_mm_clear_pte_attrs(pa_addr(pa)) &
~((1 << PAGE_BITS) - 1));
}
@@ -133,7 +133,7 @@
*/
static inline paddr_t arch_mm_block_from_pte(pte_t pte)
{
- return pa_init(hf_arch_mock_mm_clear_pte_attrs(pte));
+ return pa_init(hf_arch_fake_mm_clear_pte_attrs(pte));
}
/**
@@ -142,7 +142,7 @@
*/
static inline paddr_t arch_mm_table_from_pte(pte_t pte)
{
- return pa_init(hf_arch_mock_mm_clear_pte_attrs(pte));
+ return pa_init(hf_arch_fake_mm_clear_pte_attrs(pte));
}
/**
diff --git a/src/arch/mock/putchar.c b/src/arch/fake/putchar.c
similarity index 100%
rename from src/arch/mock/putchar.c
rename to src/arch/fake/putchar.c