Integration Tests #1006
Replies: 31 comments
-
Great stuff! |
Beta Was this translation helpful? Give feedback.
-
In Additional Test Executables and Bootimage Test paragraphs the author mentions unit test, but judging by context, aren't those supposed be integration tests? |
Beta Was this translation helpful? Give feedback.
-
Fist off thanks for the great tutorial! On my machine I seem to have to append --target x86_64-blog_os.json to all bootimage commands...not a huge deal, just curious if I am doing something obviously wrong. without the target called out specifically I get: |
Beta Was this translation helpful? Give feedback.
-
@atedp We configured bootimage to use the |
Beta Was this translation helpful? Give feedback.
-
@skierpage Thanks!
Yeah, I think so. Here is an incomplete list of the common port ranges. |
Beta Was this translation helpful? Give feedback.
-
@phil-opp Woops, I definitely missed that :) Thanks!! |
Beta Was this translation helpful? Give feedback.
-
Hello very good tutorial. Thanks for sharing this. One question popped up though: What is the purpose of using: #![feature(const_fn)] in |
Beta Was this translation helpful? Give feedback.
-
I don't see it in |
Beta Was this translation helpful? Give feedback.
-
Seems like it. Should be removed in 3365a4f. Thanks for reporting! |
Beta Was this translation helpful? Give feedback.
-
@phil-opp , thank you for another great article. Could you please explain the reason of choosing the As far as I remember, UART allows a two-way communication... (and you've also mentioned that fact in the beginning of an article). P.S. explaining how to build a library and a "hybrid project" clearly adds some education value to the article. Still, please consider highlighting the pros and cons of different test framework implementation approaches. So far It's a bit unclear for the beginners (like me) P.P.S. I have created a dedicated issue #451 |
Beta Was this translation helpful? Give feedback.
-
I followed the tutorial and found that #[cfg(test)]
extern crate std;
#[cfg(test)]
extern crate array_init; Since this was previously in |
Beta Was this translation helpful? Give feedback.
-
Hello again @phil-opp :D, working again through your tutorial. I encountered one minor problem. Which i believe is just my in proper use of the tools. Nonetheless i've got a question: the qemu commandline option "-device isa-debug-exit,iobase=0xf4,iosize=0x04" i cannot find any concrete information about this option. could you please tell from where you got it? |
Beta Was this translation helpful? Give feedback.
-
@nukeop It's included in the example code for #![no_std] // don't link the Rust standard library
...
#[cfg(test)]
extern crate array_init;
#[cfg(test)]
extern crate std;
... |
Beta Was this translation helpful? Give feedback.
-
@nukeop As @mtn said, it is part of the code listing in the “Split Off A Library” section. |
Beta Was this translation helpful? Give feedback.
-
I'm not exactly sure why this would be a reason to mark |
Beta Was this translation helpful? Give feedback.
-
@ksqsf The code relies on two conditions: (1) There is a device attached at port 0xf4 and (2) this device is the QEMU shutdown device. Both conditions might not hold in a real system. In a really bad theoretical case there could a different device at that address that interprets the sent command as "overwrite some memory region via DMA", which would break memory safety. So because we cannot prove that this function is safe in all cases, we mark it as unsafe and use it only in the integration test scenario where we know that the QEMU device exists at that address. |
Beta Was this translation helpful? Give feedback.
-
I am getting the following error : error: format argument must be a string literal Though if is use serial_println!("{}","ok") instead of serial_println!("ok") it works fine ???? |
Beta Was this translation helpful? Give feedback.
-
You might be missing a |
Beta Was this translation helpful? Give feedback.
-
I am having issue with your code in the "Split Off A Library" section, specifically the line:
I am getting this error when I run
|
Beta Was this translation helpful? Give feedback.
-
@mdunnegan Do you have the In case you're using the older version in your code and don't want to update it, you can add a |
Beta Was this translation helpful? Give feedback.
-
Hi @phil-opp, thank you for this wonderful series. I'm learning about OS as well as Rust. I've few questions/doubts if you could please help me with:
|
Beta Was this translation helpful? Give feedback.
-
Hi @krsoninikhil,
Yes, you could do that if you are sure that you'll never have unit tests in these files. The disadvantage of this approach is that any tests that you might add in the future will be silently ignored. A better solution in my opinion would be to change the behavior of
No real reason. Seperation with
There is a difference between serial ports and I/O ports. I/O ports are the fundamental building block that can be used to read/write device registers. The serial port controller is such an device with multiple device registers. If you look at the source code of the I hope this answers your questions! |
Beta Was this translation helpful? Give feedback.
-
Thanks @phil-opp for clarifying, this certainly helps. |
Beta Was this translation helpful? Give feedback.
-
I am getting the following error when i run 'bootimage run' command: blog_os git:(post-05)> bootimage run --bin test-basic-boot -- Caused by: Caused by: Caused by: |
Beta Was this translation helpful? Give feedback.
-
It does seem to come from the compiler itself. Maybe the rust toolchain you're using is broken ? |
Beta Was this translation helpful? Give feedback.
-
@guidao Are you using |
Beta Was this translation helpful? Give feedback.
-
@AntoineSebert @phil-opp yes, i am using rustup to manage my toolchains.
but libcompiler_builtin is not found in this directory |
Beta Was this translation helpful? Give feedback.
-
@guidao Thanks! I think the problem is that your |
Beta Was this translation helpful? Give feedback.
-
@phil-opp it's working. thanks. |
Beta Was this translation helpful? Give feedback.
-
This is a general purpose comment thread for the “Integration Tests” post.
Beta Was this translation helpful? Give feedback.
All reactions