Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Unit-Test Framework #129

Merged
merged 5 commits into from
Sep 29, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-clang-diagnostic-c++17-extensions
4 changes: 2 additions & 2 deletions applications/editor_application/editor_application.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(SolutionDir)deps\lib\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>args-application.lib;args-audio.lib;args-core.lib;args-editor.lib;args-networking.lib;args-physics.lib;args-rendering.lib;args-scripting.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>args-application.lib;args-audio.lib;args-core.lib;args-editor.lib;args-networking.lib;args-physics.lib;args-rendering.lib;args-scripting.lib;OpenCL.lib;glfw3.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand All @@ -90,7 +90,7 @@
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(SolutionDir)deps\lib\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>args-application.lib;args-audio.lib;args-core.lib;args-editor.lib;args-networking.lib;args-physics.lib;args-rendering.lib;args-scripting.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>args-application.lib;args-audio.lib;args-core.lib;args-editor.lib;args-networking.lib;args-physics.lib;args-rendering.lib;args-scripting.lib;OpenCL.lib;glfw3.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<ProjectGuid>{c578d912-3beb-4ee1-8aa1-e9eacf7ca441}</ProjectGuid>
<RootNamespace>testgame</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ProjectName>sandbox</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
Expand Down Expand Up @@ -70,7 +71,7 @@
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(SolutionDir)deps\lib\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>args-application.lib;args-audio.lib;args-core.lib;args-editor.lib;args-networking.lib;args-physics.lib;args-rendering.lib;args-scripting.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>args-application.lib;args-audio.lib;args-core.lib;args-editor.lib;args-networking.lib;args-physics.lib;args-rendering.lib;args-scripting.lib;OpenCL.lib;glfw3.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand All @@ -90,7 +91,7 @@
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(SolutionDir)deps\lib\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>args-application.lib;args-audio.lib;args-core.lib;args-editor.lib;args-networking.lib;args-physics.lib;args-rendering.lib;args-scripting.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>args-application.lib;args-audio.lib;args-core.lib;args-editor.lib;args-networking.lib;args-physics.lib;args-rendering.lib;args-scripting.lib;OpenCL.lib;glfw3.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#define ARGS_ENTRY
#define ARGS_KEEP_CONSOLE
#define ARGS_LOW_POWER
//#define ARGS_LOW_POWER

#include <chrono>
#include <thread>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ class TestSystem final : public System<TestSystem>
//**
{
auto ent = m_ecs->createEntity();
ent.add_component<sah>();

auto entPhyHande = ent.add_component<physics::physicsComponent>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

#include <iostream>

#include "core/filesystem/basic_resolver.hpp"

inline namespace {

using namespace ::args::core;
Expand Down
21 changes: 21 additions & 0 deletions applications/unit_tests/DOCTEST_LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2016-2019 Viktor Kirilov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Empty file.
1 change: 1 addition & 0 deletions applications/unit_tests/assets/bigint.txt

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions applications/unit_tests/assets/config/test.args-test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
It's all filesystem ?
1 change: 1 addition & 0 deletions applications/unit_tests/assets/config/test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
waddup ?
1 change: 1 addition & 0 deletions applications/unit_tests/assets/config/test2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
waddup ?
Empty file.
6 changes: 6 additions & 0 deletions applications/unit_tests/assets/kernels/vadd_kernel.cl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
__kernel void vector_add(__global const int* A, __global const int* B,__global int* C) {

int i = get_global_id(0);

C[i] = A[i] + B[i];
}
Empty file.
3 changes: 3 additions & 0 deletions applications/unit_tests/assets/models/Cube.obj
Git LFS file not shown
Binary file added applications/unit_tests/assets/models/sphere.fbx
Binary file not shown.
Empty file.
22 changes: 22 additions & 0 deletions applications/unit_tests/assets/shaders/debug.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#version 450

layout(location = 1) in vec4 color;
layout(location = SV_POSITION) in vec3 vertex;
layout(location = SV_VIEW) uniform mat4 viewMatrix;
layout(location = SV_PROJECT) uniform mat4 projectionMatrix;

layout(location = 0) out vec4 outColor;

void vert(void)
{
gl_Position = (projectionMatrix * viewMatrix) * vec4(vertex, 1.f);
outColor = color;
}

layout(location = 0) in vec4 color;
out vec4 fragment_color;

void frag(void)
{
fragment_color = color;
}
22 changes: 22 additions & 0 deletions applications/unit_tests/assets/shaders/position.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#version 450

layout(location = SV_POSITION) in vec3 vertex;
layout(location = SV_MODELMATRIX) in mat4 modelMatrix;
layout(location = SV_VIEW) uniform mat4 viewMatrix;
layout(location = SV_PROJECT) uniform mat4 projectionMatrix;

out vec3 position;

void vert(void)
{
gl_Position = (projectionMatrix * viewMatrix * modelMatrix) * vec4(vertex, 1.f);
position = vertex;
}

in vec3 position;
out vec4 fragment_color;

void frag(void)
{
fragment_color = vec4(position, 1);
}
46 changes: 46 additions & 0 deletions applications/unit_tests/assets/shaders/wireframe.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#version 450
#enable CULL OFF

layout(location = SV_POSITION)in vec3 vertex;
layout(location = SV_MODELMATRIX)in mat4 modelMatrix;

layout(location = SV_VIEW) uniform mat4 viewMatrix;
layout(location = SV_PROJECT) uniform mat4 projectionMatrix;

void vert(void)
{
gl_Position = (projectionMatrix * viewMatrix * modelMatrix) * vec4(vertex, 1.f);
}

layout(triangles)in;
layout(triangle_strip, max_vertices = 3)out;

out vec3 barycentricCoords;

void geom(void)
{
gl_Position = gl_in[0].gl_Position;
barycentricCoords = vec3(1, 0, 0);
EmitVertex();
gl_Position = gl_in[1].gl_Position;
barycentricCoords = vec3(0, 1, 0);
EmitVertex();
gl_Position = gl_in[2].gl_Position;
barycentricCoords = vec3(0, 0, 1);
EmitVertex();
EndPrimitive();
}

in vec3 barycentricCoords;
out vec4 fragment_color;

void frag(void)
{
vec3 deltas = fwidth(barycentricCoords);
vec3 adjustedCoords = smoothstep(deltas, 2* deltas, barycentricCoords);
float linePresence = min(adjustedCoords.x, min(adjustedCoords.y, adjustedCoords.z));
if(linePresence > 0.9)
discard;

fragment_color = vec4(vec3(0), 1);
}
3 changes: 3 additions & 0 deletions applications/unit_tests/assets/textures/args-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions applications/unit_tests/assets/textures/args-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions applications/unit_tests/assets/textures/args-splashscreen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions applications/unit_tests/assets/textures/missing-texture.png
Loading