MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / kernel_cc_compiles_and_runs

Function kernel_cc_compiles_and_runs

tests/integration/kernel_integration.rs:1779–1816  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1777 assert!(
1778 !uart.contains("unhandled exception"),
1779 "the compiled program faulted; uart={uart:?}"
1780 );
1781 assert!(
1782 uart.contains("cc: wrote /prog.s"),
1783 "compiler did not report success; uart={uart:?}"
1784 );
1785 assert!(
1786 uart.contains("ld: wrote /prog"),
1787 "linker did not report success; uart={uart:?}"
1788 );
1789 assert!(
1790 uart.contains("HLL0"),
1791 "program marker missing; uart={uart:?}"
1792 );
1793 assert!(
1794 uart.contains("[exit 36]"),
1795 "compiled program did not exit 36; uart={uart:?}"
1796 );
1797 assert!(
1798 matches!(outcome, RunOutcome::Halted(0)),
1799 "shell did not survive the run and exit cleanly; outcome={outcome:?} uart={uart:?}"
1800 );
1801}
1802
1803// Repro of the interactive self-hosting session: cwd /home/src, relative paths to
1804// cc/as, and bare-name execution (`hello`, not `run /abs/path`).
1805#[test]
1806fn kernel_cc_interactive_relative_paths_and_barename() {
1807 let (outcome, uart) = run_tool_session(
1808 &["as", "cc", "ld"],
1809 &[
1810 ("/home/src/hello.hll", user::CC_DEMO_HLL.as_bytes()),
1811 ("/home/src/stdlib.s", user::EXAMPLE_STDLIB_S.as_bytes()),
1812 ],
1813 "cd /home/src\ncc hello.hll hello.s\nas hello.s hello.o\nas stdlib.s stdlib.o\n\
1814ld stdlib.o hello.o hello\nhello\nexit\n",
1815 300_000_000,
1816 );
1817
1818 assert!(!uart.contains("PANIC!"), "kernel panicked; uart={uart:?}");
1819 assert!(

Callers

nothing calls this directly

Calls 1

run_tool_sessionFunction · 0.85

Tested by

no test coverage detected