Skip to content

Commit

Permalink
move tests into common folder
Browse files Browse the repository at this point in the history
allow to change backend on turbo tasks tests
  • Loading branch information
sokra committed Aug 7, 2024
1 parent 93ad2f2 commit d5f0f9a
Show file tree
Hide file tree
Showing 35 changed files with 1,637 additions and 1,602 deletions.
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions turbopack/crates/turbo-tasks-build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ pub fn generate_register() {
if examples_dir.exists() {
for item in read_dir(examples_dir).unwrap() {
let item = item.unwrap();
if item.file_type().unwrap().is_file() {
let file_type = &item.file_type().unwrap();
if file_type.is_file() || file_type.is_symlink() {
let name = item.file_name();
let name = name.to_string_lossy();
if name.ends_with(".rs") {
Expand All @@ -68,7 +69,8 @@ pub fn generate_register() {
if tests_dir.exists() {
for item in read_dir(tests_dir).unwrap() {
let item = item.unwrap();
if item.file_type().unwrap().is_file() {
let file_type = &item.file_type().unwrap();
if file_type.is_file() || file_type.is_symlink() {
let name = item.file_name();
let name = name.to_string_lossy();
if name.ends_with(".rs") {
Expand All @@ -80,7 +82,7 @@ pub fn generate_register() {

if benches_dir.exists() {
let bench_mod = benches_dir.join("mod.rs");
if bench_mod.is_file() {
if bench_mod.is_file() || bench_mod.is_symlink() {
let name = bench_mod.file_name().unwrap();
let name = name.to_string_lossy();
if name.ends_with(".rs") {
Expand Down
1 change: 1 addition & 0 deletions turbopack/crates/turbo-tasks-fetch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ turbopack-core = { workspace = true }
httpmock = { workspace = true }
tokio = { workspace = true, features = ["full"] }
turbo-tasks-testing = { workspace = true }
turbo-tasks-memory = { workspace = true }

[build-dependencies]
turbo-tasks-build = { workspace = true }
1 change: 1 addition & 0 deletions turbopack/crates/turbo-tasks-fetch/tests/test_config.trs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
turbo_tasks::TurboTasks::new(turbo_tasks_memory::MemoryBackend::new(usize::MAX))
1 change: 1 addition & 0 deletions turbopack/crates/turbo-tasks-macros-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ tokio = { workspace = true }
trybuild = { version = "1.0.97" }
turbo-tasks = { workspace = true }
turbo-tasks-testing = { workspace = true }
turbo-tasks-memory = { workspace = true }

[build-dependencies]
turbo-tasks-build = { workspace = true }
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
turbo_tasks::TurboTasks::new(turbo_tasks_memory::MemoryBackend::new(usize::MAX))
201 changes: 0 additions & 201 deletions turbopack/crates/turbo-tasks-memory/tests/all_in_one.rs

This file was deleted.

1 change: 1 addition & 0 deletions turbopack/crates/turbo-tasks-memory/tests/all_in_one.rs
Loading

0 comments on commit d5f0f9a

Please sign in to comment.