mirror of
https://github.com/safing/portmaster
synced 2025-04-08 21:19:10 +00:00
[windows_kext] keep generated test data
This commit is contained in:
parent
1c4df53152
commit
53d1d52c39
6 changed files with 6 additions and 22 deletions
windows_kext
|
@ -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)
|
||||
}
|
||||
|
|
BIN
windows_kext/kextinterface/testdata/rust_info_test.bin
vendored
Normal file
BIN
windows_kext/kextinterface/testdata/rust_info_test.bin
vendored
Normal file
Binary file not shown.
|
@ -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();
|
||||
|
|
|
@ -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,
|
||||
|
|
BIN
windows_kext/protocol/testdata/go_command_test.bin
vendored
Normal file
BIN
windows_kext/protocol/testdata/go_command_test.bin
vendored
Normal file
Binary file not shown.
|
@ -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 .
|
||||
|
|
Loading…
Add table
Reference in a new issue