Commit graph

4309 commits

Author SHA1 Message Date
Graydon Hoare
5749a2deac Fix signature and add string_reader to ioivec. 2011-07-25 14:04:49 -07:00
Michael Sullivan
6bcdb48e35 Disallow block as a variable name in preparation for it becoming a keyword. 2011-07-25 13:42:38 -07:00
Rafael Ávila de Espíndola
01675f34e0 Remove old hack of creating a .a file with code that existed both in rust
and on newer versions of llvm.
2011-07-25 16:18:39 -04:00
Brian Anderson
758c11b22c Ignore various files that are probably not tests when searching for tests
Closes #732
2011-07-25 12:20:23 -07:00
Graydon Hoare
42e57f64b7 remove datalayout from the intrinsics.ll.in file, silence linkage warning. 2011-07-25 11:50:09 -07:00
Marijn Haverbeke
19507787a9 Add support for bracey record types and literals
type foo = {mutable x: int, y: int};
    auto myfoo = {mutable x: 10, y: 20u};

The old syntax is also still supported.
2011-07-25 17:41:00 +02:00
Marijn Haverbeke
cce1b4667b Add look-ahead to parser object 2011-07-25 17:16:41 +02:00
Marijn Haverbeke
dca67f95cb Make the lexer slightly less stateful 2011-07-25 16:46:08 +02:00
Marijn Haverbeke
e949aab10a Remove some rustboot-isms
Closes #464
2011-07-25 15:07:48 +02:00
Marijn Haverbeke
48013db5c5 Tie up the ends needed to get external consts working
Closes #658
2011-07-25 14:58:59 +02:00
Marijn Haverbeke
f0be65cb50 Fix span information returned by parser::parse_seq
Its hi pos used to be the end of the token after the sequence. It now
properly reports the end of the closing token.
2011-07-25 14:04:37 +02:00
Marijn Haverbeke
beab6ba8aa Add a pass that checks for unreachable alt arms 2011-07-25 13:52:59 +02:00
Brian Anderson
bd81adabff Add task::send and task::recv 2011-07-24 16:18:31 -07:00
Brian Anderson
73fed01108 Add task::worker. Spawns a task and returns a channel to it
It takes a lot of boilerplate to create a task and establish a way to talk to
it. This function simplifies that, allowing you to write something like
'worker(f).chan <| start'. Implementation is very unsafe and only works for a
few types of channels, but something like this is very useful.
2011-07-24 16:18:05 -07:00
Brian Anderson
b82bedb28e Reindent lib-task.rs 2011-07-24 16:17:25 -07:00
Brian Anderson
2573fe7026 The Big Test Suite Overhaul
This replaces the make-based test runner with a set of Rust-based test
runners. I believe that all existing functionality has been
preserved. The primary objective is to dogfood the Rust test
framework.

A few main things happen here:

1) The run-pass/lib-* tests are all moved into src/test/stdtest. This
is a standalone test crate intended for all standard library tests. It
compiles to build/test/stdtest.stageN.

2) rustc now compiles into yet another build artifact, this one a test
runner that runs any tests contained directly in the rustc crate. This
allows much more fine-grained unit testing of the compiler. It
compiles to build/test/rustctest.stageN.

3) There is a new custom test runner crate at src/test/compiletest
that reproduces all the functionality for running the compile-fail,
run-fail, run-pass and bench tests while integrating with Rust's test
framework. It compiles to build/test/compiletest.stageN.

4) The build rules have been completely changed to use the new test
runners, while also being less redundant, following the example of the
recent stageN.mk rewrite.

It adds two new features to the cfail/rfail/rpass/bench tests:

1) Tests can specify multiple 'error-pattern' directives which must be
satisfied in order.

2) Tests can specify a 'compile-flags' directive which will make the
test runner provide additional command line arguments to rustc.

There are some downsides, the primary being that Rust has to be
functioning pretty well just to run _any_ tests, which I imagine will
be the source of some frustration when the entire test suite
breaks. Will also cause some headaches during porting.

Not having individual make rules, each rpass, etc test no longer
remembers between runs whether it completed successfully. As a result,
it's not possible to incrementally fix multiple tests by just running
'make check', fixing a test, and repeating without re-running all the
tests contained in the test runner. Instead you can filter just the
tests you want to run by using the TESTNAME environment variable.

This also dispenses with the ability to run stage0 tests, but they
tended to be broken more often than not anyway.
2011-07-24 15:34:34 -07:00
Paul Stansifer
e6e53aff63 Add --expand option to rustc to pretty-print expanded code. 2011-07-23 14:33:12 -07:00
Eric Holk
63e77a3de1 Attempt to put out burning Windows tinderbox. 2011-07-23 13:01:30 -07:00
Graydon Hoare
ad954fcecc Add an NSIS script for building a win32 installer. Closes #522. 2011-07-23 12:27:06 -07:00
Eric Holk
57459ec8ae Fixed another concurrency issue in channels. 2011-07-23 12:21:23 -07:00
Eric Holk
8878b128ba More work on word-count.
Updated the MapReduce protocol so that it's correct more often. It's
still not perfect, but the bugs repro less often now.

Also found a race condition in channel sending. The problem is that
send and receive both need to refer to the _unread field in
circular_buffer. For now I just grabbed the port lock to send. We can
probably get around this by using atomics instead.
2011-07-22 18:45:34 -07:00
Eric Holk
8f2254b8c2 Update configure script to make the task-perf output directory. 2011-07-22 18:45:34 -07:00
Eric Holk
404d4e0528 Adding test case dealing with communication and hashmaps. 2011-07-22 18:45:34 -07:00
Eric Holk
c7e967148c Task-ified the word count program.
This meant most of the generic-ness of it had to go away, since our
type system doesn't quite support it yet. Hopefully someday...

This version has lots of memory management errors. My next commit will
hopefully fix these.
2011-07-22 18:45:34 -07:00
Michael Sullivan
0cacbe901d Overhaul how we handle freevars. 2011-07-22 17:46:52 -07:00
Michael Sullivan
2bf50114eb Simple cleanup of the freevars pass. 2011-07-22 17:46:52 -07:00
Michael Sullivan
f2f8943a85 Add a "fake" def_upvar and mechanisms to create it. 2011-07-22 17:46:52 -07:00
Paul Stansifer
e18d70fe12 Implement Macro By Example. 2011-07-22 16:53:43 -07:00
Eric Holk
4a6ccf3b0f Adding test case for #687.
The test no longer repros after a lot of my recent channel work.

Closes #687.
2011-07-22 16:22:20 -07:00
Eric Holk
54be5b044f Fixing (or at least improving) translation of move semantics for send and receive. This let's us run all of the task-comm tests. 2011-07-22 16:05:51 -07:00
Eric Holk
75ee817713 Fixing a use of uninitialized memory error in valgrind. 2011-07-22 16:05:51 -07:00
Eric Holk
838511e3aa Folding recv_val into trans_recv, since this is its only use. 2011-07-22 16:05:51 -07:00
Lindsey Kuper
e71f261e3f Exercise self-calls and overriding together a bit more. 2011-07-22 13:29:46 -07:00
Lindsey Kuper
fefeebce24 Getting rid of obsolete comments. 2011-07-22 13:10:44 -07:00
Eric Holk
898083f8fc Commenting out the huge-memory-using lines in pfib. 2011-07-22 11:55:07 -07:00
Marijn Haverbeke
5cdb010fae Remove typechecker work-arounds now that I know how 2011-07-22 20:15:46 +02:00
Brian Anderson
07732545d2 Add xfail-stage3 directives to tests
The new test runners run stage 3
2011-07-22 10:18:28 -07:00
Brian Anderson
6fc33163dc Change the CFG_STDLIB_DEFAULT macro into a call that picks the correct stage
stageN/rustc depends on either stageN/libstd.so or stage(N-1)/lib/libstd.rlib
so CFG_STDLIB_DEFAULT needs to try harder to get the dependencies right.
2011-07-22 10:18:28 -07:00
Brian Anderson
e891e0b992 Print a list of test failures in the test summary. Issue #428 2011-07-22 10:18:28 -07:00
Marijn Haverbeke
b9b674abe7 Start adding support for multiple variable declarations per stmt
This adds parser support and most of the machinery for

    auto x = 10, y = 20;

However, the above still goes wrong somewhere in typestate, causing
the state checker to believe only the last variable in the list is
initialized after the statement.

Tim, if you have a moment, could you go over the changes to the tstate
code in this patch and see where I'm going wrong?

Multi-var-decls without the typestate extension

Add a loop
2011-07-22 17:51:26 +02:00
Marijn Haverbeke
b45d973552 Rewrite trans_cast, float->float and float->int casts 2011-07-22 13:10:59 +02:00
Marijn Haverbeke
5864d4e13a Report unresolved names only once per function
Closes #708
2011-07-22 11:38:30 +02:00
Marijn Haverbeke
bc33897525 Revert "Enable run-pass/lib-run on win32. Closes #714"
This reverts commit 1348a383c3.

Seems that this test is still broken on win.
2011-07-22 09:59:27 +02:00
Marijn Haverbeke
93ffed4c16 Fix unboxing in alias pass
The alias checker would only deref once for autoderef, and only deref
boxes. It should now do the right thing. Closes #725.
2011-07-22 09:29:01 +02:00
Brian Anderson
1348a383c3 Enable run-pass/lib-run on win32. Closes #714 2011-07-21 19:52:27 -07:00
Brian Anderson
ed25dfe2ca Disable run-pass/lib-io.rs on mac 2011-07-21 19:36:55 -07:00
Lindsey Kuper
5566e0c3f1 Removing unnecessary argument from process_fwding_mthd(). 2011-07-21 18:41:30 -07:00
Brian Anderson
06a6005447 Use correct win file open constants, per MinGW 2011-07-21 18:23:15 -07:00
Michael Sullivan
a0a2cee896 Clean up build_environment by having it return a rec with usefully named fields. 2011-07-21 18:19:07 -07:00
Michael Sullivan
4170390cb6 Add some useful functions to freevars. 2011-07-21 18:18:59 -07:00