comparison tests/run.d @ 192:fda35d57847e

Fixed String parsing, so that they get created with the right type in AST. Also added so that you can parse options to the test program, that will mirror them to Dang. Eg. ./tests/run --semantic-only will pass --semantic-only to Dang on each run.
author Anders Johnsen <skabet@gmail.com>
date Fri, 25 Jul 2008 15:00:54 +0200
parents e1e170c2cd44
children
comparison
equal deleted inserted replaced
191:e799db8d9cb0 192:fda35d57847e
13 // -- Settings -- 13 // -- Settings --
14 char[] compiler = "./Dang"; 14 char[] compiler = "./Dang";
15 char[] test_folder = "tests"; 15 char[] test_folder = "tests";
16 char[] valid_filenames = r"^[^.].*"; 16 char[] valid_filenames = r"^[^.].*";
17 bool print_expected = false; 17 bool print_expected = false;
18 18 char[][] options;
19 // the tests can be sorted by one of the following functions 19 // the tests can be sorted by one of the following functions
20 bool nameSort (FilePath a, FilePath b) { return a.name < b.name; } 20 bool nameSort (FilePath a, FilePath b) { return a.name < b.name; }
21 bool pathSort (FilePath a, FilePath b) { return a.toString < b.toString; } 21 bool pathSort (FilePath a, FilePath b) { return a.toString < b.toString; }
22 bool modifiedSort(FilePath a, FilePath b) { return a.modified < b.modified; } 22 bool modifiedSort(FilePath a, FilePath b) { return a.modified < b.modified; }
23 bool createdSort (FilePath a, FilePath b) { return a.created < b.created; } 23 bool createdSort (FilePath a, FilePath b) { return a.created < b.created; }
32 Unexpected 32 Unexpected
33 } 33 }
34 34
35 void main(char[][] args) 35 void main(char[][] args)
36 { 36 {
37 foreach (arg ; args[1..$])
38 options ~= arg;
39
37 scope scan = new FileScan; 40 scope scan = new FileScan;
38 // scope regex = new Regex(valid_filenames); // DMD FAILS!! ?? 41 // scope regex = new Regex(valid_filenames); // DMD FAILS!! ??
39 // Return true for files/folders to include 42 // Return true for files/folders to include
40 bool filter(FilePath p, bool isDir) 43 bool filter(FilePath p, bool isDir)
41 { 44 {
122 } 125 }
123 } 126 }
124 127
125 if (compile) 128 if (compile)
126 { 129 {
127 auto process = new Process(compiler, "--gen-llvm", p.toString()); 130 auto o = compiler ~ options ~ p.toString;
131 auto process = new Process(o);
128 process.execute(); 132 process.execute();
129 auto result = process.wait(); 133 auto result = process.wait();
130 return resultOf(p, result.status, fail); 134 return resultOf(p, result.status, fail);
131 } 135 }
132 136