Skip to content

Commit

Permalink
test(CB): add missing test files to CB project
Browse files Browse the repository at this point in the history
 - turn on CB's limited "EditorConfig" plugin (which doesn't respect our standalone definition, but may help somewhat)
 - Update readme-developer a little more
 - Update the README "building from source" to reflect that the Scons build is the official build method, even on Windows.
 - Display results of the CB unit test execution (TODO: only pause when tests fail)
  • Loading branch information
tehhowch committed Nov 26, 2020
1 parent aea33c3 commit ef7a152
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -9,7 +9,7 @@ libendless-sky.a
*.dll

# Files::LogError output from unit tests
./errors.txt
errors.txt

# Build Directories and toolchain-generated files
build/
Expand Down
1 change: 1 addition & 0 deletions EndlessSky.cbp
Expand Up @@ -98,6 +98,7 @@
</Unit>
<Unit filename="source/main.cpp" />
<Extensions>
<editor_config active="1" use_tabs="1" tab_indents="1" tab_width="4" indent="4" eol_mode="0" />
<lib_finder disable_auto="1" />
</Extensions>
</Project>
Expand Down
1 change: 1 addition & 0 deletions EndlessSkyLib.cbp
Expand Up @@ -316,6 +316,7 @@
<Unit filename="source/pi.h" />
<Unit filename="source/shift.h" />
<Extensions>
<editor_config active="1" use_tabs="1" tab_indents="1" tab_width="4" indent="4" eol_mode="0" />
<lib_finder disable_auto="1" />
</Extensions>
</Project>
Expand Down
14 changes: 8 additions & 6 deletions EndlessSkyTests.cbp
Expand Up @@ -12,8 +12,7 @@
<Option external_deps="lib/Debug/libendless-sky.a;" />
<Option type="1" />
<Option compiler="gcc" />
<Option use_console_runner="0" />
<Option projectLinkerOptionsRelation="2" />
<Option projectLinkerOptionsRelation="1" />
<Option projectIncludeDirsRelation="2" />
<Option projectLibDirsRelation="2" />
<Compiler>
Expand All @@ -29,8 +28,7 @@
<Option external_deps="lib/Release/libendless-sky.a;" />
<Option type="1" />
<Option compiler="gcc" />
<Option use_console_runner="0" />
<Option projectLinkerOptionsRelation="2" />
<Option projectLinkerOptionsRelation="1" />
<Option projectIncludeDirsRelation="2" />
<Option projectLibDirsRelation="2" />
<Compiler>
Expand Down Expand Up @@ -64,10 +62,14 @@
<Add directory="C:/dev64/lib" />
<Add directory="C:/Program Files/mingw64/x86_64-w64-mingw32/lib" />
</Linker>
<Unit filename="tests/src/test_Point.cpp" />
<Unit filename="tests/src/test_Set.cpp" />
<Unit filename="tests/src/test_conditionSet.cpp" />
<Unit filename="tests/src/test_datanode.cpp" />
<Unit filename="tests/src/test_main.cpp" />
<Unit filename="tests/src/test_point.cpp" />
<Unit filename="tests/src/test_random.cpp" />
<Unit filename="tests/src/test_set.cpp" />
<Extensions>
<editor_config active="1" use_tabs="1" tab_indents="1" tab_width="4" indent="4" eol_mode="0" />
<lib_finder disable_auto="1" />
</Extensions>
</Project>
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -21,8 +21,8 @@ Endless Sky has very minimal system requirements, meaning most systems should be
|Storage Free | 120 MB | 300 MB |

### Building from source
While most development is done on Linux using the [SCons](https://scons.org/) build tool to compile the project, IDE-specific files are provided for [XCode](https://developer.apple.com/xcode/) and [Code::Blocks](http://www.codeblocks.org/) to simplify the installation on Mac OS and Windows. It is possible to use other IDEs or build systems to compile the game, but support is not provided.
For full installation instructions, consult the [Build Instructions](https://github.com/endless-sky/endless-sky/wiki/BuildInstructions) wiki page.
Most development is done on Linux and Windows, using the [SCons](https://scons.org/) build tool to compile the project. For those wishing to use an IDE, project files are provided for [XCode](https://developer.apple.com/xcode/) and [Code::Blocks](http://www.codeblocks.org/) to simplify the project setup. It is possible to use other IDEs or build systems to compile the game, but support is not provided.
For full installation instructions, consult the [Build Instructions](https://github.com/endless-sky/endless-sky/wiki/BuildInstructions) wiki page. Some additional information may be found in the "readme-developer" text file.

# Contributing
As a free and open source game, Endless Sky is the product of many peoples' work. Contributions of artwork, storylines, and other writing are most in-demand, while there is a loosely defined [development roadmap](https://github.com/endless-sky/endless-sky/wiki/DevelopmentRoadmap). Those who wish to contribute are encouraged to review the [wiki](https://github.com/endless-sky/endless-sky/wiki), and to post in the [discussion forum](http://groups.google.com/group/endless-sky).
Expand Down
12 changes: 8 additions & 4 deletions readme-developer.txt
Expand Up @@ -73,8 +73,9 @@ You will probably need to adjust the paths to your compiler binaries, and you sh

You will also need libmingw32.a and libopengl32.a. Those should be included in the MinGW g++ install. If they are not in C:\Program Files\mingw64\x86_64-w64-mingw32\lib\ you will have to adjust the include directory and library (linker) directory search paths in the Code::Blocks project files.

The Code::Blocks workspace consists of three projects: one for the majority of source code, one for the game binary, and one for the unit tests.
To get started, open the EndlessSky.workspace file, which will load the three linked projects. As with most IDE-based projects, you must explicitly add new files to the respective project for them to be compiled.
The Code::Blocks workspace consists of three projects: one for the majority of source code, one for the game binary, and one for the unit tests. As with most IDE-based projects, you must explicitly add new files to the respective project for them to be compiled.
To get started, open the "EndlessSky.workspace" file, which will load the three linked projects. Double-clicking a project in the left-hand menu will activate that project, binding the toolbar & keyboard shortcuts for "Build," "Run,", "Build & Run," etc. to that project, no matter which file is being edited.
For example, when making lots of changes to the game, you will generally have the "endless-sky-lib" project active, so that you can ensure changes compile without needing to fully link things together into the actual game binary. After making changes, you would then activate the "EndlessSky" project and use the "Build & Run" option with the "Release" target, which will fully link the compiled code into the small, performant executable. You can continue making tweaks to files that belong to the "endless-sky-lib" project without reactivating it, so that "Build & Run" will still launch the game with your latest tweaks. Should you experience some show-stopper bug in your modified game, you would then change to the "Debug" build target to help determine the source(s) of the issue.



Expand Down Expand Up @@ -106,9 +107,12 @@ To create a Mac OS X binary that will work on systems other than your own, you m
*** Note: there is extremely limited development support for macOS, and no intent to support macOS's new ARM architecture. ***



Link-Time Optimization (LTO):

For both the Linux and Windows "release" targets, "link-time optimization" is used. This generally will work without issue with newer versions of g++ / MinGW, but may require an explicit usage of the `gcc-ar` and `gcc-ranlib` binaries.
For the Code::Blocks project, the default archive program can be configured in the application's compiler settings menu. The Scons builds can be controlled by an environment variable:
For both the Linux and Windows "release" targets, "link-time optimization" is used. This generally will work without issue with newer versions of g++ / MinGW, but may require an explicit usage of the `gcc-ar` and `gcc-ranlib` binaries in your development environment.
For the Code::Blocks project, the archive program can be configured in Code::Block's global compiler settings menu, accessed via "Settings -> Compiler..." in the application menu bar. On the "Toolchain executables" tab, change "linker for static libs" from "ar.exe" to "gcc-ar.exe"

The Scons builds can be controlled by setting the appropriate environment variable(s), either directly in the environment or just for the lifetime of the command:

$ AR=gcc-ar RANLIB=gcc-ranlib scons
3 changes: 2 additions & 1 deletion tests/src/test_datanode.cpp
Expand Up @@ -50,7 +50,8 @@ SCENARIO( "Creating a DataNode", "[DataNode]") {
}
}
}
SCENARIO( "Determining if a token is numeric", "[IsNumber],[Parsing],[DataNode]" ) {

SCENARIO( "Determining if a token is numeric", "[IsNumber][Parsing][DataNode]" ) {
GIVEN( "An integer string" ) {
THEN( "IsNumber returns true" ) {
auto strNum = GENERATE(as<std::string>{}
Expand Down

0 comments on commit ef7a152

Please sign in to comment.