From 1c10e7654f2b4cdaf8c24b8c6a29f62a80bbd5b3 Mon Sep 17 00:00:00 2001 From: Sandy Carter Date: Mon, 15 Jul 2019 16:52:04 -0400 Subject: [PATCH] [cpu] Test cpu-test on travis --- .travis.yml | 3 +++ src/xenia/cpu/testing/add_test.cc | 2 +- src/xenia/cpu/testing/pack_test.cc | 7 ++++--- src/xenia/cpu/testing/unpack_test.cc | 2 +- src/xenia/cpu/testing/util.h | 1 - 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2075010ff..7cc71f9e4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -59,6 +59,9 @@ script: # Build and run base tests. - if [[ $BUILD == true ]]; then ./xenia-build build --config=$CONFIG --target=xenia-base-tests; fi - if [[ $BUILD == true ]]; then ./build/bin/Linux/$CONFIG/xenia-base-tests; fi + # Build and run cpu tests. + - if [[ $BUILD == true ]]; then ./xenia-build build --config=$CONFIG --target=xenia-cpu-tests; fi + - if [[ $BUILD == true ]]; then ./build/bin/Linux/$CONFIG/xenia-cpu-tests; fi # Build and run ppc tests. - if [[ $BUILD == true ]]; then ./xenia-build gentests; fi - if [[ $BUILD == true ]]; then ./xenia-build build --config=$CONFIG --target=xenia-cpu-ppc-tests; fi diff --git a/src/xenia/cpu/testing/add_test.cc b/src/xenia/cpu/testing/add_test.cc index 8b0a9db54..c1b1b243a 100644 --- a/src/xenia/cpu/testing/add_test.cc +++ b/src/xenia/cpu/testing/add_test.cc @@ -265,7 +265,7 @@ TEST_CASE("ADD_I64", "[instr]") { }, [](PPCContext* ctx) { auto result = ctx->r[3]; - REQUIRE(result == -15); + REQUIRE(result == static_cast(-15)); }); test.Run( [](PPCContext* ctx) { diff --git a/src/xenia/cpu/testing/pack_test.cc b/src/xenia/cpu/testing/pack_test.cc index 915272128..dfac068d6 100644 --- a/src/xenia/cpu/testing/pack_test.cc +++ b/src/xenia/cpu/testing/pack_test.cc @@ -51,7 +51,7 @@ TEST_CASE("PACK_FLOAT16_2", "[instr]") { }, [](PPCContext* ctx) { auto result = ctx->v[3]; - REQUIRE(result == vec128i(0, 0, 0, 0x7FFFFFFF)); + REQUIRE(result == vec128i(0, 0, 0, 0x7BFFFBFF)); }); test.Run( [](PPCContext* ctx) { @@ -80,7 +80,7 @@ TEST_CASE("PACK_FLOAT16_4", "[instr]") { [](PPCContext* ctx) { auto result = ctx->v[3]; REQUIRE(result == - vec128i(0x00000000, 0x00000000, 0x64D26D8C, 0x48824491)); + vec128i(0x00000000, 0x00000000, 0x64D26D8B, 0x48814491)); }); } @@ -92,7 +92,8 @@ TEST_CASE("PACK_SHORT_2", "[instr]") { test.Run([](PPCContext* ctx) { ctx->v[4] = vec128i(0); }, [](PPCContext* ctx) { auto result = ctx->v[3]; - REQUIRE(result == vec128i(0)); + REQUIRE(result == + vec128i(0x00000000, 0x00000000, 0x00000000, 0x80018001)); }); test.Run( [](PPCContext* ctx) { diff --git a/src/xenia/cpu/testing/unpack_test.cc b/src/xenia/cpu/testing/unpack_test.cc index 284d7e76c..04aad1a75 100644 --- a/src/xenia/cpu/testing/unpack_test.cc +++ b/src/xenia/cpu/testing/unpack_test.cc @@ -55,7 +55,7 @@ TEST_CASE("UNPACK_FLOAT16_2", "[instr]") { [](PPCContext* ctx) { auto result = ctx->v[3]; REQUIRE(result == - vec128i(0x47FFE000, 0xC7FFE000, 0x00000000, 0x3F800000)); + vec128i(0x7FFFE000, 0xFFFFE000, 0x00000000, 0x3F800000)); }); test.Run([](PPCContext* ctx) { ctx->v[4] = vec128i(0, 0, 0, 0x55556666); }, [](PPCContext* ctx) { diff --git a/src/xenia/cpu/testing/util.h b/src/xenia/cpu/testing/util.h index 075903455..1e9a956fa 100644 --- a/src/xenia/cpu/testing/util.h +++ b/src/xenia/cpu/testing/util.h @@ -73,7 +73,6 @@ class TestFunction { uint32_t stack_address = memory_size - stack_size; uint32_t thread_state_address = stack_address - 0x1000; auto thread_state = std::make_unique(processor.get(), 0x100); - assert_always(); // TODO: Allocate a thread stack!!! auto ctx = thread_state->context(); ctx->lr = 0xBCBCBCBC;