Skip to content

Commit 83b6d92

Browse files
committed
Install gtest and build tests
1 parent 4cb589e commit 83b6d92

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

.github/workflows/c-cpp.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,29 @@ jobs:
3333
python -m pip install --upgrade pip
3434
pip install meson ninja
3535
36+
- name: Setup environment
37+
run: |
38+
echo "PKG_CONFIG=${{ github.workspace }}/vcpkg/installed/x64-windows/tools/pkgconf/pkgconf.exe" >> $env:GITHUB_ENV
39+
echo "PKG_CONFIG_PATH=${{ github.workspace }}/vcpkg/installed/x64-windows/lib/pkgconfig" >> $env:GITHUB_ENV
40+
echo "LIB=${{ github.workspace }}/vcpkg/installed/x64-windows/lib;$env:LIB" >> $env:GITHUB_ENV
41+
echo "INCLUDE=${{ github.workspace }}/vcpkg/installed/x64-windows/include;$env:INCLUDE" >> $env:GITHUB_ENV
42+
shell: pwsh
43+
44+
- name: Setup vcpkg and install pkg-config and gtest
45+
run: |
46+
git clone https://github.com/Microsoft/vcpkg.git
47+
.\vcpkg\bootstrap-vcpkg.bat
48+
.\vcpkg\vcpkg install gtest:x64-windows pkgconf:x64-windows
49+
3650
# Configure and build with Meson (MSVC will be used automatically)
3751
- name: Configure (Meson)
38-
run: meson setup --warnlevel 2 --buildtype release builddir --backend=ninja
52+
run: meson setup -Dbuild_tests=true --warnlevel 2 --buildtype release builddir --backend=ninja
3953

4054
- name: Build (Ninja)
4155
run: ninja -C builddir
56+
57+
- name: Run tests
58+
run: .\builddir\testexe --gtest_filter="*qsort*"
4259

4360
SKL-gcc9:
4461

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ x86simdsortcpp_dep = declare_dependency(
9393

9494
# Build test suite if option build_tests set to true
9595
if get_option('build_tests')
96-
gtest_dep = dependency('gtest_main', required : true, static: false)
96+
gtest_dep = dependency('gtest', main : true, required : true, static: false)
9797
subdir('tests')
9898
testexe = executable('testexe',
9999
include_directories : [lib, utils],

0 commit comments

Comments
 (0)