mirror of
https://github.com/safing/portmaster
synced 2025-09-01 10:09:11 +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
|
@ -11,7 +11,7 @@ import (
|
||||||
func TestRustInfoFile(t *testing.T) {
|
func TestRustInfoFile(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
file, err := os.Open("../protocol/rust_info_test.bin")
|
file, err := os.Open("testdata/rust_info_test.bin")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
@ -175,7 +175,7 @@ func TestRustInfoFile(t *testing.T) {
|
||||||
func TestGenerateCommandFile(t *testing.T) {
|
func TestGenerateCommandFile(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
file, err := os.Create("go_command_test.bin")
|
file, err := os.Create("../protocol/testdata/go_command_test.bin")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("failed to create file: %s", err)
|
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]
|
#[test]
|
||||||
fn test_go_command_file() {
|
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 {
|
loop {
|
||||||
let mut command: [u8; 1] = [0];
|
let mut command: [u8; 1] = [0];
|
||||||
let bytes_count = file.read(&mut command).unwrap();
|
let bytes_count = file.read(&mut command).unwrap();
|
||||||
|
|
|
@ -425,7 +425,7 @@ use rand::seq::SliceRandom;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn generate_test_info_file() -> Result<(), std::io::Error> {
|
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 = [
|
let enums = [
|
||||||
InfoType::LogLine,
|
InfoType::LogLine,
|
||||||
InfoType::ConnectionIpv4,
|
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
|
#!/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 Running tests
|
||||||
echo ========================
|
echo ========================
|
||||||
cd protocol
|
cd protocol
|
||||||
cargo test command::test_go_command_file
|
cargo test
|
||||||
|
|
||||||
cd ../kextinterface
|
cd ../kextinterface
|
||||||
go test -v -run TestRustInfoFile
|
go test -v .
|
||||||
|
|
||||||
echo ========================
|
|
||||||
echo Cleanup
|
|
||||||
rm go_command_test.bin
|
|
||||||
rm ../protocol/rust_info_test.bin
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue