Skip to content

Commit d519ecc

Browse files
feat: add tests
1 parent 372f339 commit d519ecc

24 files changed

Lines changed: 654 additions & 34 deletions

File tree

.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.name

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/fileTemplates/includes/C File Header.h

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION VERSION 3.30)
2-
project(JavaObjectStreams VERSION 1.0.1) #dev version atm but too lazy to set that up, just dont create git tag until it properly deserializes again.
2+
project(JavaObjectStreams VERSION 1.0.2)
33

44
set(CMAKE_CXX_STANDARD 20)
55

tests/CMakeLists.txt

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,5 @@
11
cmake_minimum_required(VERSION VERSION 3.30)
22
project(JavaObjectStreams.Tests)
33

4-
set(CMAKE_CXX_STANDARD 23)
5-
6-
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
7-
8-
set(FILES
9-
src/JavaObjectStreamsTests.cpp
10-
)
11-
12-
include(FetchContent)
13-
if (NOT TARGET tfw)
14-
FetchContent_Declare(
15-
tfw
16-
GIT_REPOSITORY https://codeberg.org/Dexrn/tfw.git
17-
GIT_TAG 1.0.3
18-
GIT_SHALLOW TRUE
19-
)
20-
FetchContent_MakeAvailable(tfw)
21-
endif()
22-
23-
add_executable(JavaObjectStreams.Tests ${FILES})
24-
25-
target_include_directories(JavaObjectStreams.Tests
26-
PUBLIC
27-
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
28-
)
29-
30-
target_link_libraries(JavaObjectStreams.Tests PRIVATE JavaObjectStreams tfw)
31-
32-
# ENABLE INDIVIDUAL TESTS HERE
33-
target_compile_definitions(JavaObjectStreams.Tests PRIVATE
34-
READ_OBJECT_FILE=true
35-
)
4+
add_subdirectory(cpp)
5+
add_subdirectory(java)

tests/cpp/CMakeLists.txt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
cmake_minimum_required(VERSION VERSION 3.30)
2+
project(JavaObjectStreams.Tests.CPP)
3+
4+
set(CMAKE_CXX_STANDARD 23)
5+
6+
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
7+
8+
set(FILES
9+
src/JavaObjectStreamsTests.cpp
10+
)
11+
12+
include(FetchContent)
13+
if (NOT TARGET tfw)
14+
FetchContent_Declare(
15+
tfw
16+
GIT_REPOSITORY https://codeberg.org/Dexrn/tfw.git
17+
GIT_TAG 1.0.3
18+
GIT_SHALLOW TRUE
19+
)
20+
FetchContent_MakeAvailable(tfw)
21+
endif()
22+
23+
add_executable(JavaObjectStreams.Tests.CPP ${FILES})
24+
25+
target_include_directories(JavaObjectStreams.Tests.CPP
26+
PUBLIC
27+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
28+
)
29+
30+
target_link_libraries(JavaObjectStreams.Tests.CPP PRIVATE JavaObjectStreams tfw)
31+
32+
# ENABLE INDIVIDUAL TESTS HERE
33+
target_compile_definitions(JavaObjectStreams.Tests.CPP PRIVATE
34+
READ_OBJECT_FILE=true
35+
)
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
#include <TestFramework/TestFramework.h>
1212

1313
int main() {
14-
//todo add tests
14+
//todo add all tests
15+
tfw::TestFramework::getInstance()->addTest(READ_OBJECT_FILE, "Read input object", [](const tfw::test::util::TestOutputLogger &logger) {
16+
throw std::runtime_error("Not implemented");
17+
});
18+
1519
tfw::TestFramework::getInstance()->run();
1620

1721
return 0;

tests/java/.gitignore

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
.gradle
2+
build/
3+
!gradle/wrapper/gradle-wrapper.jar
4+
!**/src/main/**/build/
5+
!**/src/test/**/build/
6+
.kotlin
7+
8+
### IntelliJ IDEA ###
9+
.idea/modules.xml
10+
.idea/jarRepositories.xml
11+
.idea/compiler.xml
12+
.idea/libraries/
13+
*.iws
14+
*.iml
15+
*.ipr
16+
out/
17+
!**/src/main/**/out/
18+
!**/src/test/**/out/
19+
20+
### Eclipse ###
21+
.apt_generated
22+
.classpath
23+
.factorypath
24+
.project
25+
.settings
26+
.springBeans
27+
.sts4-cache
28+
bin/
29+
!**/src/main/**/bin/
30+
!**/src/test/**/bin/
31+
32+
### NetBeans ###
33+
/nbproject/private/
34+
/nbbuild/
35+
/dist/
36+
/nbdist/
37+
/.nb-gradle/
38+
39+
### VS Code ###
40+
.vscode/
41+
42+
### Mac OS ###
43+
.DS_Store

tests/java/.idea/.gitignore

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/java/.idea/.name

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)