forked from espressif/esp-idf
feat(tools): Exclude modified folders by rebuild
This commit is contained in:
@ -1,15 +1,21 @@
|
|||||||
# SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
# SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
# These tests check whether the build system rebuilds some files or not
|
# These tests check whether the build system rebuilds some files or not
|
||||||
# depending on the changes to the project.
|
# depending on the changes to the project.
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import List, Union
|
from typing import List
|
||||||
|
from typing import Union
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from test_build_system_helpers import (ALL_ARTIFACTS, APP_BINS, BOOTLOADER_BINS, PARTITION_BIN, IdfPyFunc,
|
from test_build_system_helpers import ALL_ARTIFACTS
|
||||||
get_snapshot, replace_in_file)
|
from test_build_system_helpers import APP_BINS
|
||||||
|
from test_build_system_helpers import BOOTLOADER_BINS
|
||||||
|
from test_build_system_helpers import get_snapshot
|
||||||
|
from test_build_system_helpers import IdfPyFunc
|
||||||
|
from test_build_system_helpers import PARTITION_BIN
|
||||||
|
from test_build_system_helpers import replace_in_file
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures('test_app_copy')
|
@pytest.mark.usefixtures('test_app_copy')
|
||||||
@ -18,7 +24,9 @@ def test_rebuild_no_changes(idf_py: IdfPyFunc) -> None:
|
|||||||
idf_py('build')
|
idf_py('build')
|
||||||
logging.info('get the first snapshot')
|
logging.info('get the first snapshot')
|
||||||
# excluding the 'log' subdirectory here since it changes after every build
|
# excluding the 'log' subdirectory here since it changes after every build
|
||||||
all_build_files = get_snapshot('build/**/*', exclude_patterns='build/log/*')
|
all_build_files = get_snapshot('build/**/*', exclude_patterns=['build/log/*',
|
||||||
|
'build/CMakeFiles/bootloader-complete',
|
||||||
|
'build/bootloader-prefix/src/bootloader-stamp/bootloader-done'])
|
||||||
|
|
||||||
logging.info('check that all build artifacts were generated')
|
logging.info('check that all build artifacts were generated')
|
||||||
for artifact in ALL_ARTIFACTS:
|
for artifact in ALL_ARTIFACTS:
|
||||||
@ -27,7 +35,9 @@ def test_rebuild_no_changes(idf_py: IdfPyFunc) -> None:
|
|||||||
logging.info('build again with no changes')
|
logging.info('build again with no changes')
|
||||||
idf_py('build')
|
idf_py('build')
|
||||||
# if there are no changes, nothing gets rebuilt
|
# if there are no changes, nothing gets rebuilt
|
||||||
all_build_files_after_rebuild = get_snapshot('build/**/*', exclude_patterns='build/log/*')
|
all_build_files_after_rebuild = get_snapshot('build/**/*', exclude_patterns=['build/log/*',
|
||||||
|
'build/CMakeFiles/bootloader-complete',
|
||||||
|
'build/bootloader-prefix/src/bootloader-stamp/bootloader-done'])
|
||||||
all_build_files_after_rebuild.assert_same(all_build_files)
|
all_build_files_after_rebuild.assert_same(all_build_files)
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user