Commit Graph

104 Commits

Author SHA1 Message Date
Jean-Baptiste Boric
67f01fd82e checksum: Don't read the entire input file in memory
Unsurprisingly, this doesn't work too well if the input file is in the
gigabyte range.
2021-03-19 09:15:19 +01:00
Linus Groh
cf127b745e js: Don't print last value after exception and return non-success
If in 'foo(); bar();' bar fails, we'd get the error of that and then
foo's return value - that's probably not something anyone expects.

Also make sure to return non-success so the process will exit with 1.
2021-03-18 21:46:56 +01:00
Linus Groh
1ef0078b4c js: Replace TypedArray class_name() string compare with is<T>() 2021-03-18 21:46:56 +01:00
Jean-Baptiste Boric
711a47b784 truncate: Make 64 bit clean 2021-03-17 23:22:42 +01:00
Jean-Baptiste Boric
570bb81a31 ls: Make 64 bit clean 2021-03-17 23:22:42 +01:00
Jean-Baptiste Boric
10df91b424 df: Make 64 bit clean 2021-03-17 23:22:42 +01:00
Jean-Baptiste Boric
ade6343fca Userland: Fix printf specifiers with off_t
In theory we should probably use the 'j' qualifier, but we don't
support it.
2021-03-17 23:22:42 +01:00
Andreas Kling
d792200a55 LibJS: Rename GlobalObject::initialize() => initialize_global_object()
This function was shadowing Object::initialize() which cannot be called
on global objects and has a different set of parameters.
2021-03-17 16:53:35 +01:00
ElDonad
f4f12982ff bt: add source file number integration 2021-03-15 16:08:31 +01:00
Brendan Coles
eecaa3bed6 test-compress: Initialize byte buffer with random data 2021-03-14 21:37:29 +01:00
Brendan Coles
81cbb2676e readelf: Tweak section headers output column padding 2021-03-14 21:36:54 +01:00
Brendan Coles
6bc01909b7 readelf: Add support for core notes and relocations 2021-03-14 13:55:07 +01:00
Idan Horowitz
7e587a615e LibCompress: Handle literal only lz77 streams in DeflateCompressor
Very incompressible data could sometimes produce no backreferences
which would result in no distance huffman code being created (as it
was not needed), so VERIFY the code exists only if it is actually
needed for writing the stream.
2021-03-14 11:05:35 +01:00
Idan Horowitz
b3b920eddc tar: Implement tar archive creation
This completes our tar utility by implementing the -c option
for archive creation using TarOutputStream and optionally
GzipCompressor for compression via the -z option.
2021-03-13 20:07:25 +01:00
Idan Horowitz
7eab20bad0 LibTar: Implement TarOutputStream
This output stream creates gnu format tar archives
and currently only supports files and directories.
2021-03-13 20:07:25 +01:00
Idan Horowitz
512431a228 test-compress: Add GZip compression tests 2021-03-13 20:07:25 +01:00
Idan Horowitz
02569bec11 test-compress: Add DEFLATE compression tests 2021-03-13 20:07:25 +01:00
Itamar
8688259ed9 LanguageServers/Cpp: Support jumping to declaration of preprocessor
.. definitions.
2021-03-13 10:17:02 +01:00
Andreas Kling
ef1e5db1d0 Everywhere: Remove klog(), dbg() and purge all LogStream usage :^)
Good-bye LogStream. Long live AK::Format!
2021-03-12 17:29:37 +01:00
Ben Wiederhake
f38a6b18b5 crash: Fix more typos in check logic
These caused no test to run for '-f' and mmap to fail, respectively.
2021-03-11 12:32:53 +01:00
Ben Wiederhake
798dea7a49 crash: Fix typo in check logic
The remainder of the code assumes that the mmap was successful,
so the 'unexpected error' case is that we see MAP_FAILED.
2021-03-11 12:32:53 +01:00
Ben Wiederhake
bceb98e2df Userland: Remove superfluous headers
Userland has no reason to access 'kmalloc'.
2021-03-11 12:32:53 +01:00
Ben Wiederhake
2cd0793578 xargs: Fix boring memory leak
It's only 1K (BUFSIZ), and it's immediately before xargs finishes anyway.
However, I ran into it and know how to fix it, so let's clean this up.
2021-03-11 12:32:53 +01:00
Ben Wiederhake
a265ea98b9 Utilities: Add a quotes database and 'fortunes' program
I told you, we need a quotes ~~page~~ file! :D
2021-03-09 22:10:30 +01:00
Brendan Coles
69b98f7d32 Base: Add sysctl man page 2021-03-08 09:48:34 +01:00
Linus Groh
3532e1788f open: Fix opening "." (again)
We can't always rely on the initial URL's path(), so use either the
user-specified argument or the URL path for determining the realpath,
depending on whether we got a file:// URL argument.

Fixes #4950.
2021-03-07 17:39:58 +01:00
Andrew Kaster
8453bb3461 Userland: Gate OSC 9 usage in test-js behind an argument
Instead of assuming that we should use the OSC 9 progress messages
whenever we run on serenity, add a show-progress=[true|false] option.

This lets us avoid seeing esc sequence spam in GitHub Actions logs.
2021-03-02 09:00:21 +01:00
Brian Gianforcaro
e60d394b32 test-web: Utilize new LibTest types from test-web
test-web has alot of similar code to test-js, so
re-use some of the types we already pulled out
into LibTest.
2021-03-01 11:17:05 +01:00
Brian Gianforcaro
0a49877fdc LibTest + test-js: Add initial skelaton of LibTest and migrate code there.
The test-js reporter is arguably the nicest test runner / reporter that
exists in the serenity code base. To the goal of leveling up all the
other unit test environments, start a new LibTest library so that we
can share code and reporting utilities to make all the test systems
look and behave similarly.
2021-03-01 11:17:05 +01:00
Andrew Kaster
c2d8b8ec14 Userland: Don't leak buffer from getline in shuf program
Probably doesn't matter too too much since the program exits almost
immediately after, but there's the principle of the thing to consider.
2021-02-28 18:19:37 +01:00
Idan Horowitz
c940fd6b7d Userland: Add a simple mktemp(1) utility 2021-02-28 15:30:49 +01:00
Linus Groh
e265054c12 Everywhere: Remove a bunch of redundant 'AK::' namespace prefixes
This is basically just for consistency, it's quite strange to see
multiple AK container types next to each other, some with and some
without the namespace prefix - we're 'using AK::Foo;' a lot and should
leverage that. :^)
2021-02-26 16:59:56 +01:00
Andreas Kling
1318b9391d disk_benchmark: Modernize this code a little bit
Use the new formatting helpers and such.
2021-02-26 14:05:18 +01:00
Andreas Kling
5d180d1f99 Everywhere: Rename ASSERT => VERIFY
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED)

Since all of these checks are done in release builds as well,
let's rename them to VERIFY to prevent confusion, as everyone is
used to assertions being compiled out in release.

We can introduce a new ASSERT macro that is specifically for debug
checks, but I'm doing this wholesale conversion first since we've
accumulated thousands of these already, and it's not immediately
obvious which ones are suitable for ASSERT.
2021-02-23 20:56:54 +01:00
AnotherTest
347d741afb AK+Userland: Extend the compiletime format string check to other functions
Thanks to @trflynn89 for the neat implicit consteval ctor trick!
This allows us to basically slap `CheckedFormatString` on any
formatting function, and have its format argument checked at compiletime.

Note that there is a validator bug where it doesn't parse inner replaced
fields like `{:~>{}}` correctly (what should be 'left align with next
argument as size' is parsed as `{:~>{` following a literal closing
brace), so the compiletime checks are disabled on these temporarily by
forcing them to be StringViews.

This commit also removes the now unused `AK::StringLiteral` type (which
was introduced for use with NTTP strings).
2021-02-23 13:59:33 +01:00
Ben Wiederhake
e3c00c93ae Utilities: Provide fuzzers as a utility in serenity 2021-02-21 22:34:09 +01:00
Mițca Dumitru
ecafee86f8 rm: Use Core::File::remove 2021-02-21 18:14:29 +01:00
Mițca Dumitru
f4569ecf3c Utilities: Remove cp.h
It is no longer used
2021-02-21 18:14:29 +01:00
Mițca Dumitru
edb543657a mv: Use Core::File::copy_file_or_directory 2021-02-21 18:14:29 +01:00
Mițca Dumitru
3f88fd81d1 cp: Use Core::File::copy_file_or_directory 2021-02-21 18:14:29 +01:00
Brian Gianforcaro
3019445492 Userland: Use uniform initialization instead of memset 2021-02-21 11:52:47 +01:00
Andreas Kling
2a22d346dc utmpupdate: Don't complain about an error if the utmp is just empty
This removes a misleading error message during startup.
2021-02-21 10:56:55 +01:00
Itamar
d3ff82ba80 LibCpp: Store filename in ASTNodes
As part of the position information, we now also store the filename the
ASTNode belongs to.
2021-02-20 15:53:37 +01:00
Luke
0304f7bbbe test-web: Create execution scope for new interpreter instead of the old one
It was accidentally creating a scope for the old interpreter
instead of the new one.

Fixes #5415
2021-02-20 10:48:34 +01:00
Bui Quang Minh
ff67340d81 Userland: Support moving files between different mounted filesystems
In case we cannot use rename() because of cross-device error, copy file to the
destination then unlink the old source file.
2021-02-20 09:30:11 +01:00
Andreas Kling
1a4136c4ac PreprocessorTest: Convert dbgprintf() => dbgln() 2021-02-17 15:50:34 +01:00
AnotherTest
6f9e6e63b6 grep: Exit with 1 if nothing matches 2021-02-15 17:32:56 +01:00
AnotherTest
3fe7ac0924 LibCrypto: Make a better ASN.1 parser
And use it to parse RSA keys.
As a bonus, this one shouldn't be reading out of bounds or messing with
the stack (as much) anymore.
2021-02-14 13:30:10 +01:00
Ben Wiederhake
fcda9ee7f5 Utilities: Fix embarassing typo in syscall(1) 2021-02-14 10:57:33 +01:00
Ben Wiederhake
9452281bec Tests: Merge and extend syscall tests into a syscall fuzzer
This found the previous bugs :^)
2021-02-13 00:40:31 +01:00