File tree 5 files changed +84
-3
lines changed
5 files changed +84
-3
lines changed Original file line number Diff line number Diff line change 12
12
permissions : write-all
13
13
steps :
14
14
- name : Checkout
15
- uses : actions/checkout@v3
15
+ uses : actions/checkout@v4
16
16
17
17
- name : Get release Name
18
18
shell : python
Original file line number Diff line number Diff line change @@ -24,12 +24,51 @@ jobs:
24
24
25
25
steps :
26
26
- name : Checkout
27
- uses : actions/checkout@v3
27
+ uses : actions/checkout@v4
28
28
29
29
- name : Build tests
30
30
shell : bash
31
31
run : xcodebuild build -project test/test.xcodeproj -scheme test -config Release -derivedDataPath DerivedData
32
32
33
33
- name : Run tests
34
34
shell : bash
35
- run : DerivedData/Build/Products/Release/test
35
+ run : DerivedData/Build/Products/Release/test
36
+
37
+ linux :
38
+ runs-on : ubuntu-latest
39
+
40
+ steps :
41
+ - name : Checkout
42
+ uses : actions/checkout@v4
43
+
44
+ - name : Prepare
45
+ shell : bash
46
+ run : |
47
+ echo "::group::Update System"
48
+ sudo apt-get install -y ninja-build
49
+ echo "::endgroup::"
50
+
51
+ echo "::group::Clang"
52
+ wget https://apt.llvm.org/llvm.sh
53
+ chmod u+x llvm.sh
54
+ sudo ./llvm.sh 16
55
+ echo "::endgroup::"
56
+
57
+ echo "::group::libdispatch"
58
+ git clone --depth=1 https://github.com/apple/swift-corelibs-libdispatch.git
59
+ cd swift-corelibs-libdispatch
60
+ cmake -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -S . -B build
61
+ cmake --build build
62
+ sudo cmake --install build --prefix=/usr
63
+ echo "::endgroup::"
64
+
65
+
66
+ - name : Build tests
67
+ shell : bash
68
+ run : |
69
+ cd test
70
+ CLANG=clang++-16 make
71
+
72
+ - name : Run tests
73
+ shell : bash
74
+ run : test/build/test
Original file line number Diff line number Diff line change
1
+ build /
Original file line number Diff line number Diff line change
1
+
2
+ CLANG ?= clang++
3
+ SOURCES: =BlockUtilTestCpp.cpp CoDispatchTestsCpp.cpp main-linux.cpp
4
+ CPPFLAGS:=--std =c++20 -fblocks -I../include
5
+ LDFLAGS:=--std =c++20 -fblocks -ldispatch -lBlocksRuntime
6
+
7
+ .DEFAULT_GOAL: =build/test
8
+
9
+ build :
10
+ mkdir $@
11
+
12
+ build/main-linux.o : main-linux.cpp ../include/objc-helpers/BlockUtil.h build
13
+ $(CLANG ) $(CPPFLAGS ) -c -o $@ $<
14
+
15
+ build/BlockUtilTestCpp.o : BlockUtilTestCpp.cpp ../include/objc-helpers/BlockUtil.h build
16
+ $(CLANG ) $(CPPFLAGS ) -c -o $@ $<
17
+
18
+ build/CoDispatchTestsCpp.o : CoDispatchTestsCpp.cpp ../include/objc-helpers/CoDispatch.h build
19
+ $(CLANG ) $(CPPFLAGS ) -c -o $@ $<
20
+
21
+ build/CoDispatchTestsNoexcept.o : CoDispatchTestsNoexcept.cpp ../include/objc-helpers/CoDispatch.h build
22
+ $(CLANG ) $(CPPFLAGS ) -c -o $@ $<
23
+
24
+ build/test : build/main-linux.o \
25
+ build/BlockUtilTestCpp.o \
26
+ build/CoDispatchTestsCpp.o \
27
+ build/CoDispatchTestsNoexcept.o
28
+ $(CLANG ) $(LDFLAGS ) -o $@ $^
Original file line number Diff line number Diff line change
1
+
2
+ #define DOCTEST_CONFIG_IMPLEMENT
3
+ #include " doctest.h"
4
+
5
+ #include < dispatch/dispatch.h>
6
+
7
+ int main (int argc, const char * argv[]) {
8
+ dispatch_async (dispatch_get_main_queue (), ^ {
9
+ auto ret = doctest::Context (argc, argv).run ();
10
+ exit (ret);
11
+ });
12
+ dispatch_main ();
13
+ }
You can’t perform that action at this time.
0 commit comments