@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [1.?.?] - ?-?-?
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Unit tests
|
||||||
|
|
||||||
## [1.31.2] - 2021-02-06
|
## [1.31.2] - 2021-02-06
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
@@ -111,6 +116,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Makefile
|
- Makefile
|
||||||
- Primitive floors sample
|
- Primitive floors sample
|
||||||
|
|
||||||
|
[1.?.?]: https://github.com/h4570/tyra/compare/v1.31.2-alpha...v1.?.?-alpha
|
||||||
[1.31.2]: https://github.com/h4570/tyra/compare/v1.29.1-alpha...v1.31.2-alpha
|
[1.31.2]: https://github.com/h4570/tyra/compare/v1.29.1-alpha...v1.31.2-alpha
|
||||||
[1.29.1]: https://github.com/h4570/tyra/compare/1.1.0...v1.29.1-alpha
|
[1.29.1]: https://github.com/h4570/tyra/compare/1.1.0...v1.29.1-alpha
|
||||||
[1.1.0]: https://github.com/h4570/tyra/compare/1.0.0...1.1.0
|
[1.1.0]: https://github.com/h4570/tyra/compare/1.0.0...1.1.0
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
.vscode/
|
||||||
|
bin/**
|
||||||
|
fonts/**
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
EE_BIN = unit_tests.elf
|
||||||
|
|
||||||
|
TYRA_DIR = ./../engine
|
||||||
|
PCSX2_PATH = /mnt/c/Program\ Files\ \(x86\)/PCSX2/pcsx2.exe
|
||||||
|
WSL_TYRA_PATH = \\\\wsl$$\\PS2-DEV\\repos\\tyra
|
||||||
|
|
||||||
|
EE_OBJS = \
|
||||||
|
tests/utils/math.o \
|
||||||
|
main.o
|
||||||
|
|
||||||
|
EE_LIBS = -ltyra
|
||||||
|
|
||||||
|
all: $(EE_BIN)
|
||||||
|
$(EE_STRIP) --strip-all $(EE_BIN)
|
||||||
|
mv $(EE_BIN) bin/$(EE_BIN)
|
||||||
|
rm $(EE_OBJS)
|
||||||
|
|
||||||
|
rebuild-engine:
|
||||||
|
cd $(TYRA_DIR) && make clean && make
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(EE_OBJS)
|
||||||
|
|
||||||
|
run: $(EE_BIN)
|
||||||
|
killall -v ps2client || true
|
||||||
|
ps2client reset
|
||||||
|
ps2client reset
|
||||||
|
$(EE_STRIP) --strip-all $(EE_BIN)
|
||||||
|
mv $(EE_BIN) bin/$(EE_BIN)
|
||||||
|
rm $(EE_OBJS)
|
||||||
|
cd bin/ && ps2client execee host:$(EE_BIN)
|
||||||
|
|
||||||
|
run-pcsx2:
|
||||||
|
taskkill.exe /f /t /im pcsx2.exe || true
|
||||||
|
$(PCSX2_PATH) --elf=$(WSL_TYRA_PATH)\\src\\unit_tests\\bin\\unit_tests.elf
|
||||||
|
|
||||||
|
|
||||||
|
show:
|
||||||
|
cat bin/test-result.txt
|
||||||
|
|
||||||
|
include $(TYRA_DIR)/Makefile.pref
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
# ______ ____ ___
|
||||||
|
# | \/ ____| |___|
|
||||||
|
# | | | \ | |
|
||||||
|
#-----------------------------------------------------------------------
|
||||||
|
# Copyright 2021, tyra - https://github.com/h4570/tyra
|
||||||
|
# Licenced under Apache License 2.0
|
||||||
|
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
// To run unit tests
|
||||||
|
// 1. Make sure that your $(PCSX2_PATH) and $(WSL_TYRA_PATH) Makefile variables are correct
|
||||||
|
// 2. make && make run-pcsx2 && make show
|
||||||
|
// 3. Click 'X' in PCSX2 when screen will be on memory card selection stage
|
||||||
|
// 4. Voila :)
|
||||||
|
|
||||||
|
const int CUSTOM_ARGC = 5;
|
||||||
|
char const *CUSTOM_ARGV[] = {
|
||||||
|
"",
|
||||||
|
"--reporter",
|
||||||
|
"console",
|
||||||
|
"--out",
|
||||||
|
"test-result.txt"};
|
||||||
|
|
||||||
|
#define CATCH_CONFIG_MAIN
|
||||||
|
#define CATCH_CONFIG_NO_POSIX_SIGNALS
|
||||||
|
|
||||||
|
#include "catch.hpp"
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
# ______ ____ ___
|
||||||
|
# | \/ ____| |___|
|
||||||
|
# | | | \ | |
|
||||||
|
#-----------------------------------------------------------------------
|
||||||
|
# Copyright 2021, tyra - https://github.com/h4570/tyra
|
||||||
|
# Licenced under Apache License 2.0
|
||||||
|
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <catch.hpp>
|
||||||
|
#include <utils/math.hpp>
|
||||||
|
|
||||||
|
SCENARIO("min(a,b) greater 'a' should return 'b'", "[math.cpp]")
|
||||||
|
{
|
||||||
|
REQUIRE(Math::min(10, 5) == 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
SCENARIO("min(a,b) greater 'b' should return 'a'", "[math.cpp]")
|
||||||
|
{
|
||||||
|
REQUIRE(Math::min(-5, 5) == -5);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user