File tree Expand file tree Collapse file tree 2 files changed +45
-38
lines changed
Expand file tree Collapse file tree 2 files changed +45
-38
lines changed Original file line number Diff line number Diff line change @@ -33,44 +33,7 @@ clangStdenv.mkDerivation (finalAttrs: {
3333 doCheck = true ;
3434
3535 passthru . tests = {
36- build-hello-world = clangStdenv . mkDerivation {
37- name = "ObjFW test" ;
38- buildInputs = [ objfw ] ;
39-
40- src = writeTextDir "helloworld.m" ''
41- #import <ObjFW/ObjFW.h>
42- int main() {
43- OFLog(@"Hello world from objc");
44- return 0;
45- }
46- '' ;
47-
48- buildPhase = ''
49- runHook preBuild
50- clang -o testbinary \
51- -x objective-c -Xclang \
52- -fobjc-runtime=objfw \
53- -funwind-tables \
54- -fconstant-string-class=OFConstantString \
55- -Xclang -fno-constant-cfstrings \
56- helloworld.m \
57- -lobjfw -lobjfwrt
58- runHook postBuild
59- '' ;
60-
61- checkPhase = ''
62- runHook preCheck
63- ./testbinary
64- runHook postCheck
65- '' ;
66- doCheck = true ;
67-
68- installPhase = ''
69- runHook preInstall
70- touch $out
71- runHook postInstall
72- '' ;
73- } ;
36+ build-hello-world = ( import ./test-build-and-run.nix ) { inherit clangStdenv objfw writeTextDir ; } ;
7437 } ;
7538
7639 meta = {
Original file line number Diff line number Diff line change 1+ {
2+ clangStdenv ,
3+ objfw ,
4+ writeTextDir ,
5+ } :
6+
7+ clangStdenv . mkDerivation {
8+ name = "ObjFW test" ;
9+ buildInputs = [ objfw ] ;
10+
11+ src = writeTextDir "helloworld.m" ''
12+ #import <ObjFW/ObjFW.h>
13+ int main() {
14+ OFLog(@"Hello world from objc");
15+ return 0;
16+ }
17+ '' ;
18+
19+ buildPhase = ''
20+ runHook preBuild
21+ clang -o testbinary \
22+ -x objective-c -Xclang \
23+ -fobjc-runtime=objfw \
24+ -funwind-tables \
25+ -fconstant-string-class=OFConstantString \
26+ -Xclang -fno-constant-cfstrings \
27+ helloworld.m \
28+ -lobjfw -lobjfwrt
29+ runHook postBuild
30+ '' ;
31+
32+ checkPhase = ''
33+ runHook preCheck
34+ ./testbinary
35+ runHook postCheck
36+ '' ;
37+ doCheck = true ;
38+
39+ installPhase = ''
40+ runHook preInstall
41+ touch $out
42+ runHook postInstall
43+ '' ;
44+ }
You can’t perform that action at this time.
0 commit comments