[windows_kext] keep generated test data

This commit is contained in:
Vladimir Stoilov 2024-05-16 17:29:24 +03:00
parent 1c4df53152
commit 53d1d52c39
No known key found for this signature in database
GPG key ID: 2F190B67A43A81AF
6 changed files with 6 additions and 22 deletions

View file

@ -11,7 +11,7 @@ import (
func TestRustInfoFile(t *testing.T) {
t.Parallel()
file, err := os.Open("../protocol/rust_info_test.bin")
file, err := os.Open("testdata/rust_info_test.bin")
if err != nil {
panic(err)
}
@ -175,7 +175,7 @@ func TestRustInfoFile(t *testing.T) {
func TestGenerateCommandFile(t *testing.T) {
t.Parallel()
file, err := os.Create("go_command_test.bin")
file, err := os.Create("../protocol/testdata/go_command_test.bin")
if err != nil {
t.Errorf("failed to create file: %s", err)
}

Binary file not shown.

View file

@ -86,7 +86,7 @@ use std::panic;
#[test]
fn test_go_command_file() {
let mut file = File::open("../kextinterface/go_command_test.bin").unwrap();
let mut file = File::open("testdata/go_command_test.bin").unwrap();
loop {
let mut command: [u8; 1] = [0];
let bytes_count = file.read(&mut command).unwrap();

View file

@ -425,7 +425,7 @@ use rand::seq::SliceRandom;
#[test]
fn generate_test_info_file() -> Result<(), std::io::Error> {
let mut file = File::create("rust_info_test.bin")?;
let mut file = File::create("../kextinterface/testdata/rust_info_test.bin")?;
let enums = [
InfoType::LogLine,
InfoType::ConnectionIpv4,

Binary file not shown.

View file

@ -1,24 +1,8 @@
#!/bin/sh
echo Generate test files
echo ========================
cd protocol
cargo test info::generate_test_info_file
cd ../kextinterface
go test -v -run TestGenerateCommandFile
cd ..
echo ========================
echo Running tests
echo ========================
cd protocol
cargo test command::test_go_command_file
cargo test
cd ../kextinterface
go test -v -run TestRustInfoFile
echo ========================
echo Cleanup
rm go_command_test.bin
rm ../protocol/rust_info_test.bin
go test -v .