Skip to content

Commit 26299a3

Browse files
authored
Test on Windows (#75)
* Test on Windows * Try installing nasm * Try setting CMAKE_RUNTIME_OUTPUT_DIRECTORY * Try with chromedriver * Try using shell: bash
1 parent 6aa9725 commit 26299a3

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

.github/workflows/test.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,36 @@ jobs:
6767
--target=integration_test/webcrypto_test.dart \
6868
-d chrome
6969
- run: flutter pub run test -p vm,chrome # TODO: Enable firefox if it works
70+
windows:
71+
name: webcrypto on Windows Chrome / Firefox
72+
runs-on: windows-latest
73+
steps:
74+
- uses: ilammy/setup-nasm@v1
75+
- uses: actions/checkout@v3
76+
- uses: subosito/flutter-action@v2
77+
with:
78+
channel: 'stable'
79+
architecture: x64
80+
- name: Configure Flutter
81+
run: |
82+
flutter config --no-analytics
83+
flutter config --enable-windows-desktop
84+
- run: flutter pub get
85+
- run: flutter pub run webcrypto:setup
86+
- run: flutter test
87+
- run: flutter test --platform chrome
88+
- run: flutter test integration_test/webcrypto_test.dart -d windows
89+
working-directory: ./example
90+
- uses: nanasess/setup-chromedriver@v2
91+
- name: Run integration_test with chromedriver
92+
working-directory: ./example
93+
shell: bash
94+
run: |
95+
../tool/with-chromedriver.sh flutter drive \
96+
--driver=test_driver/integration_test.dart \
97+
--target=integration_test/webcrypto_test.dart \
98+
-d chrome
99+
- run: flutter pub run test -p vm,chrome,firefox
70100
ios:
71101
name: webcrypto on iOS emulator (iPhone)
72102
runs-on: macos-latest

src/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ if(MSVC)
111111
${MSVC_DISABLED_WARNINGS_LIST})
112112
set(CMAKE_C_FLAGS "-utf-8 -W4 -WX ${MSVC_DISABLED_WARNINGS_STR}")
113113
set(CMAKE_CXX_FLAGS "-utf-8 -W4 -WX ${MSVC_DISABLED_WARNINGS_STR}")
114+
115+
# Hack because Windows compilers will put .dll files in
116+
# $CMAKE_BINARY_DIR/Debug/ folder.
117+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY $<1:${CMAKE_BINARY_DIR}>)
114118
endif()
115119
if(WIN32)
116120
# Windows/MSVC option from CMakeLists.txt in BoringSSL

tool/with-chromedriver.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ else
3232
PLATFORM='linux64'
3333
elif [[ "$OSTYPE" == "darwin"* ]]; then
3434
PLATFORM='mac64'
35+
elif [[ "$OSTYPE" == "cygwin" ]]; then
36+
PLATFORM='win32'
37+
elif [[ "$OSTYPE" == "msys" ]]; then
38+
PLATFORM='win32'
39+
elif [[ "$OSTYPE" == "win32" ]]; then
40+
PLATFORM='win32'
3541
else
3642
echo "Unsupported OSTYPE: $OSTYPE"
3743
exit 1

0 commit comments

Comments
 (0)