1 module tests.it.runtime.issues; 2 3 4 import tests.it.runtime; 5 6 7 // reggae/dub build should rebuild if dub.json/sdl change 8 @("23") 9 @Tags(["dub", "make"]) 10 unittest { 11 12 import std.process: execute; 13 import std.path: buildPath; 14 15 with(immutable ReggaeSandbox("dub")) { 16 runReggae("-b", "make", "--dflags=-g -debug"); 17 make(["VERBOSE=1"]).shouldExecuteOk.shouldContain("-g -debug"); 18 { 19 const ret = execute(["touch", buildPath(testPath, "dub.json")]); 20 ret.status.shouldEqual(0); 21 } 22 { 23 const ret = execute(["make", "-C", testPath]); 24 // don't assert on the status of ret - it requires rerunning reggae 25 // and that can fail if the reggae binary isn't built yet. 26 // Either way make should run 27 ret.output.shouldNotContain("Nothing to be done"); 28 } 29 } 30 } 31 32 33 @("62") 34 @Tags(["dub", "make"]) 35 unittest { 36 with(immutable ReggaeSandbox()) { 37 writeFile("dub.sdl", ` 38 name "issue62" 39 dependency "arsd-official:nanovega" version="*" 40 `); 41 writeFile("source/app.d", q{ 42 import arsd.simpledisplay; 43 import arsd.nanovega; 44 void main () { } 45 } 46 ); 47 runReggae("-b", "make"); 48 make.shouldExecuteOk; 49 shouldSucceed("issue62"); 50 } 51 } 52 53 54 @("dubLink") 55 @Tags(["dub", "make"]) 56 unittest { 57 with(immutable ReggaeSandbox()) { 58 writeFile("dub.sdl", ` 59 name "dublink" 60 `); 61 writeFile("source/app.d", q{ 62 void main () { } 63 } 64 ); 65 writeFile("reggaefile.d", 66 q{ 67 import reggae; 68 alias sourceObjs = dlangObjects!(Sources!"source"); 69 alias exe = dubLink!(TargetName("exe"), Configuration("default"), sourceObjs); 70 mixin build!exe; 71 }); 72 runReggae("-b", "make"); 73 make.shouldExecuteOk; 74 shouldSucceed("exe"); 75 } 76 }