Skip to content

Commit 5292326

Browse files
committed
Move test files into src/
Change test to use constructor initialization
1 parent 29e530f commit 5292326

15 files changed

+141
-144
lines changed

Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ FILE_PATTERNS = *.c \
173173
*.qsf \
174174
*.ice
175175
RECURSIVE = YES
176-
EXCLUDE = test \
176+
EXCLUDE = src \
177177
doxygen-awesome-css
178178
EXCLUDE_SYMLINKS = NO
179179
EXCLUDE_PATTERNS =

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ If you really want it to work with earlier versions, you should just be able to
4545
As this is a header-only library, you can simply copy the header files directly into your project and include them where relevant.
4646
The header files can either be downloaded from the [releases page](https://github.com/KredeGC/BitStream/releases) or from the [`include/`](https://github.com/KredeGC/BitStream/tree/master/include/bitstream) directory on the master branch.
4747

48-
The source and header files inside the `test/` directory are only tests and should not be included into your project, unless you wish to test the library as part of your pipeline.
48+
The source and header files inside the `src/` directory are only tests and should not be included into your project, unless you wish to test the library as part of your pipeline.
4949

5050
# Usage
5151
The library has a global header file ([`bitstream/bitstream.h`](https://github.com/KredeGC/BitStream/tree/master/include/bitstream/bitstream.h)) which includes every other header file in the library.

premake5.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ project "Test"
7171
objdir ("bin-obj/%{outputdir}")
7272

7373
files {
74-
"test/src/**.cpp",
75-
"test/include/**.h",
74+
"src/**.cpp",
75+
"src/**.h",
7676
"include/**.h"
7777
}
7878

7979
includedirs {
80-
"test/include",
80+
"src",
8181
"include"
8282
}
8383

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
#include "test.h"
2-
3-
int main(int argc, const char** argv)
4-
{
5-
bitstream::test::unit::run_all_tests();
6-
7-
#ifdef _WIN32
8-
system("pause");
9-
#endif
10-
11-
return 0;
1+
#include "shared/test.h"
2+
3+
int main(int argc, const char** argv)
4+
{
5+
bitstream::test::unit::run_all_tests();
6+
7+
return 0;
128
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
#include <string>
55

66
#define BS_ADD_TEST3(func_ptr, line) void func_ptr(); \
7-
static int test_##line = (::bitstream::test::unit::add_test(#func_ptr, func_ptr), 0); \
7+
struct test_struct_##func_ptr##_##line { test_struct_##func_ptr##_##line() { ::bitstream::test::unit::add_test(#func_ptr, func_ptr); } }; \
8+
static test_struct_##func_ptr##_##line test_var_##func_ptr##_##line; \
89
void func_ptr()
910

1011
#define BS_ADD_TEST2(func_ptr, line) BS_ADD_TEST3(func_ptr, line)

test/src/test.cpp renamed to src/test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "test.h"
1+
#include "shared/test.h"
22

33
#include <bitstream/bitstream.h>
44

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#include "test_assert.h"
2-
#include "test.h"
3-
#include "test_types.h"
1+
#include "../shared/assert.h"
2+
#include "../shared/test.h"
3+
#include "../shared/test_types.h"
44

55
#include <bitstream/quantization/bounded_range.h>
66
#include <bitstream/quantization/half_precision.h>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#include "test_assert.h"
2-
#include "test.h"
1+
#include "../shared/assert.h"
2+
#include "../shared/test.h"
33

44
#include <bitstream/stream/bit_reader.h>
55
#include <bitstream/stream/bit_writer.h>

0 commit comments

Comments
 (0)