Skip to content

Commit 48164a2

Browse files
authored
Merge pull request #56 from Amiable-Vagabond/develop
Merging gtest and random number conversion
2 parents a7b47b2 + 3b126f8 commit 48164a2

File tree

13 files changed

+846
-12
lines changed

13 files changed

+846
-12
lines changed

.github/workflows/CI.yml

+25-9
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ name: CMake on multiple platforms
44

55
on:
66
push:
7-
branches: [ main ]
7+
branches: [ develop ]
88
pull_request:
9-
branches: [ main ]
9+
branches: [ develop ]
1010

1111
jobs:
1212
build:
@@ -54,6 +54,10 @@ jobs:
5454

5555
steps:
5656
- uses: actions/checkout@v4
57+
58+
- name: Install lfontconfig
59+
if: matrix.os == 'ubuntu-latest'
60+
run: sudo apt-get install -y libfontconfig1-dev
5761

5862
- name: Set reusable strings
5963
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
@@ -73,12 +77,24 @@ jobs:
7377
-DSOLTRACE_BUILD_GUI=OFF
7478
-S ${{ github.workspace }}
7579
76-
- name: Build
80+
- name: Build-Windows
7781
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
78-
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} --target strace
82+
if: matrix.os == 'windows-latest'
83+
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} --target strace TestExecutable
84+
85+
- name: Build-Mac-Linux
86+
if: matrix.os != 'windows-latest'
87+
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} --target strace TestExecutable
7988

80-
# - name: Test
81-
# working-directory: ${{ steps.strings.outputs.build-output-dir }}
82-
# # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
83-
# # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
84-
# run: ctest --build-config ${{ matrix.build_type }}
89+
# - name: List test directory
90+
# run: |
91+
# dir build/google-tests
92+
93+
94+
- name: Test
95+
working-directory: ${{ steps.strings.outputs.build-output-dir }}
96+
# Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
97+
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
98+
run: |
99+
cd ${{ steps.strings.outputs.build-output-dir }}/google-tests
100+
ctest --output-on-failure --build-config ${{ matrix.build_type }}

CMakeLists.txt

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ Project(soltrace_ui VERSION 1.0.0)
55
set(CMAKE_CXX_STANDARD 14)
66
set(CMAKE_CXX_STANDARD_REQUIRED True)
77

8-
option(SOLTRACE_BUILD_GUI "Build the GUI parts of SolTrace" ON)
8+
option(SOLTRACE_BUILD_GUI "Build the GUI parts of Soltrace" ON)
99

1010
add_subdirectory(coretrace)
11+
add_subdirectory(google-tests)
1112

1213
if(SOLTRACE_BUILD_GUI)
13-
add_subdirectory(app)
14+
add_subdirectory(app)
1415
endif()
16+

app/deploy/samples/Aperture Examples.stinput

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# SOLTRACE VERSION 2016.1.1 INPUT FILE
12
SUN PTSRC 0 SHAPE p SIGMA 2.73 HALFWIDTH 4.65
23
XYZ 0 0 100 USELDH 0 LDH 39.5 90 10
34
USER SHAPE DATA 0

coretrace/mtrand.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class MTRand {
133133
uint32 *pNext; // next value to get from state
134134
int left; // number of values left before reload needed
135135

136-
std::default_random_engine random_generator;
136+
std::mt19937_64 random_generator;
137137
std::normal_distribution<double> normal_distribution; // (5.0, 2.0);
138138
std::uniform_real_distribution<double> uniform_distribution;
139139
std::uniform_int_distribution<int> uniform_int_distribution;

0 commit comments

Comments
 (0)